Browse Source

Fix the build on Microsoft Windows.

Neal Wilson 11 years ago
parent
commit
c553cadecc
1 changed files with 5 additions and 10 deletions
  1. 5
    10
      src/dataqsdk.w

+ 5
- 10
src/dataqsdk.w View File

11
 platforms for which there is a suitable serial driver.
11
 platforms for which there is a suitable serial driver.
12
 
12
 
13
 @<Class declarations@>=
13
 @<Class declarations@>=
14
-#ifdef Q_OS_WIN32
15
 class DataqSdkDeviceImplementation;
14
 class DataqSdkDeviceImplementation;
16
 class DataqSdkDevice : public QObject
15
 class DataqSdkDevice : public QObject
17
 {
16
 {
26
 		Q_INVOKABLE void setClockRate(double Hz);
25
 		Q_INVOKABLE void setClockRate(double Hz);
27
 		Q_INVOKABLE void start();
26
 		Q_INVOKABLE void start();
28
 };
27
 };
29
-#endif
30
 
28
 
31
 @ The |DataqSdkDevice| class has as a private member an instance of a class
29
 @ The |DataqSdkDevice| class has as a private member an instance of a class
32
 called |DataqSdkDeviceImplementation|. The two classes together create and run
30
 called |DataqSdkDeviceImplementation|. The two classes together create and run
41
 not subclass |QThread| now that this is no longer required.
39
 not subclass |QThread| now that this is no longer required.
42
 
40
 
43
 @<Class declarations@>=
41
 @<Class declarations@>=
44
-#ifdef Q_OS_WIN32
45
 class DataqSdkDeviceImplementation : public QThread
42
 class DataqSdkDeviceImplementation : public QThread
46
 {
43
 {
47
 	Q_OBJECT
44
 	Q_OBJECT
56
 	private:
53
 	private:
57
 		qint16 *buffer;
54
 		qint16 *buffer;
58
 };
55
 };
59
-#endif
60
 
56
 
61
 @ While the |DAQ| class for communicating with National Instruments devices
57
 @ While the |DAQ| class for communicating with National Instruments devices
62
 uses a single function pointer type, increased variety of function signatures
58
 uses a single function pointer type, increased variety of function signatures
141
 QVector<Units::Unit> unitMap;
137
 QVector<Units::Unit> unitMap;
142
 int *input_buffer;
138
 int *input_buffer;
143
 QTimer *eventClock;
139
 QTimer *eventClock;
144
-QMultiMap<int, double> > smoother;
140
+QMultiMap<int, double> smoother;
145
 
141
 
146
 @ Most of the interesting work associated with the |DataqSdkDevice| class is
142
 @ Most of the interesting work associated with the |DataqSdkDevice| class is
147
 handled in the |measure()| method of |DataqSdkDeviceImplementation|. This
143
 handled in the |measure()| method of |DataqSdkDeviceImplementation|. This
204
 		QList<double> channelBuffer;
200
 		QList<double> channelBuffer;
205
 		for(unsigned int j = 0; j < 40; j++)
201
 		for(unsigned int j = 0; j < 40; j++)
206
 		{
202
 		{
207
-			channelbuffer << ((double)buffer[i+(channels*j)] * 10.0) / 32768.0;
203
+			channelBuffer << ((double)buffer[i+(channels*j)] * 10.0) / 32768.0;
208
 			if(i == 0)
204
 			if(i == 0)
209
 			{
205
 			{
210
 				countList << buffer[i+(channels*j)];
206
 				countList << buffer[i+(channels*j)];
213
 		double value = 0.0;
209
 		double value = 0.0;
214
 		for(unsigned int j = 0; j < 40; j++)
210
 		for(unsigned int j = 0; j < 40; j++)
215
 		{
211
 		{
216
-			value += channelbuffer[j];
212
+			value += channelBuffer[j];
217
 		}
213
 		}
218
 		value /= 40.0;
214
 		value /= 40.0;
219
 		if(i == 0)
215
 		if(i == 0)
340
 		inlist[i].ave = 1;
336
 		inlist[i].ave = 1;
341
 		inlist[i].counter = (oversample - 1);
337
 		inlist[i].counter = (oversample - 1);
342
 	}
338
 	}
343
-	error = di_list_length(channels, 0)
339
+	error = di_list_length(channels, 0);
344
 	if(error)
340
 	if(error)
345
 	{
341
 	{
346
 		error = 4; // List length error
342
 		error = 4; // List length error
598
 	QScriptValue object;
594
 	QScriptValue object;
599
 	if(self)
595
 	if(self)
600
 	{
596
 	{
601
-		object = engine->newQObject(self->newChannel(argument<int>(0, context),
602
-		                                             argument<int>(1, context)));
597
+		object = engine->newQObject(self->newChannel((Units::Unit)argument<int>(0, context)));
603
 		setChannelProperties(object, engine);
598
 		setChannelProperties(object, engine);
604
 	}
599
 	}
605
 	return object;
600
 	return object;

Loading…
Cancel
Save