Browse Source

Configuration now handles freeannotation driver. Fixes #9

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

+ 20
- 3
config/Windows/productionroaster.xml View File

109
 						for(var j = 0; j < configModel.rowCount(driverIndex); j++) {
109
 						for(var j = 0; j < configModel.rowCount(driverIndex); j++) {
110
 							var deviceIndex = configModel.index(j, 0, driverIndex);
110
 							var deviceIndex = configModel.index(j, 0, driverIndex);
111
 							var deviceReference = configModel.referenceElement(configModel.data(deviceIndex, 32));
111
 							var deviceReference = configModel.referenceElement(configModel.data(deviceIndex, 32));
112
-							if(deviceReference.driver == "nidaqmxbase9211series" || deviceReference.driver == "nidaqmx9211series") {								
112
+							if(deviceReference.driver == "nidaqmxbase9211series" || deviceReference.driver == "nidaqmx9211series") {
113
 								var device = new DAQ(deviceReference.deviceID, driverReference.driver);
113
 								var device = new DAQ(deviceReference.deviceID, driverReference.driver);
114
 								nidevices.push(device);
114
 								nidevices.push(device);
115
 								var DAQChannels = 0;
115
 								var DAQChannels = 0;
117
 									for(var k = 0; k < configModel.rowCount(deviceIndex); k++) {
117
 									for(var k = 0; k < configModel.rowCount(deviceIndex); k++) {
118
 										var channelIndex = configModel.index(k, 0, deviceIndex);
118
 										var channelIndex = configModel.index(k, 0, deviceIndex);
119
 										var channelReference = configModel.referenceElement(configModel.data(channelIndex, 32));
119
 										var channelReference = configModel.referenceElement(configModel.data(channelIndex, 32));
120
-										if(channelReference.driver == "ni9211seriestc")	{											
120
+										if(channelReference.driver == "ni9211seriestc")	{
121
 											var channel;
121
 											var channel;
122
 											if(channelReference.type == "J") {
122
 											if(channelReference.type == "J") {
123
 												channel = device.newChannel(DAQ.Fahrenheit, DAQ.TypeJ);
123
 												channel = device.newChannel(DAQ.Fahrenheit, DAQ.TypeJ);
171
 								}
171
 								}
172
 							}
172
 							}
173
 							else if(deviceReference.driver == "nidaqmxtc01")
173
 							else if(deviceReference.driver == "nidaqmxtc01")
174
-							{						
174
+							{
175
 								var device = new DAQ(deviceReference.deviceID, "nidaqmx");
175
 								var device = new DAQ(deviceReference.deviceID, "nidaqmx");
176
 								var channel;
176
 								var channel;
177
 								if(deviceReference.type == "J")
177
 								if(deviceReference.type == "J")
306
 					annotationButtons.push(spinbox);
306
 					annotationButtons.push(spinbox);
307
 					tabControls.push(spinbox);
307
 					tabControls.push(spinbox);
308
 				}
308
 				}
309
+				else if(driverReference.driver == "freeannotation")
310
+				{
311
+					var layout = new QBoxLayout;
312
+					var label = new QLabel(driverReference.labeltext);
313
+					var control = new QLineEdit;
314
+					layout.addWidget(label, 0, 2);
315
+					layout.addWidget(control, 0, 1);
316
+					annotationPanel.addLayout(layout);
317
+					tabControls.push(control);
318
+					control.returnPressed.connect(function() {
319
+						for(var i = window.firstTempColumn; i < window.annotationColumn; i++) {
320
+							log.newAnnotation(control.text, i, window.annotationColumn);
321
+						}
322
+					});
323
+				}
309
 				else if(driverReference.driver == "linearspline")
324
 				else if(driverReference.driver == "linearspline")
310
 				{
325
 				{
311
 					var colname = driverReference.source;
326
 					var colname = driverReference.source;
660
 			for(var i = 0; i < channels.length; i++) {
675
 			for(var i = 0; i < channels.length; i++) {
661
 				log.addToCurrentColumnSet(c + i + 1);
676
 				log.addToCurrentColumnSet(c + i + 1);
662
 			}
677
 			}
678
+			window.firstTempColumn = c + 1;
679
+			window.annotationColumn = c + columnNames.length + 1;
663
 		};
680
 		};
664
 		var saveMenu = findChildObject(this, 'save');
681
 		var saveMenu = findChildObject(this, 'save');
665
         saveMenu.triggered.connect(function() {
682
         saveMenu.triggered.connect(function() {

Loading…
Cancel
Save