205 } |
208 } |
206 } |
209 } |
207 |
210 |
208 #ifdef USE_SIMULATOR |
211 #ifdef USE_SIMULATOR |
209 if ((device->type == DEVTYPE_SIM) && (device->direction == DEVDIR_OUT_BIN) && (device->present == DEVPRESENT_YES)) { |
212 if ((device->type == DEVTYPE_SIM) && (device->direction == DEVDIR_OUT_BIN) && (device->present == DEVPRESENT_YES)) { |
210 if ((strcmp((char *)"SimHLTheater", device->address) == 0) || (strcmp((char *)"SimMLTheater", device->address) == 0)) { |
213 if ((strcmp((char *)"SimHLTheater", device->address) == 0) || |
|
214 (strcmp((char *)"SimMLTheater", device->address) == 0) || |
|
215 (strcmp((char *)"SimMLTpump", device->address) == 0)) { |
211 if (value != device->value) { |
216 if (value != device->value) { |
212 syslog(LOG_NOTICE, "SIM %s value=%d", device->address, value); |
217 syslog(LOG_NOTICE, "SIM %s value=%d", device->address, value); |
213 if (debug) |
218 if (debug) |
214 fprintf(stdout, "SIM %s value=%d\n", device->address, value); |
219 fprintf(stdout, "SIM %s value=%d\n", device->address, value); |
215 } |
220 } |
216 device->value = value; |
221 device->value = value; |
217 if (strcmp((char *)"SimHLTheater", device->address) == 0) |
222 if (strcmp((char *)"SimHLTheater", device->address) == 0) { |
218 SIM_hlt_value = value; |
223 SIM_hlt_value = value; |
219 if (strcmp((char *)"SimMLTheater", device->address) == 0) |
224 if (value) |
|
225 leds |= SLED_HLTH; |
|
226 else |
|
227 leds &= ~SLED_HLTH; |
|
228 slcdLEDs(slcdHandle); |
|
229 } |
|
230 if (strcmp((char *)"SimMLTheater", device->address) == 0) { |
220 SIM_mlt_value = value; |
231 SIM_mlt_value = value; |
|
232 if (value) |
|
233 leds |= SLED_MLTH; |
|
234 else |
|
235 leds &= ~SLED_MLTH; |
|
236 slcdLEDs(slcdHandle); |
|
237 } |
|
238 if (strcmp((char *)"SimMLTpump", device->address) == 0) { |
|
239 if (value) |
|
240 leds |= SLED_MLTP; |
|
241 else |
|
242 leds &= ~SLED_MLTP; |
|
243 slcdLEDs(slcdHandle); |
|
244 } |
221 } |
245 } |
222 } |
246 } |
223 #endif |
247 #endif |
224 } else { |
248 } else { |
225 #ifdef HAVE_WIRINGPI_H |
249 #ifdef HAVE_WIRINGPI_H |
522 break; |
546 break; |
523 case 2: ndev->direction = DEVDIR_IN_ANALOG; |
547 case 2: ndev->direction = DEVDIR_IN_ANALOG; |
524 ndev->address = xstrcpy((char *)"SimMLTtemp"); |
548 ndev->address = xstrcpy((char *)"SimMLTtemp"); |
525 ndev->description = xstrcpy((char *)"Simulated MLT temperature"); |
549 ndev->description = xstrcpy((char *)"Simulated MLT temperature"); |
526 break; |
550 break; |
527 case 3: ndev->direction = DEVDIR_OUT_ANALOG; |
551 case 3: ndev->direction = DEVDIR_OUT_BIN; |
528 ndev->address = xstrcpy((char *)"SimHLTheater"); |
552 ndev->address = xstrcpy((char *)"SimHLTheater"); |
529 ndev->description = xstrcpy((char *)"Simulated HLT heater"); |
553 ndev->description = xstrcpy((char *)"Simulated HLT heater"); |
530 break; |
554 break; |
531 case 4: ndev->direction = DEVDIR_OUT_ANALOG; |
555 case 4: ndev->direction = DEVDIR_OUT_BIN; |
532 ndev->address = xstrcpy((char *)"SimMLTheater"); |
556 ndev->address = xstrcpy((char *)"SimMLTheater"); |
533 ndev->description = xstrcpy((char *)"Simulated MLT heater"); |
557 ndev->description = xstrcpy((char *)"Simulated MLT heater"); |
534 break; |
558 break; |
535 case 5: ndev->direction = DEVDIR_OUT_ANALOG; |
559 case 5: ndev->direction = DEVDIR_OUT_BIN; |
536 ndev->address = xstrcpy((char *)"SimMLTpump"); |
560 ndev->address = xstrcpy((char *)"SimMLTpump"); |
537 ndev->description = xstrcpy((char *)"Simulated MLT pump"); |
561 ndev->description = xstrcpy((char *)"Simulated MLT pump"); |
538 break; |
562 break; |
539 } |
563 } |
540 |
564 |