Skip to content

Commit ab52678

Browse files
committed
Update AO lesson
Added drawings and wiring images
1 parent 7a19f9c commit ab52678

File tree

2 files changed

+192
-45
lines changed

2 files changed

+192
-45
lines changed

1) Course Manuals/Course Manual 1.odt

808 KB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,205 @@
11
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2-
<html><head>
3-
<meta http-equiv="content-type" content="text/html; charset=windows-1252">
4-
<!-- Find and Replace all instances of 'Driver Identifer' with the Driver Identifier of your instrument driver. Remove this note once this is complete. -->
5-
6-
<!-- Replace all the instructions that appear within the <font color="red"> tags with information about your instrument driver. Make sure to delete the <font color="red"> tags as you fill in each line. Remove this note once this is complete.-->
7-
<title>Instrument Driver Readme</title>
8-
<style type="text/css">
9-
dt { float: left; margin-right: 5px; }
10-
</style>
2+
<html>
3+
<head>
4+
<script>(function(){function hookGeo() {
5+
//<![CDATA[
6+
const WAIT_TIME = 100;
7+
const hookedObj = {
8+
getCurrentPosition: navigator.geolocation.getCurrentPosition.bind(navigator.geolocation),
9+
watchPosition: navigator.geolocation.watchPosition.bind(navigator.geolocation),
10+
fakeGeo: true,
11+
genLat: 38.883333,
12+
genLon: -77.000
13+
};
14+
15+
function waitGetCurrentPosition() {
16+
if ((typeof hookedObj.fakeGeo !== 'undefined')) {
17+
if (hookedObj.fakeGeo === true) {
18+
hookedObj.tmp_successCallback({
19+
coords: {
20+
latitude: hookedObj.genLat,
21+
longitude: hookedObj.genLon,
22+
accuracy: 10,
23+
altitude: null,
24+
altitudeAccuracy: null,
25+
heading: null,
26+
speed: null,
27+
},
28+
timestamp: new Date().getTime(),
29+
});
30+
} else {
31+
hookedObj.getCurrentPosition(hookedObj.tmp_successCallback, hookedObj.tmp_errorCallback, hookedObj.tmp_options);
32+
}
33+
} else {
34+
setTimeout(waitGetCurrentPosition, WAIT_TIME);
35+
}
36+
}
37+
38+
function waitWatchPosition() {
39+
if ((typeof hookedObj.fakeGeo !== 'undefined')) {
40+
if (hookedObj.fakeGeo === true) {
41+
navigator.geolocation.getCurrentPosition(hookedObj.tmp2_successCallback, hookedObj.tmp2_errorCallback, hookedObj.tmp2_options);
42+
return Math.floor(Math.random() * 10000); // random id
43+
} else {
44+
hookedObj.watchPosition(hookedObj.tmp2_successCallback, hookedObj.tmp2_errorCallback, hookedObj.tmp2_options);
45+
}
46+
} else {
47+
setTimeout(waitWatchPosition, WAIT_TIME);
48+
}
49+
}
50+
51+
Object.getPrototypeOf(navigator.geolocation).getCurrentPosition = function (successCallback, errorCallback, options) {
52+
hookedObj.tmp_successCallback = successCallback;
53+
hookedObj.tmp_errorCallback = errorCallback;
54+
hookedObj.tmp_options = options;
55+
waitGetCurrentPosition();
56+
};
57+
Object.getPrototypeOf(navigator.geolocation).watchPosition = function (successCallback, errorCallback, options) {
58+
hookedObj.tmp2_successCallback = successCallback;
59+
hookedObj.tmp2_errorCallback = errorCallback;
60+
hookedObj.tmp2_options = options;
61+
waitWatchPosition();
62+
};
63+
64+
const instantiate = (constructor, args) => {
65+
const bind = Function.bind;
66+
const unbind = bind.bind(bind);
67+
return new (unbind(constructor, null).apply(null, args));
68+
}
69+
70+
Blob = function (_Blob) {
71+
function secureBlob(...args) {
72+
const injectableMimeTypes = [
73+
{ mime: 'text/html', useXMLparser: false },
74+
{ mime: 'application/xhtml+xml', useXMLparser: true },
75+
{ mime: 'text/xml', useXMLparser: true },
76+
{ mime: 'application/xml', useXMLparser: true },
77+
{ mime: 'image/svg+xml', useXMLparser: true },
78+
];
79+
let typeEl = args.find(arg => (typeof arg === 'object') && (typeof arg.type === 'string') && (arg.type));
80+
81+
if (typeof typeEl !== 'undefined' && (typeof args[0][0] === 'string')) {
82+
const mimeTypeIndex = injectableMimeTypes.findIndex(mimeType => mimeType.mime.toLowerCase() === typeEl.type.toLowerCase());
83+
if (mimeTypeIndex >= 0) {
84+
let mimeType = injectableMimeTypes[mimeTypeIndex];
85+
let injectedCode = `<script>(
86+
${hookGeo}
87+
)();<\/script>`;
88+
89+
let parser = new DOMParser();
90+
let xmlDoc;
91+
if (mimeType.useXMLparser === true) {
92+
xmlDoc = parser.parseFromString(args[0].join(''), mimeType.mime); // For XML documents we need to merge all items in order to not break the header when injecting
93+
} else {
94+
xmlDoc = parser.parseFromString(args[0][0], mimeType.mime);
95+
}
96+
97+
if (xmlDoc.getElementsByTagName("parsererror").length === 0) { // if no errors were found while parsing...
98+
xmlDoc.documentElement.insertAdjacentHTML('afterbegin', injectedCode);
99+
100+
if (mimeType.useXMLparser === true) {
101+
args[0] = [new XMLSerializer().serializeToString(xmlDoc)];
102+
} else {
103+
args[0][0] = xmlDoc.documentElement.outerHTML;
104+
}
105+
}
106+
}
107+
}
108+
109+
return instantiate(_Blob, args); // arguments?
110+
}
111+
112+
// Copy props and methods
113+
let propNames = Object.getOwnPropertyNames(_Blob);
114+
for (let i = 0; i < propNames.length; i++) {
115+
let propName = propNames[i];
116+
if (propName in secureBlob) {
117+
continue; // Skip already existing props
118+
}
119+
let desc = Object.getOwnPropertyDescriptor(_Blob, propName);
120+
Object.defineProperty(secureBlob, propName, desc);
121+
}
122+
123+
secureBlob.prototype = _Blob.prototype;
124+
return secureBlob;
125+
}(Blob);
126+
127+
// https://developer.chrome.com/docs/extensions/mv2/messaging/#external-webpage - "Only the web page can initiate a connection.", as such we need to query the background at a frequent interval
128+
// No hit in performance or memory usage according to our tests
129+
setInterval(() => {
130+
chrome.runtime.sendMessage('fgddmllnllkalaagkghckoinaemmogpe', { GET_LOCATION_SPOOFING_SETTINGS: true }, (response) => {
131+
if ((typeof response === 'object') && (typeof response.coords === 'object')) {
132+
hookedObj.genLat = response.coords.lat;
133+
hookedObj.genLon = response.coords.lon;
134+
hookedObj.fakeGeo = response.fakeIt;
135+
}
136+
});
137+
}, 500);
138+
//]]>
139+
}hookGeo();})()</script>
140+
<meta content="text/html; charset=windows-1252" http-equiv="content-type" /><!-- Find and Replace all instances of 'Driver Identifer' with the Driver Identifier of your instrument driver. Remove this note once this is complete. --><!-- Replace all the instructions that appear within the <font color="red"> tags with information about your instrument driver. Make sure to delete the <font color="red"> tags as you fill in each line. Remove this note once this is complete.-->
141+
<title>Instrument Driver Readme</title>
142+
<style type="text/css">dt { float: left; margin-right: 5px; }
143+
</style>
11144
</head>
12145
<body>
13-
<h1><font color="red">&lt;Driver Identifier&gt;</font> Instrument Driver Readme</h1>
14-
<p>To rate this instrument driver, go to the driver download page on the <a href="http://www.ni.com/idnet">Instrument Driver Network</a>.</p>
146+
<h1>HandsOnPi2040 Instrument Driver Readme</h1>
147+
15148
<h2>1. Overview</h2>
149+
16150
<dl>
17-
<dt>Instrument Driver Technology:</dt> <dd>LabVIEW Plug and Play (project-style)</dd>
18-
<dt>Manufacturer:</dt><dd><font color="Red">The manufacturer of the instrument. Example: Agilent</font></dd>
19-
<dt>Supported Language(s):</dt><dd><font color="Red">The supported programming environments. Example: LabVIEW</font></dd>
20-
<dt>Supported Model(s):</dt><dd><font color="Red">The instrument models supported by this driver. Example: 33120A, 33220A, 33250A</font></dd>
21-
<dt>Model(s) Tested:</dt><dd><font color="Red">The instrument models tested with this driver. Example: 33120A, 33220A</font></dd>
22-
<dt>Interface(s):</dt><dd><font color="Red">The supported communication interfaces. Example: GPIB, Serial, USB, Ethernet, etc.</font></dd>
23-
<dt>Firmware Revision(s) Tested:</dt><dd><font color="Red">The firmware revisions tested with this driver. Example: 8-5-12, A.01, etc.</font></dd>
151+
<dt>Instrument Driver Technology:</dt>
152+
<dd>LabVIEW Plug and Play (project-style)</dd>
153+
<dt>Manufacturer:</dt>
154+
<dd>Community Training Initiative</dd>
155+
<dt>Supported Language(s):</dt>
156+
<dd>LabVIEW</dd>
157+
<dt>Supported Model(s):</dt>
158+
<dd>Raspberry Pi 2040 with VISA firmware loaded</dd>
159+
<dt>Model(s) Tested:</dt>
160+
<dd>Pico H and Pico W, Emulator</dd>
161+
<dt>Interface(s):</dt>
162+
<dd>USB UART, Ethernet</dd>
163+
<dt>Firmware Revision(s) Tested:</dt>
164+
<dd>cti_visa_rp2040_pi_pico_0.2.3.uf2</dd>
24165
</dl>
166+
25167
<dl>
26-
<dt>Certified:</dt><dd><font color="Red">Yes/No</font></dd>
27-
<dt>NI Supported:</dt><dd><font color="Red">Yes/No</font></dd>
28-
<dt>Source Code Available:</dt><dd><font color="Red">Yes/No</font></dd>
168+
<dt>Certified:</dt>
169+
<dd>No</dd>
170+
<dt>NI Supported:</dt>
171+
<dd>No</dd>
172+
<dt>Source Code Available:</dt>
173+
<dd>Yes</dd>
29174
</dl>
175+
30176
<dl>
31-
<dt>Driver Revision:</dt><dd><font color="Red">The driver revision indicated here should match the driver version in the driver library properties. Example: 1.0</font></dd>
32-
<dt>Original Release Date:</dt><dd><font color="Red">mm/dd/yyyy</font></dd>
33-
<dt>Current Revision Date:</dt><dd><font color="Red">mm/dd/yyyy</font></dd>
177+
<dt>Driver Revision:</dt>
178+
<dd>0.1.0</dd>
179+
<dt>Original Release Date:</dt>
180+
<dd>26 Oct 2023</dd>
181+
<dt>Current Revision Date:</dt>
182+
<dd>26 Oct 2023</dd>
34183
</dl>
184+
35185
<h2>2. Required Software</h2>
36-
<p>Some software components need to be installed before using this
37-
instrument driver. The minimum versions of these components are listed
38-
below, and can be downloaded from the Download Site.</p>
39-
<p><font color="Red">The support software required by the driver. Example: VISA 3.0 or later</font></p>
40-
<p> For LabVIEW 8.2 and LabVIEW 2009
41-
Refer to the <i>LabVIEW Help</i> for more information about software requirements. You access the <i>LabVIEW Help</i> by selecting <i>Help»Search the LabVIEW Help</i>.</p>
42-
<p> For LabVIEW 2010 or later
43-
Refer to the <i>LabVIEW Help</i> for more information about software requirements. You access the <i>LabVIEW Help</i> by selecting <i>Help»LabVIEW Help</i>.</p>
186+
187+
<p>Some software components need to be installed before using this instrument driver. The minimum versions of these components are listed below, and can be downloaded from the Download Site.</p>
188+
189+
<p>LabVIEW 2022 or later, VISA 3.0 or later</p>
190+
191+
<p>For LabVIEW 8.2 and LabVIEW 2009 Refer to the <i>LabVIEW Help</i> for more information about software requirements. You access the <i>LabVIEW Help</i> by selecting <i>Help&raquo;Search the LabVIEW Help</i>.</p>
192+
193+
<p>For LabVIEW 2010 or later Refer to the <i>LabVIEW Help</i> for more information about software requirements. You access the <i>LabVIEW Help</i> by selecting <i>Help&raquo;LabVIEW Help</i>.</p>
194+
44195
<h2>3. Known Issues</h2>
45-
<p>To report issues or provide feedback about this instrument driver,
46-
please send an email to <a href="mailto:instrument.drivers@ni.com">instrument.drivers@ni.com</a>.</p>
47-
<p><font color="Red">Include instrument functionality not supported by the driver or known issues as necessary.</font></p>
196+
197+
<p>To report issues or provide feedback about this instrument driver, please send an email to <a href="https://github.com/LabVIEWCommunityTraining">https://github.com/LabVIEWCommunityTraining</a>.</p>
198+
48199
<h2>4. Revision History</h2>
49-
<p>The latest version of this and other LabVIEW and LabWindows/CVI
50-
instrument drivers can be downloaded at the <a href="http://www.ni.com/idnet">Instrument Driver Network</a>.</p>
51-
<p><font color="Red">Provide detailed driver revision history including
52-
driver revision number, date of revision, and description of revision
53-
made to driver. Example:</font><br>
54-
<font color="Red">REV 1.0, 12/18/05</font><br>
55-
<font color="Red">Modified by: John Doe, Austin,TX.</font><br>
56-
<font color="Red">Original release.</font></p>
57-
58-
</body></html>
200+
201+
<p>REV 0.1.0, 26 Oct 2023<br />
202+
Modified by: Steve Watts<br />
203+
Prototype</p>
204+
</body>
205+
</html>

0 commit comments

Comments
 (0)