This commit is contained in:
backuppc
2025-11-10 14:43:47 +09:00
parent 68745f23bb
commit 6e54633c08
57 changed files with 4432 additions and 1018 deletions

View File

@@ -117,10 +117,6 @@ namespace Project
Console.WriteLine($"bms connect to {PUB.setting.Port_BAT}");
PUB.BMS.PortName = PUB.setting.Port_BAT;
PUB.BMS.Open();
PUB.BMS.BMSDataReceive += Bms_BMSDataReceive;
PUB.BMS.Message += Bms_Message;
PUB.BMS.ChargeDetect += BMS_ChargeDetect;
VAR.TIME.Update(eVarTime.LastConn_BAT);
VAR.TIME.Update(eVarTime.LastConnTry_BAT);
@@ -132,9 +128,6 @@ namespace Project
if (ts.TotalSeconds > 10)
{
Console.WriteLine("bms auto disconnect");
PUB.BMS.BMSDataReceive -= Bms_BMSDataReceive;
PUB.BMS.Message -= Bms_Message;
PUB.BMS.ChargeDetect -= BMS_ChargeDetect;
PUB.BMS.Close();
VAR.TIME.Set(eVarTime.LastConn_BAT,DateTime.Now.AddSeconds(5));
}
@@ -159,7 +152,7 @@ namespace Project
{
if (PUB.BMS.lastSendTime.Year == 1982) PUB.BMS.lastSendTime = DateTime.Now.AddSeconds(1);
var ts = DateTime.Now - PUB.BMS.lastSendTime;
if (ts.TotalMilliseconds >= PUB.setting.interval_bms)
if (ts.TotalSeconds >= PUB.setting.interval_bms)
{
PUB.BMS.SendQuery();
}