- Timestamp:
- 03/20/12 14:37:05 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/FSCctrl/FSCctrl.cc
r10956 r13157 5 5 #include <sys/socket.h> 6 6 #include <netdb.h> 7 #include <math.h> 7 8 8 9 #include "Evidence.h" … … 23 24 24 25 const unsigned int MAX_VAL = TEMP_OFF + TEMP_NUM +100; 26 27 // Parameters for PT1000 28 const float R0 = 1000, A = 3.9083e-3, B = -5.775e-7; 25 29 26 30 using namespace std; … … 76 80 77 81 // Send start command to FSC board 78 snprintf(Buffer, sizeof(Buffer), "m ");82 snprintf(Buffer, sizeof(Buffer), "m\n"); 79 83 Result = write(Socket, Buffer, 1); 80 84 if (Result != 1) S.Message(S.ERROR, "Could not write to socket (%s)", strerror(errno)); … … 120 124 } 121 125 126 // Translate resistance to temperatures 127 for (unsigned int i=0; i<TEMP_NUM; i++) { 128 Val[i+TEMP_OFF] = -A/(2*B)-sqrt(pow(A/(2*B),2)-(R0-Val[i+TEMP_OFF])/(B*R0)); 129 } 130 122 131 // Update DIM service 123 132 Temperature.updateService();
Note:
See TracChangeset
for help on using the changeset viewer.