|
|
@ -13,6 +13,9 @@ using namespace std; |
|
|
|
-通断电磁阀 3 PC7 5 |
|
|
|
#endif
|
|
|
|
|
|
|
|
#define GPM_TO_SPEED(gpm) (gpm * 3.07)
|
|
|
|
#define SPEED_TO_GPM(speed) (speed / 3.07)
|
|
|
|
|
|
|
|
DeviceIoControlService::DeviceIoControlService() {} |
|
|
|
void DeviceIoControlService::initialize() { GET_TO_SERVICE(m_zcanHost); } |
|
|
|
|
|
|
@ -173,7 +176,7 @@ void DeviceIoControlService::replenishingFluidsPump_close() { |
|
|
|
|
|
|
|
void DeviceIoControlService::replenishingFluidsPump_open_for_test(int gpm) { |
|
|
|
logger->info("replenishingFluidsPump_open_for_test {}", gpm); |
|
|
|
int speed = gpm * 7.5; |
|
|
|
int speed = GPM_TO_SPEED(gpm); |
|
|
|
if (speed > 300) { |
|
|
|
speed = 300; |
|
|
|
} else if (speed < -300) { |
|
|
@ -190,7 +193,7 @@ void DeviceIoControlService::replenishingFluidsPump_close_for_test() { |
|
|
|
*******************************************************************************/ |
|
|
|
void DeviceIoControlService::sprayLiquidPump_open(int gpm) { |
|
|
|
logger->info("sprayLiquidPump_open"); |
|
|
|
int speed = gpm * 7.5; |
|
|
|
int speed = GPM_TO_SPEED(gpm); |
|
|
|
if (speed > 300) { |
|
|
|
speed = 300; |
|
|
|
} else if (speed < 0) { |
|
|
@ -205,7 +208,7 @@ void DeviceIoControlService::sprayLiquidPump_close() { |
|
|
|
|
|
|
|
void DeviceIoControlService::sprayLiquidPump_open_for_test(int gpm) { |
|
|
|
logger->info("sprayLiquidPump_open"); |
|
|
|
int speed = gpm * 7.5; |
|
|
|
int speed = GPM_TO_SPEED(gpm); |
|
|
|
if (speed > 300) { |
|
|
|
speed = 300; |
|
|
|
} else if (speed < -300) { |
|
|
@ -219,7 +222,7 @@ void DeviceIoControlService::sprayLiquidPump_close_for_test() { |
|
|
|
} |
|
|
|
|
|
|
|
int DeviceIoControlService::sprayLiquidPump_getRPM() { return m_zcanHost->pumpctrl_c1004_get_speed_cache(2); } |
|
|
|
int DeviceIoControlService::sprayLiquidPump_getGPM() { return sprayLiquidPump_getRPM() / 7.5; } |
|
|
|
int DeviceIoControlService::sprayLiquidPump_getGPM() { return SPEED_TO_GPM(sprayLiquidPump_getRPM()); } |
|
|
|
|
|
|
|
int DeviceIoControlService::sprayLiquidPump_getState() { //
|
|
|
|
lock_guard<recursive_mutex> lock(lock_); |
|
|
|