public void ProcedureDoor(DOORID id, PROCEDURETRACKING_MEZZAMINE state) { switch (state) { case PROCEDURETRACKING_MEZZAMINE.CHECK_SWITCH_CLOSE: break; case PROCEDURETRACKING_MEZZAMINE.CHECK_SWITCH_CLOSE_THEN_OPEN: // kiem tra Switch close nếu đúng open cửa // hoàn thành mở cửa gọi ProcedureDoor(DOORID id,PROCEDURETRACKING_MEZZAMINE.CLOSE_TO_OPEN_FINISH) break; case PROCEDURETRACKING_MEZZAMINE.CLOSE_TO_OPEN_FINISH: // trả trạng thái toàn quy trình break; case PROCEDURETRACKING_MEZZAMINE.CHECK_SWITCH_OPEN: break; case PROCEDURETRACKING_MEZZAMINE.CHECK_SWITCH_OPEN_THEN_CLOSE: // kiem tra Switch Open nếu đúng open cửa // hoàn thành đóng cửa gọi ProcedureDoor(DOORID id,PROCEDURETRACKING_MEZZAMINE.OPEN_TO_CLOSE_FINISH) break; case PROCEDURETRACKING_MEZZAMINE.OPEN_TO_CLOSE_FINISH: break; case PROCEDURETRACKING_MEZZAMINE.DOOR_ERROR_APPEAR: break; } }
public void TransmittedDataPackage(DOORID id, byte cmd) { byte[] package = new byte[4]; // 2 bytes header and tail, 1 byte id , 1 byte cmd 5 byte data package[0] = 0xFF; package[1] = (byte)id; // Buffer.BlockCopy(cmd,0,package,2,cmd.Length); package[2] = cmd; package[3] = 0x0F; // new line SendCMD(package); }
public virtual void CloseMezzamineDoor(DOORID id) { TransmittedDataPackage(id, SERVER_CMD_CLOSEDOOR); }
public virtual void OpenMezzamineDoor(DOORID id) { TransmittedDataPackage(id, SERVER_CMD_OPENDOOR); }