V1.0.2.0
* Added RS232/RS485 Packet Analyzer (Tools -> Packet Analyzer) * Updated BMS History register request/response length by model * Fixed decimal truncation issue in Brazil locale for DB/CSV Log and Excel Export
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
@@ -28,6 +28,7 @@ namespace LFP_Manager.Forms
|
||||
private fmxModuleDetail ModuleDetailForm = null;
|
||||
private fmxFwUpdate FwUpdateForm = null;
|
||||
private fmxHistory HistoryForm = null;
|
||||
private fmxPacketLog PacketLogForm = null;
|
||||
|
||||
// Static Variables
|
||||
private CommConfig Config = new CommConfig();
|
||||
@@ -59,6 +60,15 @@ namespace LFP_Manager.Forms
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
if (Program.DeltaLogoBitmap != null)
|
||||
{
|
||||
this.IconOptions.Image = Program.DeltaLogoBitmap;
|
||||
}
|
||||
else if (global::LFP_Manager.Properties.Resources.Delta_Logo_1 != null)
|
||||
{
|
||||
this.IconOptions.Image = global::LFP_Manager.Properties.Resources.Delta_Logo_1;
|
||||
}
|
||||
|
||||
StructDataInit();
|
||||
//DataInit();
|
||||
|
||||
@@ -292,6 +302,7 @@ namespace LFP_Manager.Forms
|
||||
uartThread.OnUpdate += UpdateDataUart;
|
||||
uartThread.OnDataRecv += UartRecvData;
|
||||
uartThread.OnPrint += CommDataPrint;
|
||||
uartThread.OnPacketLog += PacketLogUpdate;
|
||||
uartThread.SetPolling(chbPolling.Checked, ModuleID, ref SystemData[ModuleID - 1]);
|
||||
|
||||
if (uartThread.Start(ref Config, ModuleID, chbPolling.Checked))
|
||||
@@ -349,6 +360,7 @@ namespace LFP_Manager.Forms
|
||||
rs232Thread124050.OnUpdate += UpdateDataUart;
|
||||
rs232Thread124050.OnDataRecv += UartRecvData;
|
||||
rs232Thread124050.OnPrint += CommDataPrint;
|
||||
rs232Thread124050.OnPacketLog += PacketLogUpdate;
|
||||
rs232Thread124050.SetPolling(chbPolling.Checked, ModuleID, ref SystemData[ModuleID - 1]);
|
||||
|
||||
if (rs232Thread124050.Start(ref Config, ModuleID, chbPolling.Checked))
|
||||
@@ -410,6 +422,7 @@ namespace LFP_Manager.Forms
|
||||
rs485Thread.OnUpdate += UpdateDataRS485;
|
||||
rs485Thread.OnDataRecv += UartRecvData;
|
||||
rs485Thread.OnPrint += CommDataPrint;
|
||||
rs485Thread.OnPacketLog += PacketLogUpdate;
|
||||
rs485Thread.SetPolling(chbPolling.Checked, ModuleID, ref SystemData);
|
||||
|
||||
if (rs485Thread.Start(ref Config, ModuleID, chbPolling.Checked))
|
||||
@@ -465,6 +478,7 @@ namespace LFP_Manager.Forms
|
||||
rs485Thread124050.OnUpdate += UpdateDataRS485;
|
||||
rs485Thread124050.OnDataRecv += UartRecvData;
|
||||
rs485Thread124050.OnPrint += CommDataPrint;
|
||||
rs485Thread124050.OnPacketLog += PacketLogUpdate;
|
||||
rs485Thread124050.SetPolling(chbPolling.Checked, ModuleID, ref SystemData);
|
||||
|
||||
if (rs485Thread124050.Start(ref Config, ModuleID, chbPolling.Checked))
|
||||
@@ -895,6 +909,8 @@ namespace LFP_Manager.Forms
|
||||
|
||||
private void UpdateSnmpData(object sender, ref DeviceSystemData rData)
|
||||
{
|
||||
ShelfStatus?.UpdateData(ref SystemData);
|
||||
dbThread?.UpdateData(ModuleID, SystemData);
|
||||
uDataLog.UpdateData(SystemData);
|
||||
}
|
||||
|
||||
@@ -961,6 +977,31 @@ namespace LFP_Manager.Forms
|
||||
HistoryForm.ShowDialog();
|
||||
}
|
||||
|
||||
private void packetLogToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (PacketLogForm == null || PacketLogForm.IsDisposed)
|
||||
{
|
||||
PacketLogForm = new fmxPacketLog();
|
||||
}
|
||||
|
||||
if (PacketLogForm.Visible)
|
||||
{
|
||||
PacketLogForm.Activate();
|
||||
}
|
||||
else
|
||||
{
|
||||
PacketLogForm.Show(this);
|
||||
}
|
||||
}
|
||||
|
||||
private void PacketLogUpdate(DateTime timestamp, bool isTx, byte[] data, string description)
|
||||
{
|
||||
if (PacketLogForm != null && !PacketLogForm.IsDisposed)
|
||||
{
|
||||
PacketLogForm.AddPacketLog(timestamp, isTx, data, description);
|
||||
}
|
||||
}
|
||||
|
||||
private void inventoryViewToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
foreach (Form frm in Application.OpenForms)
|
||||
|
||||
Reference in New Issue
Block a user