Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import com.leiyuntop.machine.StatusCapture;
- public class Test {
- static boolean m_pick = false;
- private StatusCapture sc;
- Test(StatusCapture sc) {
- this.sc = sc;
- }
- void connect(String portName) {
- this.sc.Start(portName, 10);
- }
- void disconnect() {
- this.sc.Close();
- }
- void getMachineStatus() {
- this.sc.VMC_Status();
- }
- void irTest() {
- if (m_pick) {
- this.sc.VMC_ExitTest();
- } else {
- this.sc.VMC_Test("红外", "");
- }
- m_pick = !m_pick;
- }
- void lift(String value) {
- this.sc.VMC_Test("升降", value); // can be A, B, C, D, E, F
- }
- void location() {
- this.sc.Elevator_Location();
- }
- void testSlot(String testSlotValue) {
- this.sc.VMC_Test("单道", testSlotValue);
- }
- void allSlots() {
- this.sc.VMC_Test("全道", "");
- }
- void slotItemSale(String key) {
- this.sc.VMC_Sale(key);
- }
- public static void main (String args[]) {
- StatusCapture sc = new StatusCapture();
- Test obj = new Test(sc);
- obj.connect("COM1");
- obj.getMachineStatus();
- obj.irTest();
- obj.lift("A");
- obj.location();
- obj.testSlot("A1");
- obj.allSlots();
- obj.slotItemSale("A1");
- obj.disconnect();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement