@Test public void testHaveNotOnlyIrcCmdAndDelayCmd() { MacrosIrDelayUtil.ensureDelayForIrCommand(haveNotIrCmd); Assert.assertTrue(haveNotIrCmd.size() == 5); }
public static void ensureDelayForIrCommand(List<ExecutableCommand> commands){ List<Integer> irCmdIndex = getIrCommandIndexList(commands); if (irCmdIndex == null) { return; } long minDelaySeconds = ControllerConfiguration.readXML().getMacroIRExecutionDelay(); Map<Integer, DelayCommand> delays = getDelayForIrCommand(commands, irCmdIndex, minDelaySeconds); int addTimes = 0; Set<Integer> insertIndex = delays.keySet(); for (Integer index : insertIndex) { commands.add(index + addTimes, delays.get(index)); addTimes++; logger.info("add " + minDelaySeconds + " seconds before " + index + " ircommand"); } }
MacrosIrDelayUtil { public static void ensureDelayForIrCommand(List<ExecutableCommand> commands){ List<Integer> irCmdIndex = getIrCommandIndexList(commands); if (irCmdIndex == null) { return; } long minDelaySeconds = ControllerConfiguration.readXML().getMacroIRExecutionDelay(); Map<Integer, DelayCommand> delays = getDelayForIrCommand(commands, irCmdIndex, minDelaySeconds); int addTimes = 0; Set<Integer> insertIndex = delays.keySet(); for (Integer index : insertIndex) { commands.add(index + addTimes, delays.get(index)); addTimes++; logger.info("add " + minDelaySeconds + " seconds before " + index + " ircommand"); } } }
MacrosIrDelayUtil { public static void ensureDelayForIrCommand(List<ExecutableCommand> commands){ List<Integer> irCmdIndex = getIrCommandIndexList(commands); if (irCmdIndex == null) { return; } long minDelaySeconds = ControllerConfiguration.readXML().getMacroIRExecutionDelay(); Map<Integer, DelayCommand> delays = getDelayForIrCommand(commands, irCmdIndex, minDelaySeconds); int addTimes = 0; Set<Integer> insertIndex = delays.keySet(); for (Integer index : insertIndex) { commands.add(index + addTimes, delays.get(index)); addTimes++; logger.info("add " + minDelaySeconds + " seconds before " + index + " ircommand"); } }  }
MacrosIrDelayUtil { public static void ensureDelayForIrCommand(List<ExecutableCommand> commands){ List<Integer> irCmdIndex = getIrCommandIndexList(commands); if (irCmdIndex == null) { return; } long minDelaySeconds = ControllerConfiguration.readXML().getMacroIRExecutionDelay(); Map<Integer, DelayCommand> delays = getDelayForIrCommand(commands, irCmdIndex, minDelaySeconds); int addTimes = 0; Set<Integer> insertIndex = delays.keySet(); for (Integer index : insertIndex) { commands.add(index + addTimes, delays.get(index)); addTimes++; logger.info("add " + minDelaySeconds + " seconds before " + index + " ircommand"); } }  static void ensureDelayForIrCommand(List<ExecutableCommand> commands); }
MacrosIrDelayUtil { public static void ensureDelayForIrCommand(List<ExecutableCommand> commands){ List<Integer> irCmdIndex = getIrCommandIndexList(commands); if (irCmdIndex == null) { return; } long minDelaySeconds = ControllerConfiguration.readXML().getMacroIRExecutionDelay(); Map<Integer, DelayCommand> delays = getDelayForIrCommand(commands, irCmdIndex, minDelaySeconds); int addTimes = 0; Set<Integer> insertIndex = delays.keySet(); for (Integer index : insertIndex) { commands.add(index + addTimes, delays.get(index)); addTimes++; logger.info("add " + minDelaySeconds + " seconds before " + index + " ircommand"); } }  static void ensureDelayForIrCommand(List<ExecutableCommand> commands);  }