|
@ -1,6 +1,8 @@ |
|
|
package com.my.graphiteDigesterBg; |
|
|
package com.my.graphiteDigesterBg; |
|
|
import com.my.graphiteDigesterBg.diframe.DiDevice; |
|
|
import com.my.graphiteDigesterBg.diframe.DiDevice; |
|
|
import com.my.graphiteDigesterBg.diframe.DiDeviceActuatorManager; |
|
|
import com.my.graphiteDigesterBg.diframe.DiDeviceActuatorManager; |
|
|
|
|
|
import com.my.graphiteDigesterBg.diframe.DiDeviceIO; |
|
|
|
|
|
import com.my.graphiteDigesterBg.diframe.DiDeviceIOManager; |
|
|
import com.my.graphiteDigesterBg.diframe.actuator.DiActMotor; |
|
|
import com.my.graphiteDigesterBg.diframe.actuator.DiActMotor; |
|
|
import jakarta.annotation.Resource; |
|
|
import jakarta.annotation.Resource; |
|
|
import org.springframework.boot.ApplicationArguments; |
|
|
import org.springframework.boot.ApplicationArguments; |
|
@ -15,35 +17,61 @@ public class MyApplicationRunner implements ApplicationRunner { |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public void run(ApplicationArguments args) throws Exception { |
|
|
public void run(ApplicationArguments args) throws Exception { |
|
|
|
|
|
this.setupIO(); |
|
|
this.setupActuators(); |
|
|
this.setupActuators(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// setup IO |
|
|
|
|
|
private void setupIO() { |
|
|
|
|
|
DiDeviceIOManager io = this.device.getIO(); |
|
|
|
|
|
io.register(MyDevice.IO_HEAT_SLOT_01_HEATER_01, new DiDeviceIO(){{ |
|
|
|
|
|
mid = 70; |
|
|
|
|
|
index = 0; |
|
|
|
|
|
}}); |
|
|
|
|
|
io.register(MyDevice.IO_HEAT_SLOT_01_HEATER_02, new DiDeviceIO(){{ |
|
|
|
|
|
mid = 70; |
|
|
|
|
|
index = 1; |
|
|
|
|
|
}}); |
|
|
|
|
|
io.register(MyDevice.IO_HEAT_SLOT_01_HEATER_03, new DiDeviceIO(){{ |
|
|
|
|
|
mid = 70; |
|
|
|
|
|
index = 5; |
|
|
|
|
|
}}); |
|
|
|
|
|
io.register(MyDevice.IO_HEAT_SLOT_01_HEATER_04, new DiDeviceIO(){{ |
|
|
|
|
|
mid = 70; |
|
|
|
|
|
index = 6; |
|
|
|
|
|
}}); |
|
|
|
|
|
io.register(MyDevice.IO_AIR_COMPRESSOR, new DiDeviceIO(){{ |
|
|
|
|
|
mid = 70; |
|
|
|
|
|
index = 4; |
|
|
|
|
|
}}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// setup actuators |
|
|
// setup actuators |
|
|
private void setupActuators() { |
|
|
private void setupActuators() { |
|
|
DiDeviceActuatorManager actuators = this.device.getActuators(); |
|
|
DiDeviceActuatorManager actuators = this.device.getActuators(); |
|
|
actuators.register(MyDevice.ACT_HEAT_PLATE_MOTOR, new DiActMotor(){{ |
|
|
actuators.register(MyDevice.ACT_HEAT_PLATE_MOTOR, new DiActMotor(){{ |
|
|
id = 11; |
|
|
|
|
|
|
|
|
mid = 11; |
|
|
}}); |
|
|
}}); |
|
|
actuators.register(MyDevice.ACT_HEAT_SLOT_01_COVER_SERVO, new DiActMotor(){{ |
|
|
actuators.register(MyDevice.ACT_HEAT_SLOT_01_COVER_SERVO, new DiActMotor(){{ |
|
|
id = 12; |
|
|
|
|
|
|
|
|
mid = 12; |
|
|
}}); |
|
|
}}); |
|
|
actuators.register(MyDevice.ACT_TRANSFER_UD_MOTOR, new DiActMotor(){{ |
|
|
actuators.register(MyDevice.ACT_TRANSFER_UD_MOTOR, new DiActMotor(){{ |
|
|
id = 21; |
|
|
|
|
|
|
|
|
mid = 21; |
|
|
}}); |
|
|
}}); |
|
|
actuators.register(MyDevice.ACT_TRANSFER_CLIP_SERVO, new DiActMotor(){{ |
|
|
actuators.register(MyDevice.ACT_TRANSFER_CLIP_SERVO, new DiActMotor(){{ |
|
|
id = 22; |
|
|
|
|
|
|
|
|
mid = 22; |
|
|
}}); |
|
|
}}); |
|
|
actuators.register(MyDevice.ACT_TRANSFER_LR_MOTOR, new DiActMotor(){{ |
|
|
actuators.register(MyDevice.ACT_TRANSFER_LR_MOTOR, new DiActMotor(){{ |
|
|
id = 31; |
|
|
|
|
|
|
|
|
mid = 31; |
|
|
}}); |
|
|
}}); |
|
|
actuators.register(MyDevice.ACT_LIQUID_MOTOR, new DiActMotor(){{ |
|
|
actuators.register(MyDevice.ACT_LIQUID_MOTOR, new DiActMotor(){{ |
|
|
id = 41; |
|
|
|
|
|
|
|
|
mid = 41; |
|
|
}}); |
|
|
}}); |
|
|
actuators.register(MyDevice.ACT_LIQUID_PLATE_MOTOR, new DiActMotor(){{ |
|
|
actuators.register(MyDevice.ACT_LIQUID_PLATE_MOTOR, new DiActMotor(){{ |
|
|
id = 51; |
|
|
|
|
|
|
|
|
mid = 51; |
|
|
}}); |
|
|
}}); |
|
|
actuators.register(MyDevice.ACT_LIQUID_PERISTALTIC_PUMP, new DiActMotor(){{ |
|
|
actuators.register(MyDevice.ACT_LIQUID_PERISTALTIC_PUMP, new DiActMotor(){{ |
|
|
id = 61; |
|
|
|
|
|
|
|
|
mid = 61; |
|
|
}}); |
|
|
}}); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |