Commit db4bc59b authored by Charles Godwin's avatar Charles Godwin

Revise rs485 reader

parent e0b4a8ff
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry excluding="TestServer.java|ca/godwin/magnum/DataClient.java|ca/godwin/magnum/ClientProperties.java|WeatherReader.java" kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry exported="true" kind="lib" path="lib/gson-2.8.5.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jSerialComm-2.2.2.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="lib/gson-2.8.5.jar"/>
<classpathentry kind="lib" path="lib/jSerialComm-2.5.1.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Release 2.1.1 Pending
o Fixed bug in log rotate files concerning defined user / group authorities
o Fixed problem with some HAT type RS485 Serial devices producing only unknown packets
o Revised Magnum reader to accumulate data over time as several packets are intermittent,
especially for the PT-100
o Updated to jSerialComm 2.5.1 runtime library
o Fixed bug in CSV data logging that prevented any data being written.
o Fixed several data retrieval bugs in the AGS module
o Fixed data bugs in java example for Morningstar controller
o Fixed bug in event interval label for logged events "Min" changed to "Sec"
Release 2.1.0 2019/04/26
o Added support for inline comments in filter files and some conf files
o Added data type comment to generated filters
......
......@@ -52,6 +52,7 @@ When running the command line version of the programs, you can also override all
| jsonreader_filename | | filename of JSON file if JSONReader included as a reader. |
| packetfilereader_filename | | filename of packet record file if PacketFileReader is included as a reader. This file is the output from testrs485. |
# What the Programs Do
These are the scripts provide to start various server side programs
......
......@@ -153,8 +153,3 @@ files are started fresh every day and their filename includes the date. You can
That's it.
If you want to setup the system so the server and or logger run as integrated system services, please refer to the `RUNNING_AS_SERVICE.md` file.
......@@ -4,8 +4,8 @@ Check [here](https://gitlab.com/Magnum_Energy/distribution/releases) for the lat
### There are two components to this software:
- A REST API (http) server that returns a JSON record of name/value pairs for all devices(s) data points. For Magnum Energy networked devices this reads the packets of information from the Magnum Network. There is support for adding other devices to this server. Refer to the **DATASERVER.md** document.
- A data logger that queries the server periodically, the default is 60 seconds, and generates various log records (CSV, JSON or MySQL) and/or can directly update a MySQL database. The types of output as well as the contents of individual log type can be configured.
- A REST API (http) server that returns a JSON object string of name/value pairs for all device(s) data points. For Magnum Energy networked devices this reads the packets of information from the Magnum Network. There is support for adding other devices to this server. Refer to the **DATASERVER.md** document.
- A data logger that queries the server periodically, the default is 60 seconds, and generates various log records (CSV, JSON or MySQL) and/or can directly update a MySQL database. The types of output as well as the contents for each individual log type can be configured.
A script to install runtime code is provided so no technical expertise is required to install or use it.
......@@ -16,13 +16,14 @@ I used a Magnum Energy (**ME**) authored document to understand the messages (pa
- The reader is implemented as a REST API web server. No special programming skill is needed to access data.
- Platform agnostic -- the serial reader software\[1\] supports several platforms including Raspberry Pi, Intel Linux and Windows. This project is Raspberry Pi centered but that is not a limitation.
- Output is a consolidate JSON record of all data generated by each attached device.
- The server is implemented in Java and uses some third party proprietary run time code.
- The server is implemented in Java and uses some third party run time code.
- The server is designed to be a long-running program. It can be started as a regular program in user space but can also run as a service using systemd.
- Test programs are included to ensure the server is operating correctly.
- The server is extensible using plug-ins or just command line scripts so users can add functionality for extra data generation such as third party charge controllers or weather data.
- Tools and documentation are provided to allow programmers to develop these plugins and scripts.
- The serial software used is jSerialComm at <https://github.com/Fazecast/jSerialComm/>
- Server JSON support is provided by https://github.com/google/gson
- __PT-100 charge controller__ There are data collection issues with the PT-100. Please contact the author if you are uing a PT-100 so we can work together to improve the reader.
#### The data logger has these features:
......@@ -30,7 +31,7 @@ I used a Magnum Energy (**ME**) authored document to understand the messages (pa
- Can post directly to a MySQL database and/or log SQL INSERT statements.
- Will, if necessary, automatically create any required MySQL tables or you can generate the CREATE TABLE statements.
- Can filter out data fields as there are a lot of useless ones that can be ignored. The user defined filters can also specify the order of the fields (useful for meaningful spreadsheets or defining a database table).
- The data logger can , optionally, generate events records, such as generator start and stop times or sunrise and sunset.
- The data logger can, optionally, generate events records, such as generator start and stop times or sunrise and sunset.
- Event records can be generated as CSV, JSON, MySQL insert or posted directly to a MySQL database
- A utility program can generate draft filter files to allow customizing of the logged output.
- The logging program and utilities are written in PHP so non-technical users can use, extend or modify the supplied code with a short learning curve.
......
......@@ -17,8 +17,6 @@
<isset property="eclipse.running" />
</condition>
<property name="builtby" value="${user.name}" />
<property name="javac.excludes" value="WeatherReader.java" />
<available file="build.properties" property="properties.present" />
<tstamp />
......@@ -139,7 +137,7 @@
<target name="available">
<available file="lib/commons-csv-1.5.jar" property="csv.present" />
<available file="lib/gson-2.8.5.jar" property="gson.present" />
<available file="lib/jSerialComm-2.2.2.jar" property="serial.present" />
<available file="lib/jSerialComm-2.5.1.jar" property="serial.present" />
<available file="php.ini" property="php.ini.present" />
</target>
<target name="build.directories">
......@@ -188,7 +186,7 @@
</target>
<target name="build.serial" unless="serial.present">
<get src="https://github.com/Fazecast/jSerialComm/releases/download/v2.2.2/jSerialComm-2.2.2.jar" dest="lib" />
<get src="https://github.com/Fazecast/jSerialComm/releases/download/v2.5.1/jSerialComm-2.5.1.jar" dest="lib" />
</target>
<target name="build.gson" unless="gson.present">
......
......@@ -96,6 +96,7 @@ public class MS_Reader implements DataReader {
protected int MS_charge_state;
protected String MS_charge_state_text;
protected float MS_vb_ref;
protected int MS_out_power;
protected int MS_in_power;
protected int MS_sweep_pin_max;
protected float MS_vb_max_daily;
......@@ -151,9 +152,11 @@ public class MS_Reader implements DataReader {
} catch (Exception e) {
if (failed == false) {
failed = true;
TraceLogger.logit("Error detected reading MS Data:" , e);
TraceLogger.logit("Error detected reading MS Data:", e);
// let one failure through. After that send empty map
} else {
return map;
}
return map;
}
map.put("MS_revision", MS_revision);
map.put("MS_adc_ib_f_1m", MS_adc_ib_f_1m);
......@@ -168,7 +171,7 @@ public class MS_Reader implements DataReader {
map.put("MS_fault_daily", MS_fault_daily);
map.put("MS_flags_daily", MS_flags_daily);
map.put("MS_in_power", MS_in_power);
map.put("MS_in_power", MS_in_power);
map.put("MS_out_power", MS_out_power);
map.put("MS_pout_max_daily", MS_pout_max_daily);
map.put("MS_sweep_pin_max", MS_sweep_pin_max);
map.put("MS_tb_max_daily", MS_tb_max_daily);
......@@ -234,7 +237,7 @@ public class MS_Reader implements DataReader {
MS_t_batt = res.getRegisterValue(2);
MS_adc_vb_f_1m = getVolt(res.getRegisterValue(3));
MS_adc_ib_f_1m = getAmp(res.getRegisterValue(4));
if (MS_adc_ib_f_1m < 0.0F) {
if (MS_adc_ib_f_1m < 0.0F || MS_adc_ib_f_1m > 100.0F) {
MS_adc_ib_f_1m = 0;
}
req.setReference(0x2c);
......@@ -254,7 +257,7 @@ public class MS_Reader implements DataReader {
req.setWordCount(3);
trans.execute();
res = (ReadInputRegistersResponse) trans.getResponse();
MS_in_power = (res.getRegisterValue(0) / 10);
MS_out_power = (res.getRegisterValue(0) / 10);
MS_in_power = (res.getRegisterValue(1) / 10);
MS_sweep_pin_max = (res.getRegisterValue(2) / 10);
req.setReference(0x40);
......
......@@ -3,7 +3,7 @@
# sudo pip3 install w1thermsensor
# derived from https://bigl.es/ds18b20-temperature-sensor-with-python-raspberry-pi/
#
# To use with the server modify these two lines on the conf/magnum-server.vonf file
# To use with the server modify these two lines on the conf/magnum-server.conf file
# server_readers=MagnumReader,ShellReader
# shellreader_commands="/usr/bin/python3 /home/pi/magnum/python/read_ds18b20.py"
# the actual path to the file will need to be adjusted to match your installation
......
......@@ -29,7 +29,7 @@
require_once 'setup.php';
$server = new Magnum ();
$trace = @$options ["trace"];
$loginterval = @$options ["logger_loginterval"];
$loginterval = @$options ["logger_interval"];
if (! $loginterval)
$loginterval = @$options ["loginterval"];
if (! $loginterval)
......
......@@ -70,7 +70,7 @@ class Daylight extends MagnumEvent {
$eventdata ['event_id'] = $daylight == 1 ? 20 : 21;
$eventdata ['description'] = $text;
$eventdata ['metric_title'] = "Interval";
$eventdata ['metric_unit'] = "Min";
$eventdata ['metric_unit'] = "Sec";
$eventdata ['metric_value'] = $timestamp - $checkpoint ['daylighttime'];
$checkpoint ['daylight'] = $daylight;
$checkpoint ['daylighttime'] = $timestamp;
......
......@@ -51,7 +51,7 @@ class GeneratorStatus extends MagnumEvent {
$eventdata ['event_id'] = $running ? 10 : 11;
$eventdata ['description'] = $running ? "Generator $start" : "Generator Stop";
$eventdata ['metric_title'] = "Elapsed Time";
$eventdata ['metric_unit'] = "Min";
$eventdata ['metric_unit'] = "Sec";
$eventdata ['metric_value'] = $timestamp - $checkpoint ['time'];
$meta = array();
foreach (array("BMK_soc", "BMK_vdc", "BMK_amph") as $value){
......
......@@ -202,7 +202,7 @@ class Magnum {
fputcsv ( $handle, array_keys ( $data ), ',', '"' );
}
fputcsv ( $handle, array_values ( $data ), ',', '"' );
rewind($fp);
rewind($handle);
$contents = '';
while ( ! feof ( $handle ) ) {
$contents .= fread ( $handle, 8192 );
......
......@@ -23,19 +23,22 @@ cd ..
# clean out all pre 2.1.0 scripts and service control
rm -f $SCRIPTS initialize
rm -f conf/is*sysd
if [ ! -f lib/gson.jar ]; then
echo "Installing gson.jar"
wget -q -O lib/gson.jar http://central.maven.org/maven2/com/google/code/gson/gson/2.8.5/gson-2.8.5.jar
chmod ug+rw lib/gson.jar
cd lib
gson_version="2.8.5"
if [ ! -f gson-${gson_version}.jar ]; then
echo "Installing/Updating gson version ${gson_version}"
rm -f gson*
wget -q http://central.maven.org/maven2/com/google/code/gson/gson/${gson_version}/gson-${gson_version}.jar
chmod ug+rw gson*.jar
fi
if [ ! -f lib/jSerialComm.jar ]; then
echo "Installing jSerialComm.jar"
wget -q -O lib/jSerialComm.jar https://github.com/Fazecast/jSerialComm/releases/download/v2.4.2/jSerialComm-2.4.2.jar
chmod ug+rw lib/jSerialComm.jar
which zip >/dev/null && zip -d lib/jSerialComm.jar Android/* 1> /dev/null 2>&1
serial_version="2.5.1"
if [ ! -f jSerialComm-${serial_version}.jar ]; then
echo "Installing/Updating jSerialComm version ${serial_version}"
rm -f jSerialComm*
wget -q https://github.com/Fazecast/jSerialComm/releases/download/v${serial_version}/jSerialComm-${serial_version}.jar
chmod ug+rw jSerialComm*.jar
fi
cd ..
#
# build default service unit files
#
......
......@@ -3,5 +3,5 @@ cd "DIR"
bin/stopserver >/dev/null
TS=`date +%Y%m%d_%H%M`
java -classpath magnum.jar:lib/* Test_rs485 "$@"| tee log/testRS485-$TS.txt 2>&1
echo "The log file is in DIR/log/TestRS485-$TS.txt"
echo "The log file is in DIR/log/testRS485-$TS.txt"
echo
......@@ -22,15 +22,15 @@ Copyright (c) 2018
import java.util.Properties;
import ca.godwin.magnum.MagnumPacket;
import ca.godwin.magnum.ServerProperties;
import ca.godwin.magnum.MockReader;
import ca.godwin.magnum.PacketReader;
import ca.godwin.magnum.RS485Reader;
import ca.godwin.magnum.RS485Reader_2;
import ca.godwin.magnum.ServerProperties;
public class Test_rs485 {
public static void main(String args[]) throws Exception {
System.setProperty("java.library.path", "lib");
ServerProperties.addOptions(args);
final Properties options = ServerProperties.getOptions();
final int packetlimit = Integer.parseInt(options.getProperty("packets", "100"));
......@@ -39,22 +39,19 @@ public class Test_rs485 {
+ " packets are collected");
// create an instance of the serial communications class
final boolean mockdata = Boolean.parseBoolean(options.getProperty("mockdata", "false"));
final boolean oldserialreader = Boolean.parseBoolean(options.getProperty("oldserialreader", "false"));
PacketReader reader;
if (mockdata) {
reader = new MockReader();
} else {
reader = new RS485Reader();
reader = oldserialreader?new RS485Reader():new RS485Reader_2();
}
reader.initReader();
final long start = System.currentTimeMillis();
final byte[][] results = reader.getRawPackets(packetlimit);
final long interval = System.currentTimeMillis() - start;
long bytes = 0;
if (mockdata) {
System.out.println("using mock data");
} else {
System.out.println("using " + ((RS485Reader) reader).getDevice());
}
System.out.println("using " + reader.getDevice() + (oldserialreader?" with OLD Serial reader":""));
if (results.length == 0) {
System.out.println("There was no data read");
} else {
......
......@@ -22,7 +22,7 @@ package ca.godwin.magnum;
import java.nio.ByteBuffer;
import java.util.LinkedHashMap;
public class LogRecordAGS extends MagnumRecord {
public class LogRecordAGS extends MagnumRecord {
private byte AGS_status;
private String AGS_status_text = "unknown";
private String AGS_revision = "0.0";
......@@ -31,11 +31,10 @@ public class LogRecordAGS extends MagnumRecord {
private float AGS_vdc;
private boolean AGS_running;
private short AGS_gen_last_run = -1;
private short AGS_last_full_soc = -1; // not available in some devices
private int AGS_gen_last_run = -1;
private int AGS_last_full_soc = -1; // not available in some devices
private int AGS_gen_total_run = -1; // not available in some devices
public LogRecordAGS() {
super();
}
......@@ -44,35 +43,34 @@ public class LogRecordAGS extends MagnumRecord {
* @see ca.godwin.magnum.DeviceInterface#extractValues(ca.godwin.magnum.MagnumPacket)
*/
@Override
public void processPacket (MagnumPacket packet) {
public void processPacket(MagnumPacket packet) {
final ByteBuffer buf = ByteBuffer.wrap(packet.getBuffer());
switch(packet.getPacketType()) {
switch (packet.getPacketType()) {
case AGS_A1:
buf.get(); // skip lead byte
AGS_status = buf.get();
AGS_revision = String.valueOf((float) Byte.toUnsignedInt(buf.get()) / 10);
AGS_temp = buf.get();
/**
* AGS_temp is unsigned in ARC and not valid below 33 F and 104 F
* I recommend using a separate sensor for full range of temperatures that are below 0 celcius
* AGS_temp is unsigned in ARC and not valid below 33 F and 104 F I recommend
* using a separate sensor for full range of temperatures that are below 0 celcius
*/
if (AGS_temp < 105) {
AGS_temp = (short) (((float) AGS_temp - 32) * 5 / 9);
AGS_temp = (short) (((float) AGS_temp - 32) * 5 / 9);
}
AGS_runtime = (float) Byte.toUnsignedInt(buf.get()) / 10;
AGS_runtime = (float) Byte.toUnsignedInt(buf.get()) / 10;
setStatusText();
if (buf.capacity() > 6){
AGS_vdc = Byte.toUnsignedInt(buf.get()) / 10 * voltage_multiplier;
if (buf.hasRemaining()) {
int value_vdc = Byte.toUnsignedInt(buf.get()) * voltage_multiplier;
AGS_vdc = (float) value_vdc / 10;
}
setRunning();
break;
case AGS_A2:
buf.get(); // skip first
AGS_gen_last_run = (short) Byte.toUnsignedInt(buf.get());
if (buf.capacity() > 6) {
AGS_last_full_soc = (short) Short.toUnsignedInt(buf.getShort());
AGS_gen_total_run = Short.toUnsignedInt(buf.getShort());
}
AGS_gen_last_run = Byte.toUnsignedInt(buf.get());
AGS_last_full_soc = Byte.toUnsignedInt(buf.get());
AGS_gen_total_run = Short.toUnsignedInt(buf.getShort());
break;
default:
break;
......@@ -101,41 +99,97 @@ public class LogRecordAGS extends MagnumRecord {
}
private void setStatusText() {
switch (AGS_status){
case 0: AGS_status_text = "Not Connected"; break;
case 1: AGS_status_text = "Off"; break;
case 2: AGS_status_text = "Ready"; break;
case 3: AGS_status_text = "Manual Run"; break;
case 4: AGS_status_text = "AC In"; break;
case 5: AGS_status_text = "In quiet time"; break;
case 6: AGS_status_text = "Start in test mode"; break;
case 7: AGS_status_text = "Start on temperature"; break;
case 8: AGS_status_text = "Start on voltage"; break;
case 9: AGS_status_text = "Fault start on test"; break;
case 10: AGS_status_text = "Fault start on temp"; break;
case 11: AGS_status_text = "Fault start on voltage"; break;
case 12: AGS_status_text = "Start TOD"; break;
case 13: AGS_status_text = "Start SOC"; break;
case 14: AGS_status_text = "Start Exercise"; break;
case 15: AGS_status_text = "Fault start TOD"; break;
case 16: AGS_status_text = "Fault start SOC"; break;
case 17: AGS_status_text = "Fault start Exercise"; break;
case 18: AGS_status_text = "Start on Amp"; break;
case 19: AGS_status_text = "Start on Topoff"; break;
case 20: AGS_status_text = "Not used"; break;
case 21: AGS_status_text = "Fault start on Amp"; break;
case 22: AGS_status_text = "Fault on Topoff"; break;
case 23: AGS_status_text = "Not used"; break;
case 24: AGS_status_text = "Fault max run"; break;
case 25: AGS_status_text = "Gen Run Fault"; break;
case 26: AGS_status_text = "Gen in Warm up"; break;
case 27: AGS_status_text = "Gen in Cool down"; break;
switch (AGS_status) {
case 0:
AGS_status_text = "Not Connected";
break;
case 1:
AGS_status_text = "Off";
break;
case 2:
AGS_status_text = "Ready";
break;
case 3:
AGS_status_text = "Manual Run";
break;
case 4:
AGS_status_text = "AC In";
break;
case 5:
AGS_status_text = "In quiet time";
break;
case 6:
AGS_status_text = "Start in test mode";
break;
case 7:
AGS_status_text = "Start on temperature";
break;
case 8:
AGS_status_text = "Start on voltage";
break;
case 9:
AGS_status_text = "Fault start on test";
break;
case 10:
AGS_status_text = "Fault start on temp";
break;
case 11:
AGS_status_text = "Fault start on voltage";
break;
case 12:
AGS_status_text = "Start TOD";
break;
case 13:
AGS_status_text = "Start SOC";
break;
case 14:
AGS_status_text = "Start Exercise";
break;
case 15:
AGS_status_text = "Fault start TOD";
break;
case 16:
AGS_status_text = "Fault start SOC";
break;
case 17:
AGS_status_text = "Fault start Exercise";
break;
case 18:
AGS_status_text = "Start on Amp";
break;
case 19:
AGS_status_text = "Start on Topoff";
break;
case 20:
AGS_status_text = "Not used";
break;
case 21:
AGS_status_text = "Fault start on Amp";
break;
case 22:
AGS_status_text = "Fault on Topoff";
break;
case 23:
AGS_status_text = "Not used";
break;
case 24:
AGS_status_text = "Fault max run";
break;
case 25:
AGS_status_text = "Gen Run Fault";
break;
case 26:
AGS_status_text = "Gen in Warm up";
break;
case 27:
AGS_status_text = "Gen in Cool down";
break;
default:
AGS_status_text = "Unknown";
}
}
public String getStatusText (){
public String getStatusText() {
return AGS_status_text;
}
......@@ -165,5 +219,4 @@ public class LogRecordAGS extends MagnumRecord {
return map;
}
}
\ No newline at end of file
......@@ -29,6 +29,7 @@ public class LogRecordPT100 extends MagnumRecord {
String PT_mode_text;
byte PT_regulation;
String PT_regulation_text;
String PT_status_byte;
byte PT_fault;
String PT_fault_text;
float PT_battery;
......@@ -93,6 +94,8 @@ public class LogRecordPT100 extends MagnumRecord {
// byte 3
byte_value = Byte.toUnsignedInt(buf.get());
PT_fault = (byte) (byte_value >> 3);
byte[] status_byte = {(byte) byte_value};
PT_status_byte = MagnumPacket.bytesToHex(status_byte);
PT_battery =(float) Short.toUnsignedInt(buf.getShort()) / 10;
PT_battery_amps =(float) buf.getShort() / 10;
PT_pv_voltage =(float) buf.getShort() / 10;
......@@ -246,6 +249,7 @@ public class LogRecordPT100 extends MagnumRecord {
map.put("PT_mode", PT_mode);
map.put("PT_mode_text", PT_mode_text);
map.put("PT_regulation", PT_regulation);
map.put("PT_status_byte", PT_status_byte);
map.put("PT_regulation_text", PT_regulation_text);
map.put("PT_fault", PT_fault);
map.put("PT_fault_text", PT_fault_text);
......
......@@ -29,7 +29,7 @@ import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
public class MagnumReader implements DataReader {
// fields to drop if no device
// fields to drop if no device
static final String[] noAGS = { "ARC_genstart", "ARC_runtime", "ARC_starttemp", "ARC_startvdc", "ARC_quiettime",
"ARC_begintime", "ARC_stoptime", "ARC_vdcstop", "ARC_voltstartdelay", "ARC_voltstopdelay", "ARC_maxrun",
"ARC_socstart", "ARC_socstop", "ARC_ampstart", "ARC_ampsstartdelay", "ARC_ampstop", "ARC_ampsstopdelay",
......@@ -46,11 +46,24 @@ public class MagnumReader implements DataReader {
protected Properties options = ServerProperties.getOptions();
protected boolean trace = Boolean.parseBoolean(options.getProperty("trace", "false"));
protected int packetstride = Integer.parseInt(System.getProperty("packetstride", "50"));
final boolean oldserialreader = Boolean.parseBoolean(options.getProperty("oldserialreader", "false"));
protected PacketReader reader;
/*
* I have moved these to being persistent for duration
* This is necessary as some peripherals are not very talkative
* The AGS doesn't always send an A2 packet
* and the PT-100 doesn't say very much at all about C2, C3 and C4 packets
*/
protected LogRecordINV INV_data = null;
protected LogRecordARC ARC_data = null;
protected LogRecordAGS AGS_data = null;
protected LogRecordBMK BMK_data = null;
protected LogRecordRTR RTR_data = null;
protected LogRecordPT100 PT100_data = null;
public MagnumReader() throws Exception {
super();
reader = new RS485Reader();
reader = oldserialreader?new RS485Reader():new RS485Reader_2();
}
public void init() throws Exception {
......@@ -58,13 +71,6 @@ public class MagnumReader implements DataReader {
}
protected ArrayList<DeviceRecord> consolidate(ArrayList<MagnumPacket> records) {
LogRecordINV INV_data = null;
LogRecordARC ARC_data = null;
LogRecordAGS AGS_data = null;
LogRecordBMK BMK_data = null;
LogRecordRTR RTR_data = null;
LogRecordPT100 PT100_data = null;
for (final MagnumPacket packet : records) {
try {
final MagnumMessage type = packet.getPacketType();
......
......@@ -77,4 +77,9 @@ public class MockReader implements PacketReader {
}
@Override
public String getDevice() {
return "Mock data";
}
}
......@@ -26,7 +26,8 @@ public interface PacketReader {
*/
public void initReader() throws Exception;
public String getDevice();
/*