Пример #1
0
 private void addSolenoidPackets(BlackBoxPacket packet) {
   for (int i = 0; ; i++) {
     if (!ModulePresence.getModulePresence(ModuleType.kSolenoid, i + 1)) break;
     BlackBoxSubPacketType packetType = new BlackBoxSubPacketType(0);
     packetType.addType(BlackBoxSubPacketType.DATA_UPDATE);
     packetType.addType(BlackBoxSubPacketType.MODULE_SOLENOID);
     packet.addPacket(BlackBoxSubPacket.getInstance(packetType.getType(), i + 1));
   }
 }
Пример #2
0
 private void addAnalogPackets(BlackBoxPacket packet) {
   for (int i = 0; i < 4; i++) {
     if (!hasAnalogModule(i)) continue;
     BlackBoxSubPacketType packetType = new BlackBoxSubPacketType(0);
     packetType.addType(BlackBoxSubPacketType.DATA_UPDATE);
     packetType.addType(BlackBoxSubPacketType.MODULE_ANALOG);
     packet.addPacket(BlackBoxSubPacket.getInstance(packetType.getType(), i + 1));
   }
 }
Пример #3
0
 private void addDigitalPackets(BlackBoxPacket packet) {
   for (int i = 0; i < 4; i++) {
     if (!hasDigitalModule(i)) {
       continue;
     }
     BlackBoxSubPacketType packetType = new BlackBoxSubPacketType(0);
     packetType.addType(BlackBoxSubPacketType.DATA_UPDATE);
     packetType.addType(BlackBoxSubPacketType.MODULE_DIGITAL);
     packet.addPacket(BlackBoxSubPacket.getInstance(packetType.getType(), i));
     createPWMPacket(i, packet);
     createRelayPacket(i, packet);
   }
 }
Пример #4
0
 private void createRelayPacket(int module, BlackBoxPacket packet) {
   BlackBoxSubPacketType packetType = new BlackBoxSubPacketType(0);
   packetType.addType(BlackBoxSubPacketType.DATA_UPDATE);
   packetType.addType(BlackBoxSubPacketType.MODULE_RELAY);
   packet.addPacket(BlackBoxSubPacket.getInstance(packetType.getType(), module));
 }
Пример #5
0
 private void addGamePacket(BlackBoxPacket packet) {
   BlackBoxSubPacketType packetType = new BlackBoxSubPacketType(0);
   packetType.addType(BlackBoxSubPacketType.GAME_UPDATE);
   packet.addPacket(BlackBoxSubPacket.getInstance(packetType.getType()));
 }