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,7 +109,7 @@
109 109
 						for(var j = 0; j < configModel.rowCount(driverIndex); j++) {
110 110
 							var deviceIndex = configModel.index(j, 0, driverIndex);
111 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 113
 								var device = new DAQ(deviceReference.deviceID, driverReference.driver);
114 114
 								nidevices.push(device);
115 115
 								var DAQChannels = 0;
@@ -117,7 +117,7 @@
117 117
 									for(var k = 0; k < configModel.rowCount(deviceIndex); k++) {
118 118
 										var channelIndex = configModel.index(k, 0, deviceIndex);
119 119
 										var channelReference = configModel.referenceElement(configModel.data(channelIndex, 32));
120
-										if(channelReference.driver == "ni9211seriestc")	{											
120
+										if(channelReference.driver == "ni9211seriestc")	{
121 121
 											var channel;
122 122
 											if(channelReference.type == "J") {
123 123
 												channel = device.newChannel(DAQ.Fahrenheit, DAQ.TypeJ);
@@ -171,7 +171,7 @@
171 171
 								}
172 172
 							}
173 173
 							else if(deviceReference.driver == "nidaqmxtc01")
174
-							{						
174
+							{
175 175
 								var device = new DAQ(deviceReference.deviceID, "nidaqmx");
176 176
 								var channel;
177 177
 								if(deviceReference.type == "J")
@@ -306,6 +306,21 @@
306 306
 					annotationButtons.push(spinbox);
307 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 324
 				else if(driverReference.driver == "linearspline")
310 325
 				{
311 326
 					var colname = driverReference.source;
@@ -660,6 +675,8 @@
660 675
 			for(var i = 0; i < channels.length; i++) {
661 676
 				log.addToCurrentColumnSet(c + i + 1);
662 677
 			}
678
+			window.firstTempColumn = c + 1;
679
+			window.annotationColumn = c + columnNames.length + 1;
663 680
 		};
664 681
 		var saveMenu = findChildObject(this, 'save');
665 682
         saveMenu.triggered.connect(function() {

Loading…
Cancel
Save