Browse Source

General fixes

Neal Wilson 11 years ago
parent
commit
3d44733294
1 changed files with 12 additions and 9 deletions
  1. 12
    9
      config/Windows/productionroaster.xml

+ 12
- 9
config/Windows/productionroaster.xml View File

110
 				var driverIndex = configModel.index(i, 0, rootIndex);
110
 				var driverIndex = configModel.index(i, 0, rootIndex);
111
 				var driverReference = configModel.referenceElement(configModel.data(driverIndex, 32));
111
 				var driverReference = configModel.referenceElement(configModel.data(driverIndex, 32));
112
 				if(driverReference.driver == "nidaqmxbase" || driverReference.driver == "nidaqmx") {
112
 				if(driverReference.driver == "nidaqmxbase" || driverReference.driver == "nidaqmx") {
113
-				if(configModel.hasChildren(driverIndex)) {
113
+					if(configModel.hasChildren(driverIndex)) {
114
 						for(var j = 0; j < configModel.rowCount(driverIndex); j++) {
114
 						for(var j = 0; j < configModel.rowCount(driverIndex); j++) {
115
 							var deviceIndex = configModel.index(j, 0, driverIndex);
115
 							var deviceIndex = configModel.index(j, 0, driverIndex);
116
 							var deviceReference = configModel.referenceElement(configModel.data(deviceIndex, 32));
116
 							var deviceReference = configModel.referenceElement(configModel.data(deviceIndex, 32));
224
 						}
224
 						}
225
 					}
225
 					}
226
 				}
226
 				}
227
-				else if(driverReference.driver == "dataqsdk")
228
-				{
229
-					var device = new DataqSdkDevice(driverReference.autoSelect ? driverReference.deviceNumber : driverReference.port);
227
+				else if(driverReference.driver == "dataqsdk") {
228
+					var device;
229
+					if(driverReference.autoSelect == "true") {
230
+						device = new DataqSdkDevice(driverReference.deviceNumber);
231
+					}
232
+					else {
233
+						device = new DataqSdkDevice(driverReference.port);
234
+					}
230
 					var sampleRate = 6;
235
 					var sampleRate = 6;
231
-					if(configModel.hasChildren(driverIndex)
232
-					{
233
-						for(var j = 0; j < configModel.rowCount(driverIndex); j++)
234
-						{
236
+					if(configModel.hasChildren(driverIndex)) {
237
+						for(var j = 0; j < configModel.rowCount(driverIndex); j++) {
235
 							var channelIndex = configModel.index(j, 0, driverIndex);
238
 							var channelIndex = configModel.index(j, 0, driverIndex);
236
 							var channelReference = configModel.referenceElement(configModel.data(channelIndex, 32));
239
 							var channelReference = configModel.referenceElement(configModel.data(channelIndex, 32));
237
 							var unit;
240
 							var unit;
261
 						}
264
 						}
262
 						sampleRate /= configModel.rowCount(driverIndex);
265
 						sampleRate /= configModel.rowCount(driverIndex);
263
 					}
266
 					}
264
-					device.setSampleRate(sampleRate);
267
+					device.setClockRate(sampleRate);
265
 					device.start();
268
 					device.start();
266
 					dataqsdkdevices.push(device);
269
 					dataqsdkdevices.push(device);
267
 				}
270
 				}

Loading…
Cancel
Save