Search in sources :

Example 1 with RoverModbusRequester

use of me.retrodaredevil.solarthing.config.request.modbus.RoverModbusRequester in project solarthing by wildmountainfarms.

the class RoverMain method doRover.

private static int doRover(RoverProgramOptions options, AnalyticsManager analyticsManager, List<DataRequester> dataRequesterList) throws Exception {
    RoverModbusRequester roverModbusRequester = new RoverModbusRequester(options.isSendErrorPackets(), options.isBulkRequest(), // attach the given rover modbus environment to all commands
    options.getCommandInfoList().stream().map(CommandInfo::getName).collect(Collectors.toList()), null, null);
    Map<Integer, ModbusRequester> deviceMap = new HashMap<>();
    deviceMap.put(options.getModbusAddress(), roverModbusRequester);
    ModbusDataRequester dataRequester = new ModbusDataRequester(options.getIOBundleFile(), deviceMap, null, null);
    List<DataRequester> list = new ArrayList<>(dataRequesterList);
    list.add(dataRequester);
    return RequestMain.startRequestProgram(options, analyticsManager, list, options.getPeriod(), options.getMinimumWait());
}
Also used : RoverModbusRequester(me.retrodaredevil.solarthing.config.request.modbus.RoverModbusRequester) CommandInfo(me.retrodaredevil.solarthing.commands.CommandInfo) ModbusDataRequester(me.retrodaredevil.solarthing.config.request.modbus.ModbusDataRequester) DataRequester(me.retrodaredevil.solarthing.config.request.DataRequester) RoverModbusRequester(me.retrodaredevil.solarthing.config.request.modbus.RoverModbusRequester) ModbusRequester(me.retrodaredevil.solarthing.config.request.modbus.ModbusRequester) HashMap(java.util.HashMap) ModbusDataRequester(me.retrodaredevil.solarthing.config.request.modbus.ModbusDataRequester) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 CommandInfo (me.retrodaredevil.solarthing.commands.CommandInfo)1 DataRequester (me.retrodaredevil.solarthing.config.request.DataRequester)1 ModbusDataRequester (me.retrodaredevil.solarthing.config.request.modbus.ModbusDataRequester)1 ModbusRequester (me.retrodaredevil.solarthing.config.request.modbus.ModbusRequester)1 RoverModbusRequester (me.retrodaredevil.solarthing.config.request.modbus.RoverModbusRequester)1