|
|
@ -0,0 +1,49 @@ |
|
|
|
package com.my.graphiteDigesterBg; |
|
|
|
import com.my.graphiteDigesterBg.diframe.DiDevice; |
|
|
|
import com.my.graphiteDigesterBg.diframe.DiDeviceActuatorManager; |
|
|
|
import com.my.graphiteDigesterBg.diframe.actuator.DiActMotor; |
|
|
|
import jakarta.annotation.Resource; |
|
|
|
import org.springframework.boot.ApplicationArguments; |
|
|
|
import org.springframework.boot.ApplicationRunner; |
|
|
|
import org.springframework.core.annotation.Order; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
@Order(1) |
|
|
|
@Component |
|
|
|
public class MyApplicationRunner implements ApplicationRunner { |
|
|
|
@Resource |
|
|
|
private DiDevice device; |
|
|
|
|
|
|
|
@Override |
|
|
|
public void run(ApplicationArguments args) throws Exception { |
|
|
|
this.setupActuators(); |
|
|
|
} |
|
|
|
|
|
|
|
// setup actuators |
|
|
|
private void setupActuators() { |
|
|
|
DiDeviceActuatorManager actuators = this.device.getActuators(); |
|
|
|
actuators.register(MyDevice.ACT_HEAT_PLATE_MOTOR, new DiActMotor(){{ |
|
|
|
id = 11; |
|
|
|
}}); |
|
|
|
actuators.register(MyDevice.ACT_HEAT_SLOT_01_COVER_SERVO, new DiActMotor(){{ |
|
|
|
id = 12; |
|
|
|
}}); |
|
|
|
actuators.register(MyDevice.ACT_TRANSFER_UD_MOTOR, new DiActMotor(){{ |
|
|
|
id = 21; |
|
|
|
}}); |
|
|
|
actuators.register(MyDevice.ACT_TRANSFER_CLIP_SERVO, new DiActMotor(){{ |
|
|
|
id = 22; |
|
|
|
}}); |
|
|
|
actuators.register(MyDevice.ACT_TRANSFER_LR_MOTOR, new DiActMotor(){{ |
|
|
|
id = 31; |
|
|
|
}}); |
|
|
|
actuators.register(MyDevice.ACT_LIQUID_MOTOR, new DiActMotor(){{ |
|
|
|
id = 41; |
|
|
|
}}); |
|
|
|
actuators.register(MyDevice.ACT_LIQUID_PLATE_MOTOR, new DiActMotor(){{ |
|
|
|
id = 51; |
|
|
|
}}); |
|
|
|
actuators.register(MyDevice.ACT_LIQUID_PERISTALTIC_PUMP, new DiActMotor(){{ |
|
|
|
id = 61; |
|
|
|
}}); |
|
|
|
} |
|
|
|
} |