..
This commit is contained in:
@@ -112,22 +112,8 @@ public static partial class EEMStatus
|
||||
var mcid = Project.PUB.setting.MCID;
|
||||
var timestr = PUB.BMS.Current_DataTime.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
// BMS 데이터 (실제 값으로 교체 필요)
|
||||
var info_volt = PUB.BMS.Current_Volt;// "null"; // bms.Voltage
|
||||
var info_current = PUB.BMS.Current_Amp;// "null"; // bms.Current
|
||||
var info_capa = PUB.BMS.Current_MaxAmp;// "null"; // bms.Capacity
|
||||
var info_level = PUB.BMS.Current_Level;// "null"; // bms.Level
|
||||
var info_temp1 = PUB.BMS.Current_temp1;// "null"; // bms.Temp1
|
||||
var info_temp2 = PUB.BMS.Current_temp2;// "null"; // bms.Temp2
|
||||
var cell_volt1 = PUB.BMS.CellVoltage[0];// "null"; // bms.CellVolt1
|
||||
var cell_volt2 = PUB.BMS.CellVoltage[1]; // bms.CellVolt2
|
||||
var cell_volt3 = PUB.BMS.CellVoltage[2]; // bms.CellVolt3
|
||||
var cell_volt4 = PUB.BMS.CellVoltage[3]; // bms.CellVolt4
|
||||
var cell_volt5 = PUB.BMS.CellVoltage[4]; // bms.CellVolt5
|
||||
var cell_volt6 = PUB.BMS.CellVoltage[5]; // bms.CellVolt6
|
||||
var cell_volt7 = PUB.BMS.CellVoltage[6]; // bms.CellVolt7
|
||||
var cell_volt8 = PUB.BMS.CellVoltage[7]; // bms.CellVolt8
|
||||
|
||||
var data = PUB.BMS.BMSInformation;
|
||||
|
||||
// Status 폴더에 SQL 파일 생성
|
||||
var path = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Status");
|
||||
if (System.IO.Directory.Exists(path) == false)
|
||||
@@ -135,10 +121,8 @@ public static partial class EEMStatus
|
||||
|
||||
var file = System.IO.Path.Combine(path, $"{DateTime.Now.ToString("HHmmssfff")}_BMS_INF.sql");
|
||||
|
||||
var sql = "insert into AGV_Shuttle_BMS(MCID,wdate,info_volt,info_current,info_capa,info_level,info_temp1,info_temp2) " +
|
||||
"values('{0}','{1}',{2},{3},{4},{5},{6},{7})";
|
||||
|
||||
sql = string.Format(sql, mcid, timestr, info_volt, info_current, info_capa, info_level, info_temp1, info_temp2);
|
||||
var sql = "insert into AGV_Shuttle_BMS(MCID,wdate,info_volt,info_current,info_capa,info_level,info_temp1,info_temp2,soc,cycle,protection,balance) " +
|
||||
$"values('{mcid}','{timestr}',{data.packVoltage},{data.current},{data.fullCapacity},{data.RawLevel},{data.ntcTemp[0]},{data.ntcTemp[1]},{data.rsoc},{data.cycleCount},{data.raw_protection},{data.fullBalance})";
|
||||
|
||||
System.IO.File.WriteAllText(file, sql, System.Text.Encoding.Default);
|
||||
LastBMSIFTime = DateTime.Now;
|
||||
@@ -167,20 +151,15 @@ public static partial class EEMStatus
|
||||
var timestr = PUB.BMS.Current_CellTime.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
// BMS 데이터 (실제 값으로 교체 필요)
|
||||
var info_volt = PUB.BMS.Current_Volt;// "null"; // bms.Voltage
|
||||
var info_current = PUB.BMS.Current_Amp;// "null"; // bms.Current
|
||||
var info_capa = PUB.BMS.Current_MaxAmp;// "null"; // bms.Capacity
|
||||
var info_level = PUB.BMS.Current_Level;// "null"; // bms.Level
|
||||
var info_temp1 = PUB.BMS.Current_temp1;// "null"; // bms.Temp1
|
||||
var info_temp2 = PUB.BMS.Current_temp2;// "null"; // bms.Temp2
|
||||
var cell_volt1 = PUB.BMS.CellVoltage[0];// "null"; // bms.CellVolt1
|
||||
var cell_volt2 = PUB.BMS.CellVoltage[1]; // bms.CellVolt2
|
||||
var cell_volt3 = PUB.BMS.CellVoltage[2]; // bms.CellVolt3
|
||||
var cell_volt4 = PUB.BMS.CellVoltage[3]; // bms.CellVolt4
|
||||
var cell_volt5 = PUB.BMS.CellVoltage[4]; // bms.CellVolt5
|
||||
var cell_volt6 = PUB.BMS.CellVoltage[5]; // bms.CellVolt6
|
||||
var cell_volt7 = PUB.BMS.CellVoltage[6]; // bms.CellVolt7
|
||||
var cell_volt8 = PUB.BMS.CellVoltage[7]; // bms.CellVolt8
|
||||
var volt = PUB.BMS.BMSCellVoltage;
|
||||
var cell_volt1 = volt.Voltage[0];// "null"; // bms.CellVolt1
|
||||
var cell_volt2 = volt.Voltage[1]; // bms.CellVolt2
|
||||
var cell_volt3 = volt.Voltage[2]; // bms.CellVolt3
|
||||
var cell_volt4 = volt.Voltage[3]; // bms.CellVolt4
|
||||
var cell_volt5 = volt.Voltage[4]; // bms.CellVolt5
|
||||
var cell_volt6 = volt.Voltage[5]; // bms.CellVolt6
|
||||
var cell_volt7 = volt.Voltage[6]; // bms.CellVolt7
|
||||
var cell_volt8 = volt.Voltage[7]; // bms.CellVolt8
|
||||
|
||||
// Status 폴더에 SQL 파일 생성
|
||||
var path = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Status");
|
||||
|
||||
@@ -273,8 +273,8 @@ namespace Project
|
||||
else
|
||||
{
|
||||
//단순 수치값을 크게 표시히낟.
|
||||
var Volt = dev_bms?.Current_Volt ?? 25.35f;
|
||||
var Lev = dev_bms?.Current_Level ?? 80.1f;
|
||||
var Volt = dev_bms?.BMSInformation.packVoltage ?? 25.35f;
|
||||
var Lev = dev_bms?.BMSInformation.rsoc ?? 80f;
|
||||
|
||||
var textColor = Color.Lime;
|
||||
if (Lev < 30) textColor = Color.Red;
|
||||
@@ -439,7 +439,7 @@ namespace Project
|
||||
|
||||
|
||||
var bmslevel = 28f;
|
||||
if (dev_bms != null) bmslevel = dev_bms.Current_Level;
|
||||
if (dev_bms != null) bmslevel = dev_bms.BMSInformation.rsoc;
|
||||
var CornerRadius = 10;
|
||||
var XPosition = rectR.Left + (rectR.Width - batw) / 2f;
|
||||
var YPosition = rectR.Top + (rectR.Height - bath) / 2f + (rectR.Height * 0.05f);
|
||||
|
||||
@@ -9,12 +9,152 @@ using System.CodeDom;
|
||||
|
||||
namespace arDev
|
||||
{
|
||||
public class BMSCellInformation
|
||||
{
|
||||
public float[] Voltage = new float[8];
|
||||
public float Average
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Voltage.Any() == false) return 0f;
|
||||
return Voltage.Average();
|
||||
}
|
||||
}
|
||||
public float Delta
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Voltage.Any() == false) return 0f;
|
||||
return Math.Abs(Voltage.Max() - Voltage.Min());
|
||||
}
|
||||
}
|
||||
}
|
||||
public class BMSBasicInformation
|
||||
{
|
||||
public float packVoltage { get; set; }
|
||||
public float current { get; set; }
|
||||
public float remainingCapacity { get; set; }
|
||||
public float fullCapacity { get; set; }
|
||||
public UInt16 cycleCount { get; set; }
|
||||
public DateTime productionDate { get; set; }
|
||||
public UInt32 fullBalance { get; set; }
|
||||
public BMSProtectionStatus protectionStatus { get; set; }
|
||||
public byte version { get; set; }
|
||||
public byte rsoc { get; set; }
|
||||
public BMSMosfetStatus mosfetStatus { get; set; }
|
||||
public byte ntcCount { get; set; }
|
||||
public float[] ntcTemp { get; set; }
|
||||
|
||||
public ushort raw_protection { get; set; }
|
||||
public float watt
|
||||
{
|
||||
get
|
||||
{
|
||||
return (this.current * packVoltage);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Remain / Full * 100
|
||||
/// </summary>
|
||||
public float RawLevel
|
||||
{
|
||||
get
|
||||
{
|
||||
if (fullCapacity < 1) return 0f;
|
||||
return (remainingCapacity / fullCapacity) * 100f;
|
||||
}
|
||||
}
|
||||
|
||||
public BMSBasicInformation()
|
||||
{
|
||||
protectionStatus = new BMSProtectionStatus();
|
||||
mosfetStatus = new BMSMosfetStatus();
|
||||
productionDate = new DateTime();
|
||||
ntcTemp = new float[] { 0f,0f};
|
||||
|
||||
}
|
||||
public void Clear()
|
||||
{
|
||||
packVoltage = 0;
|
||||
current = 0;
|
||||
remainingCapacity = 0;
|
||||
fullBalance = 0;
|
||||
fullCapacity = 0;
|
||||
cycleCount = 0;
|
||||
productionDate = new DateTime();
|
||||
protectionStatus = new BMSProtectionStatus();
|
||||
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"packVoltage:{packVoltage}\n" +
|
||||
$"current:{current}\n" +
|
||||
$"remainingCapacity:{remainingCapacity}\n" +
|
||||
$"fullCapacity:{fullCapacity}\n" +
|
||||
$"cycleCount:{cycleCount}\n" +
|
||||
$"productionDate:{productionDate}\n" +
|
||||
$"fullBalance:{fullBalance}\n" +
|
||||
$"protectionStatus:{protectionStatus}\n" +
|
||||
$"version:{version}\n" +
|
||||
$"rsoc:{rsoc}\n" +
|
||||
$"mosfetStatus:{mosfetStatus}\n" +
|
||||
$"ntcCount:{ntcCount}\n" +
|
||||
$"ntcTemp:{ntcTemp}\n" +
|
||||
$"watt:{watt}\n" +
|
||||
$"RawLevel:{RawLevel}";
|
||||
}
|
||||
}
|
||||
public class BMSProtectionStatus
|
||||
{
|
||||
public bool covp { get; set; }// Cell Over Voltage Protection
|
||||
public bool cuvp { get; set; } // Cell Under Voltage Protection
|
||||
public bool povp { get; set; } // Pack Over Voltage Protection
|
||||
public bool puvp { get; set; } // Pack Under Voltage Protection
|
||||
public bool chgot { get; set; }// Charge Over Temp
|
||||
public bool chgut { get; set; } // Charge Under Temp
|
||||
public bool dsgot { get; set; } // Discharge Over Temp
|
||||
public bool dsgut { get; set; } // Discharge Under Temp
|
||||
public bool chgoc { get; set; } // Charge Over Current
|
||||
public bool dsgoc { get; set; } // Discharge Over Current
|
||||
public bool sc { get; set; } // Short Circuit
|
||||
public bool afe { get; set; } // AFE Error
|
||||
public override string ToString()
|
||||
{
|
||||
return "BMSProtectionStatus\n" +
|
||||
$"covp={covp}\n" +// { get; set; }// Cell Over Voltage Protection
|
||||
$"cuvp={cuvp}\n" +// { get; set; } // Cell Under Voltage Protection
|
||||
$"povp={povp}\n" +// { get; set; } // Pack Over Voltage Protection
|
||||
$"puvp={puvp}\n" +// { get; set; } // Pack Under Voltage Protection
|
||||
$"chgot={chgot}\n" +// { get; set; }// Charge Over Temp
|
||||
$"chgut={chgut}\n" +// { get; set; } // Charge Under Temp
|
||||
$"dsgot={dsgot}\n" +// { get; set; } // Discharge Over Temp
|
||||
$"dsgut={dsgut}\n" +// { get; set; } // Discharge Under Temp
|
||||
$"chgoc={chgoc}\n" +// { get; set; } // Charge Over Current
|
||||
$"dsgoc={dsgoc}\n" +// { get; set; } // Discharge Over Current
|
||||
$"sc={sc}\n" +// { get; set; } // Short Circuit
|
||||
$"afe={afe}";// +// { get; set; } // AFE Error
|
||||
}
|
||||
}
|
||||
public class BMSMosfetStatus
|
||||
{
|
||||
public bool charge { get; set; }
|
||||
public bool discharge { get; set; }
|
||||
public override string ToString()
|
||||
{
|
||||
return $"charge:{charge}\n" +
|
||||
$"discharge:{discharge}";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class BMS : BMSSerialComm
|
||||
{
|
||||
public BMS()
|
||||
{
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -77,14 +217,14 @@ namespace arDev
|
||||
}
|
||||
}
|
||||
|
||||
// [22 - 12 - 27 14:32:49] open: True
|
||||
//[22 - 12 - 27 14:32:49] Send: DD A5 03 00 FF FD 77 0D
|
||||
//[22 - 12 - 27 14:32:50] Send: DD A5 03 00 FF FD 77 0D
|
||||
//[22 - 12 - 27 14:32:50] Recv: 26.61v,81.4 %
|
||||
//[22 - 12 - 27 14:32:50] Recv: DD 03 00 1B 0A 65 00 00 21 63 29 04 00 00 2C 92 00 00 00 00 00 00 28 51 03 08 02 0B 69 0B 66 FC 9C 77
|
||||
//[22 - 12 - 27 14:32:50] Send: DD A5 03 00 FF FD 77 0D
|
||||
//[22 - 12 - 27 14:32:51] Recv: 26.61v,81.4 %
|
||||
//[22 - 12 - 27 14:32:51] Recv: DD 03 00 1B 0A 65 00 00 21 63 29 04 00 00 2C 92 00 00 00 00 00 00 28 51 03 08 02 0B 69 0B 66 FC 9C 77
|
||||
// [22 - 12 - 27 14:32:49] open: True
|
||||
//[22 - 12 - 27 14:32:49] Send: DD A5 03 00 FF FD 77 0D
|
||||
//[22 - 12 - 27 14:32:50] Send: DD A5 03 00 FF FD 77 0D
|
||||
//[22 - 12 - 27 14:32:50] Recv: 26.61v,81.4 %
|
||||
//[22 - 12 - 27 14:32:50] Recv: DD 03 00 1B 0A 65 00 00 21 63 29 04 00 00 2C 92 00 00 00 00 00 00 28 51 03 08 02 0B 69 0B 66 FC 9C 77
|
||||
//[22 - 12 - 27 14:32:50] Send: DD A5 03 00 FF FD 77 0D
|
||||
//[22 - 12 - 27 14:32:51] Recv: 26.61v,81.4 %
|
||||
//[22 - 12 - 27 14:32:51] Recv: DD 03 00 1B 0A 65 00 00 21 63 29 04 00 00 2C 92 00 00 00 00 00 00 28 51 03 08 02 0B 69 0B 66 FC 9C 77
|
||||
|
||||
|
||||
//var queylen = QueryIndex == 0 ? 34 : 23;
|
||||
@@ -165,24 +305,24 @@ namespace arDev
|
||||
var recvchecksum = BitConverter.ToUInt16(LastReceiveBuffer.Skip(20).Take(2).Reverse().ToArray(), 0);
|
||||
if (recvchecksum == BatteryCell_Checksum)
|
||||
{
|
||||
var v1 = BitConverter.ToUInt16(LastReceiveBuffer.Skip(4).Take(2).Reverse().ToArray(), 0) / 1000.0;
|
||||
var v2 = BitConverter.ToUInt16(LastReceiveBuffer.Skip(6).Take(2).Reverse().ToArray(), 0) / 1000.0;
|
||||
var v3 = BitConverter.ToUInt16(LastReceiveBuffer.Skip(8).Take(2).Reverse().ToArray(), 0) / 1000.0;
|
||||
var v4 = BitConverter.ToUInt16(LastReceiveBuffer.Skip(10).Take(2).Reverse().ToArray(), 0) / 1000.0;
|
||||
var v5 = BitConverter.ToUInt16(LastReceiveBuffer.Skip(12).Take(2).Reverse().ToArray(), 0) / 1000.0;
|
||||
var v6 = BitConverter.ToUInt16(LastReceiveBuffer.Skip(14).Take(2).Reverse().ToArray(), 0) / 1000.0;
|
||||
var v7 = BitConverter.ToUInt16(LastReceiveBuffer.Skip(16).Take(2).Reverse().ToArray(), 0) / 1000.0;
|
||||
var v8 = BitConverter.ToUInt16(LastReceiveBuffer.Skip(18).Take(2).Reverse().ToArray(), 0) / 1000.0;
|
||||
var v1 = BitConverter.ToUInt16(LastReceiveBuffer.Skip(4).Take(2).Reverse().ToArray(), 0) / 1000f;
|
||||
var v2 = BitConverter.ToUInt16(LastReceiveBuffer.Skip(6).Take(2).Reverse().ToArray(), 0) / 1000f;
|
||||
var v3 = BitConverter.ToUInt16(LastReceiveBuffer.Skip(8).Take(2).Reverse().ToArray(), 0) / 1000f;
|
||||
var v4 = BitConverter.ToUInt16(LastReceiveBuffer.Skip(10).Take(2).Reverse().ToArray(), 0) / 1000f;
|
||||
var v5 = BitConverter.ToUInt16(LastReceiveBuffer.Skip(12).Take(2).Reverse().ToArray(), 0) / 1000f;
|
||||
var v6 = BitConverter.ToUInt16(LastReceiveBuffer.Skip(14).Take(2).Reverse().ToArray(), 0) / 1000f;
|
||||
var v7 = BitConverter.ToUInt16(LastReceiveBuffer.Skip(16).Take(2).Reverse().ToArray(), 0) / 1000f;
|
||||
var v8 = BitConverter.ToUInt16(LastReceiveBuffer.Skip(18).Take(2).Reverse().ToArray(), 0) / 1000f;
|
||||
|
||||
var idx = 0;
|
||||
CellVoltage[idx++] = v1;
|
||||
CellVoltage[idx++] = v2;
|
||||
CellVoltage[idx++] = v3;
|
||||
CellVoltage[idx++] = v4;
|
||||
CellVoltage[idx++] = v5;
|
||||
CellVoltage[idx++] = v6;
|
||||
CellVoltage[idx++] = v7;
|
||||
CellVoltage[idx++] = v8;
|
||||
BMSCellVoltage.Voltage[idx++] = v1;
|
||||
BMSCellVoltage.Voltage[idx++] = v2;
|
||||
BMSCellVoltage.Voltage[idx++] = v3;
|
||||
BMSCellVoltage.Voltage[idx++] = v4;
|
||||
BMSCellVoltage.Voltage[idx++] = v5;
|
||||
BMSCellVoltage.Voltage[idx++] = v6;
|
||||
BMSCellVoltage.Voltage[idx++] = v7;
|
||||
BMSCellVoltage.Voltage[idx++] = v8;
|
||||
|
||||
Recv1 = true;
|
||||
|
||||
@@ -199,61 +339,116 @@ namespace arDev
|
||||
}
|
||||
}
|
||||
else return false;
|
||||
|
||||
|
||||
}
|
||||
|
||||
bool ParseBMSInfo()
|
||||
{
|
||||
var newinfo = new BMSBasicInformation();
|
||||
|
||||
//전압확인
|
||||
UInt16 batH = (UInt16)LastReceiveBuffer[4];
|
||||
UInt16 batL = (UInt16)LastReceiveBuffer[5];
|
||||
var offset = 4;
|
||||
UInt16 batH = (UInt16)LastReceiveBuffer[offset + 0];
|
||||
UInt16 batL = (UInt16)LastReceiveBuffer[offset + 1];
|
||||
batH = (UInt16)(batH << 8);
|
||||
batH = (UInt16)(batH | batL);
|
||||
Current_Volt = (float)(batH / 100.0);
|
||||
newinfo.packVoltage = (float)(batH / 100.0);
|
||||
|
||||
//충방전전류
|
||||
Int16 batHi = (Int16)LastReceiveBuffer[6];
|
||||
Int16 batLi = (Int16)LastReceiveBuffer[7];
|
||||
Int16 batHi = (Int16)LastReceiveBuffer[offset + 2];
|
||||
Int16 batLi = (Int16)LastReceiveBuffer[offset + 3];
|
||||
batHi = (Int16)(batHi << 8);
|
||||
batHi = (Int16)(batHi | batLi);
|
||||
Charge_Amp = (float)(batHi / 100.0);
|
||||
newinfo.current = (float)(batHi / 100.0);
|
||||
|
||||
//잔량확인
|
||||
batH = (UInt16)LastReceiveBuffer[8];
|
||||
batL = (UInt16)LastReceiveBuffer[9];
|
||||
batH = (UInt16)LastReceiveBuffer[offset + 4];
|
||||
batL = (UInt16)LastReceiveBuffer[offset + 5];
|
||||
batH = (UInt16)(batH << 8);
|
||||
batH = (UInt16)(batH | batL);
|
||||
var newamp = (int)batH;
|
||||
var Changed = newamp != Current_Amp;
|
||||
Current_Amp = newamp;
|
||||
newinfo.remainingCapacity = (float)(batH / 100.0);
|
||||
|
||||
//총량확인
|
||||
batH = (UInt16)LastReceiveBuffer[10];
|
||||
batL = (UInt16)LastReceiveBuffer[11];
|
||||
batH = (UInt16)LastReceiveBuffer[offset + 6];
|
||||
batL = (UInt16)LastReceiveBuffer[offset + 7];
|
||||
batH = (UInt16)(batH << 8);
|
||||
batH = (UInt16)(batH | batL);
|
||||
Current_MaxAmp = (int)batH;
|
||||
newinfo.fullCapacity = (float)(batH / 100.0);
|
||||
|
||||
//남은 % 계산
|
||||
float levraw = (float)(Current_Amp / (Current_MaxAmp * 1.0));
|
||||
Current_Level = (float)(levraw * 100.0);// (float)(map(remain, 0, total, 0, 100));
|
||||
Current_LevelA = LastReceiveBuffer[23]; //<- 23번자료는 byte이므로 소수점이잇는 데이터로 직접 계산한다
|
||||
//cycle
|
||||
batH = (UInt16)LastReceiveBuffer[offset + 8];
|
||||
batL = (UInt16)LastReceiveBuffer[offset + 9];
|
||||
batH = (UInt16)(batH << 8);
|
||||
batH = (UInt16)(batH | batL);
|
||||
newinfo.cycleCount = batH;
|
||||
|
||||
//productiondate
|
||||
batH = (UInt16)LastReceiveBuffer[offset + 10];
|
||||
batL = (UInt16)LastReceiveBuffer[offset + 11];
|
||||
batH = (UInt16)(batH << 8);
|
||||
batH = (UInt16)(batH | batL);
|
||||
var info_productiondateint = batH;
|
||||
var date_year = (info_productiondateint >> 9) + 2000;
|
||||
var date_month = (info_productiondateint >> 5) & 0x0F;
|
||||
var date_day = info_productiondateint & 0x1F;
|
||||
newinfo.productionDate = new DateTime(date_year, date_month, date_day);
|
||||
|
||||
//balnace status
|
||||
batH = (UInt16)LastReceiveBuffer[offset + 12];
|
||||
batL = (UInt16)LastReceiveBuffer[offset + 13];
|
||||
batH = (UInt16)(batH << 8);
|
||||
var balanceStatus = (UInt16)(batH | batL);
|
||||
|
||||
//balnace status(HIGH)
|
||||
batH = (UInt16)LastReceiveBuffer[offset + 14];
|
||||
batL = (UInt16)LastReceiveBuffer[offset + 15];
|
||||
batH = (UInt16)(batH << 8);
|
||||
var balanceStatusHigh = (UInt16)(batH | batL);
|
||||
newinfo.fullBalance = (UInt32)(balanceStatus | (balanceStatusHigh << 16));
|
||||
|
||||
//protectionStatusRaw
|
||||
batH = (UInt16)LastReceiveBuffer[offset + 16];
|
||||
batL = (UInt16)LastReceiveBuffer[offset + 17];
|
||||
batH = (UInt16)(batH << 8);
|
||||
newinfo.raw_protection = batH;// view.getUint16(16, false);
|
||||
var protectionStatusRaw = newinfo.raw_protection;
|
||||
newinfo.protectionStatus.covp = (protectionStatusRaw & 1) > 0;
|
||||
newinfo.protectionStatus.cuvp = ((protectionStatusRaw >> 1) & 1) > 0;
|
||||
newinfo.protectionStatus.povp = ((protectionStatusRaw >> 2) & 1) > 0;
|
||||
newinfo.protectionStatus.puvp = ((protectionStatusRaw >> 3) & 1) > 0;
|
||||
newinfo.protectionStatus.chgot = ((protectionStatusRaw >> 4) & 1) > 0;
|
||||
newinfo.protectionStatus.chgut = ((protectionStatusRaw >> 5) & 1) > 0;
|
||||
newinfo.protectionStatus.dsgot = ((protectionStatusRaw >> 6) & 1) > 0;
|
||||
newinfo.protectionStatus.dsgut = ((protectionStatusRaw >> 7) & 1) > 0;
|
||||
newinfo.protectionStatus.chgoc = ((protectionStatusRaw >> 8) & 1) > 0;
|
||||
newinfo.protectionStatus.dsgoc = ((protectionStatusRaw >> 9) & 1) > 0;
|
||||
newinfo.protectionStatus.sc = ((protectionStatusRaw >> 10) & 1) > 0;
|
||||
newinfo.protectionStatus.afe = ((protectionStatusRaw >> 11) & 1) > 0;
|
||||
|
||||
|
||||
//version
|
||||
newinfo.version = LastReceiveBuffer[offset + 18];
|
||||
newinfo.rsoc = LastReceiveBuffer[offset + 19];
|
||||
var mosfetRaw = LastReceiveBuffer[offset + 20];
|
||||
newinfo.mosfetStatus.charge = (mosfetRaw & 1) == 1;
|
||||
newinfo.mosfetStatus.discharge = ((mosfetRaw >> 1) & 1) == 1;
|
||||
|
||||
|
||||
//250620 jwlee 추가
|
||||
int temp1 = (LastReceiveBuffer[27] << 8) | LastReceiveBuffer[28];
|
||||
int temp2 = (LastReceiveBuffer[29] << 8) | LastReceiveBuffer[30];
|
||||
newinfo.ntcCount = LastReceiveBuffer[offset + 22]; //센서갯수
|
||||
int temp1 = (LastReceiveBuffer[offset + 23] << 8) | LastReceiveBuffer[24];
|
||||
int temp2 = (LastReceiveBuffer[offset + 25] << 8) | LastReceiveBuffer[36];
|
||||
var Current_temp1 = (temp1 - 2731) / 10f;
|
||||
var Current_temp2 = (temp2 - 2731) / 10f;
|
||||
newinfo.ntcTemp = new float[] { (temp1 - 2731) / 10f, (temp2 - 2731) / 10f };
|
||||
|
||||
Current_temp1 = (temp1 - 2731) / 10f;
|
||||
Current_temp2 = (temp2 - 2731) / 10f;
|
||||
|
||||
CheckManualCharge();
|
||||
CheckManualCharge(newinfo);
|
||||
|
||||
Recv0 = true;
|
||||
|
||||
try
|
||||
{
|
||||
BMSDataReceive?.Invoke(this, new BMSInformationEventArgs(Current_Volt, Current_Amp, Current_MaxAmp, Current_Level, Changed));
|
||||
this.BMSInformation = newinfo;
|
||||
BMSDataReceive?.Invoke(this, new BMSInformationEventArgs(BMSInformation));
|
||||
Current_DataTime = DateTime.Now;
|
||||
return true;
|
||||
}
|
||||
@@ -263,16 +458,21 @@ namespace arDev
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public BMSBasicInformation BMSInformation = new BMSBasicInformation();
|
||||
public BMSCellInformation BMSCellVoltage = new BMSCellInformation();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 현재 충전중인지?
|
||||
/// </summary>
|
||||
public bool IsCharging { get; private set; }
|
||||
DateTime ChargeStart = DateTime.Now;
|
||||
DateTime ChargeEnd = DateTime.Now;
|
||||
void CheckManualCharge()
|
||||
void CheckManualCharge(BMSBasicInformation info)
|
||||
{
|
||||
//충방전전력이 1보다 크면 충전으로 한다.
|
||||
if (Charge_Amp > 0.1)
|
||||
if (this.BMSInformation.current > 0.1)
|
||||
{
|
||||
//기존에 충전상태가 OFF였다면 충전중으로 알려준다
|
||||
if (IsCharging == false)
|
||||
@@ -282,7 +482,7 @@ namespace arDev
|
||||
ChargeEnd = new DateTime(1982, 11, 23);
|
||||
try
|
||||
{
|
||||
ChargeDetect?.Invoke(this, new ChargetDetectArgs(ChargeStart, true, Current_Level));
|
||||
ChargeDetect?.Invoke(this, new ChargetDetectArgs(ChargeStart, true, info.RawLevel));
|
||||
}
|
||||
catch (Exception ex) { RaiseMessage(MessageType.Error, ex.Message); }
|
||||
}
|
||||
@@ -309,7 +509,7 @@ namespace arDev
|
||||
IsCharging = false;
|
||||
try
|
||||
{
|
||||
ChargeDetect?.Invoke(this, new ChargetDetectArgs(ChargeEnd, false, Current_Level));
|
||||
ChargeDetect?.Invoke(this, new ChargetDetectArgs(ChargeEnd, false, info.RawLevel));
|
||||
}
|
||||
catch (Exception ex) { RaiseMessage(MessageType.Error, ex.Message); }
|
||||
}
|
||||
@@ -328,47 +528,6 @@ namespace arDev
|
||||
public DateTime chk_timee { get; set; } = new DateTime(1982, 11, 23);
|
||||
public float chk_values { get; set; } = 0f;
|
||||
public float chk_valuee { get; set; } = 0f;
|
||||
|
||||
public float Charge_Amp { get; set; } = 0f;
|
||||
public Int16 Charge_watt
|
||||
{
|
||||
get
|
||||
{
|
||||
return (Int16)((Charge_Amp) * Current_Volt);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 전압
|
||||
/// </summary>
|
||||
public float Current_Volt { get; set; }
|
||||
/// <summary>
|
||||
/// 남은 잔량(%)
|
||||
/// </summary>
|
||||
public float Current_Level { get; set; }
|
||||
public double[] CellVoltage = new double[] { 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
|
||||
public float Current_LevelA { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 남은 전류량
|
||||
/// </summary>
|
||||
public int Current_Amp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// BMS 온도값1
|
||||
/// </summary>
|
||||
public double Current_temp1 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// BMS 온도값2
|
||||
/// </summary>
|
||||
public double Current_temp2 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 총 전류량
|
||||
/// </summary>
|
||||
public int Current_MaxAmp { get; set; }
|
||||
|
||||
public DateTime Current_DataTime = DateTime.Parse("1982-11-23");
|
||||
public DateTime Current_CellTime = DateTime.Parse("1982-11-23");
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
namespace arDev
|
||||
{
|
||||
@@ -16,18 +17,10 @@ namespace arDev
|
||||
}
|
||||
public class BMSInformationEventArgs : EventArgs
|
||||
{
|
||||
public float Volt { get; set; }
|
||||
public int CurAmp { get; set; }
|
||||
public int MaxAmp { get; set; }
|
||||
public float Level { get; set; }
|
||||
public bool Changed { get; set; }
|
||||
public BMSInformationEventArgs(float _volt, int _curamp, int _maxamp, float _level, bool _changed)
|
||||
public BMSBasicInformation Data { get; set; }
|
||||
public BMSInformationEventArgs(BMSBasicInformation info)
|
||||
{
|
||||
this.Volt = _volt;
|
||||
this.CurAmp = _curamp;
|
||||
this.MaxAmp = _maxamp;
|
||||
this.Level = _level;
|
||||
this.Changed = _changed;
|
||||
this.Data = info;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,5 +31,9 @@ namespace arDev
|
||||
{
|
||||
voltage = new double[] { v1, v2, v3, v4, v5, v6, v7, v8 };
|
||||
}
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Join(" ", voltage.Select(t => t.ToString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ namespace Project
|
||||
//콜가능여부도 전송한다
|
||||
if (VAR.BOOL[eVarBool.FLAG_AUTORUN] &&
|
||||
VAR.BOOL[eVarBool.FLAG_CHARGEONM] == false &&
|
||||
PUB.BMS.Current_Level > PUB.setting.ChargeEmergencyLevel &&
|
||||
PUB.BMS.BMSInformation.rsoc > PUB.setting.ChargeEmergencyLevel &&
|
||||
PUB.sm.RunStep != StateMachine.ERunStep.BUFFER_OUT &&
|
||||
VAR.BOOL[eVarBool.WAIT_COVER_DOWN] == false &&
|
||||
VAR.BOOL[eVarBool.WAIT_COVER_UP] == false)
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace Project
|
||||
|
||||
//충전중이라면 최대 충전 시간을 체크한다.
|
||||
var tsChargeRunTime = VAR.TIME.RUN(eVarTime.ChargeStart);
|
||||
if (PUB.BMS.Current_Level >= PUB.setting.ChargeMaxLevel)
|
||||
if (PUB.BMS.BMSInformation.rsoc >= PUB.setting.ChargeMaxLevel)
|
||||
{
|
||||
PUB.AGV.AGVCharge(PUB.setting.ChargerID, false);
|
||||
PUB.sm.ClearRunStep();
|
||||
|
||||
@@ -170,18 +170,13 @@ namespace Project
|
||||
|
||||
}
|
||||
|
||||
private void Bms_BMSDataReceive(object sender, EventArgs e)
|
||||
private void Bms_BMSDataReceive(object sender, arDev.BMSInformationEventArgs e)
|
||||
{
|
||||
|
||||
VAR.TIME[eVarTime.LastRecv_BAT] = DateTime.Now;
|
||||
//PUB.mapctl.Manager.agv.BatteryLevel = PUB.BMS.Current_Level;
|
||||
//PUB.mapctl.Manager.agv.BatteryTemp1 = PUB.BMS.Current_temp1;
|
||||
//PUB.mapctl.Manager.agv.BatteryTemp2 = PUB.BMS.Current_temp2;
|
||||
|
||||
// [Sync] Update VirtualAGV Battery
|
||||
PUB.UpdateAGVBattery(PUB.BMS.Current_Level);
|
||||
PUB.UpdateAGVBattery(e.Data.rsoc);
|
||||
|
||||
if (PUB.BMS.Current_Level <= PUB.setting.ChargeStartLevel)
|
||||
if (e.Data.rsoc <= PUB.setting.ChargeStartLevel)
|
||||
{
|
||||
//배터리 레벨이 기준보다 낮다면 경고를 활성화 한다
|
||||
if (VAR.BOOL[eVarBool.BATTERY_LOW] == false)
|
||||
|
||||
@@ -59,10 +59,11 @@ namespace Project
|
||||
panTopMenu.Enabled == false) panTopMenu.Enabled = true;
|
||||
|
||||
//배터리정보표시
|
||||
lbBat.VLevel = PUB.BMS.Current_Level;
|
||||
lbBat.Volt = PUB.BMS.Current_Volt;
|
||||
lbBat.MaxA = PUB.BMS.Current_MaxAmp;
|
||||
lbBat.CurA = PUB.BMS.Current_Amp;
|
||||
var bmsinfo = PUB.BMS.BMSInformation;
|
||||
lbBat.VLevel = bmsinfo.rsoc;
|
||||
lbBat.Volt = bmsinfo.packVoltage;
|
||||
lbBat.MaxA = bmsinfo.fullCapacity;
|
||||
lbBat.CurA = bmsinfo.remainingCapacity;
|
||||
lbBat.IsOpen = PUB.BMS.IsOpen;
|
||||
|
||||
//쓰레드로인해서 메인에서 진행하게한다. SPS는 메인쓰레드에서 진행 됨
|
||||
@@ -174,8 +175,8 @@ namespace Project
|
||||
var tsIdle = VAR.TIME.RUN(eVarTime.ChargeStart);
|
||||
lbIDLE.ProgressMax = 100;// PUB.setting.ChargeMaxLevel;
|
||||
lbIDLE.ProgressMin = 0;
|
||||
lbIDLE.Text = $"{PUB.BMS.Current_Level:N0}%";
|
||||
lbIDLE.ProgressValue = (float)PUB.BMS.Current_Level;
|
||||
lbIDLE.Text = $"{PUB.BMS.BMSInformation.rsoc}%";
|
||||
lbIDLE.ProgressValue = (float)PUB.BMS.BMSInformation.rsoc;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -184,8 +185,8 @@ namespace Project
|
||||
var tsIdle = VAR.TIME.RUN(eVarTime.ChargeStart);
|
||||
lbIDLE.ProgressMax = PUB.setting.ChargeMaxLevel;
|
||||
lbIDLE.ProgressMin = 0;
|
||||
lbIDLE.Text = $"({PUB.BMS.Current_Level:N0}/{PUB.setting.ChargeMaxLevel})%";
|
||||
lbIDLE.ProgressValue = (float)PUB.BMS.Current_Level;
|
||||
lbIDLE.Text = $"({PUB.BMS.BMSInformation.rsoc}/{PUB.setting.ChargeMaxLevel})%";
|
||||
lbIDLE.ProgressValue = (float)PUB.BMS.BMSInformation.rsoc;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
@@ -380,7 +381,7 @@ namespace Project
|
||||
/// </summary>
|
||||
void Update_BatteryWarnSpeak()
|
||||
{
|
||||
if (PUB.BMS == null || PUB.BMS.Current_Level > 40) return;
|
||||
if (PUB.BMS == null || PUB.BMS.BMSInformation.rsoc > 40) return;
|
||||
|
||||
//가동중이거나 수동모드에서는 메세지 알림한다
|
||||
if (PUB.AGV.system1.agv_run || VAR.BOOL[eVarBool.FLAG_AUTORUN] == false)
|
||||
@@ -605,7 +606,7 @@ namespace Project
|
||||
{
|
||||
//남은 충전시간 계산
|
||||
string msg = string.Empty;
|
||||
if (PUB.BMS.Current_Level < PUB.setting.ChargeEmergencyLevel)
|
||||
if (PUB.BMS.BMSInformation.rsoc < PUB.setting.ChargeEmergencyLevel)
|
||||
{
|
||||
msg = $"충전 진행 중(이동 불가)\n저전압으로 인해 사용이 불가 합니다";
|
||||
}
|
||||
|
||||
@@ -328,7 +328,7 @@ namespace Project
|
||||
var prevDir = selectedAGV.PrevDirection;
|
||||
|
||||
// 고급 경로 계획 사용 (노드 객체 직접 전달)
|
||||
var advancedResult = _advancedPathfinder.FindPath(startNode, targetNode, prevNode, prevDir, currentDirection);
|
||||
var advancedResult = _advancedPathfinder.FindBasicPath(startNode, targetNode, prevNode, prevDir);
|
||||
|
||||
var _simulatorCanvas = PUB._mapCanvas;
|
||||
|
||||
|
||||
229
Cs_HMI/Project/ViewForm/fBms.Designer.cs
generated
229
Cs_HMI/Project/ViewForm/fBms.Designer.cs
generated
@@ -31,8 +31,15 @@
|
||||
this.components = new System.ComponentModel.Container();
|
||||
this.timer1 = new System.Windows.Forms.Timer(this.components);
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||
this.lbcvSt = new System.Windows.Forms.Label();
|
||||
this.panel11 = new System.Windows.Forms.Panel();
|
||||
this.lbtemp2 = new System.Windows.Forms.Label();
|
||||
this.label7 = new System.Windows.Forms.Label();
|
||||
this.panel10 = new System.Windows.Forms.Panel();
|
||||
this.lbTemp1 = new System.Windows.Forms.Label();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.panel9 = new System.Windows.Forms.Panel();
|
||||
this.cv8 = new System.Windows.Forms.Label();
|
||||
this.label16 = new System.Windows.Forms.Label();
|
||||
@@ -61,14 +68,11 @@
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.arLabel1 = new arCtl.arLabel();
|
||||
this.lbinfost = new System.Windows.Forms.Label();
|
||||
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||
this.panel10 = new System.Windows.Forms.Panel();
|
||||
this.lbTemp1 = new System.Windows.Forms.Label();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.panel11 = new System.Windows.Forms.Panel();
|
||||
this.lbtemp2 = new System.Windows.Forms.Label();
|
||||
this.label7 = new System.Windows.Forms.Label();
|
||||
this.lbCycle = new System.Windows.Forms.Label();
|
||||
this.panel1.SuspendLayout();
|
||||
this.groupBox2.SuspendLayout();
|
||||
this.panel11.SuspendLayout();
|
||||
this.panel10.SuspendLayout();
|
||||
this.groupBox1.SuspendLayout();
|
||||
this.panel9.SuspendLayout();
|
||||
this.panel8.SuspendLayout();
|
||||
@@ -78,9 +82,6 @@
|
||||
this.panel4.SuspendLayout();
|
||||
this.panel3.SuspendLayout();
|
||||
this.panel2.SuspendLayout();
|
||||
this.groupBox2.SuspendLayout();
|
||||
this.panel10.SuspendLayout();
|
||||
this.panel11.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// timer1
|
||||
@@ -100,6 +101,100 @@
|
||||
this.panel1.Size = new System.Drawing.Size(187, 577);
|
||||
this.panel1.TabIndex = 0;
|
||||
//
|
||||
// groupBox2
|
||||
//
|
||||
this.groupBox2.Controls.Add(this.lbcvSt);
|
||||
this.groupBox2.Controls.Add(this.panel11);
|
||||
this.groupBox2.Controls.Add(this.panel10);
|
||||
this.groupBox2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.groupBox2.ForeColor = System.Drawing.Color.White;
|
||||
this.groupBox2.Location = new System.Drawing.Point(0, 465);
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.Size = new System.Drawing.Size(187, 112);
|
||||
this.groupBox2.TabIndex = 3;
|
||||
this.groupBox2.TabStop = false;
|
||||
this.groupBox2.Text = "Temp";
|
||||
//
|
||||
// lbcvSt
|
||||
//
|
||||
this.lbcvSt.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.lbcvSt.AutoSize = true;
|
||||
this.lbcvSt.Font = new System.Drawing.Font("굴림", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
|
||||
this.lbcvSt.ForeColor = System.Drawing.Color.White;
|
||||
this.lbcvSt.Location = new System.Drawing.Point(148, 82);
|
||||
this.lbcvSt.Name = "lbcvSt";
|
||||
this.lbcvSt.Size = new System.Drawing.Size(39, 27);
|
||||
this.lbcvSt.TabIndex = 8;
|
||||
this.lbcvSt.Text = "●";
|
||||
//
|
||||
// panel11
|
||||
//
|
||||
this.panel11.Controls.Add(this.lbtemp2);
|
||||
this.panel11.Controls.Add(this.label7);
|
||||
this.panel11.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.panel11.Location = new System.Drawing.Point(3, 57);
|
||||
this.panel11.Name = "panel11";
|
||||
this.panel11.Size = new System.Drawing.Size(181, 40);
|
||||
this.panel11.TabIndex = 10;
|
||||
//
|
||||
// lbtemp2
|
||||
//
|
||||
this.lbtemp2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lbtemp2.Font = new System.Drawing.Font("Tahoma", 21.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lbtemp2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(128)))));
|
||||
this.lbtemp2.Location = new System.Drawing.Point(47, 0);
|
||||
this.lbtemp2.Name = "lbtemp2";
|
||||
this.lbtemp2.Size = new System.Drawing.Size(134, 40);
|
||||
this.lbtemp2.TabIndex = 0;
|
||||
this.lbtemp2.Text = "--";
|
||||
this.lbtemp2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// label7
|
||||
//
|
||||
this.label7.Dock = System.Windows.Forms.DockStyle.Left;
|
||||
this.label7.Font = new System.Drawing.Font("굴림", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
|
||||
this.label7.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
|
||||
this.label7.Location = new System.Drawing.Point(0, 0);
|
||||
this.label7.Name = "label7";
|
||||
this.label7.Size = new System.Drawing.Size(47, 40);
|
||||
this.label7.TabIndex = 0;
|
||||
this.label7.Text = "#2";
|
||||
this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// panel10
|
||||
//
|
||||
this.panel10.Controls.Add(this.lbTemp1);
|
||||
this.panel10.Controls.Add(this.label3);
|
||||
this.panel10.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.panel10.Location = new System.Drawing.Point(3, 17);
|
||||
this.panel10.Name = "panel10";
|
||||
this.panel10.Size = new System.Drawing.Size(181, 40);
|
||||
this.panel10.TabIndex = 9;
|
||||
//
|
||||
// lbTemp1
|
||||
//
|
||||
this.lbTemp1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lbTemp1.Font = new System.Drawing.Font("Tahoma", 21.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lbTemp1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(128)))));
|
||||
this.lbTemp1.Location = new System.Drawing.Point(47, 0);
|
||||
this.lbTemp1.Name = "lbTemp1";
|
||||
this.lbTemp1.Size = new System.Drawing.Size(134, 40);
|
||||
this.lbTemp1.TabIndex = 0;
|
||||
this.lbTemp1.Text = "--";
|
||||
this.lbTemp1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.Dock = System.Windows.Forms.DockStyle.Left;
|
||||
this.label3.Font = new System.Drawing.Font("굴림", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
|
||||
this.label3.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
|
||||
this.label3.Location = new System.Drawing.Point(0, 0);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(47, 40);
|
||||
this.label3.TabIndex = 0;
|
||||
this.label3.Text = "#1";
|
||||
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Controls.Add(this.panel9);
|
||||
@@ -119,18 +214,6 @@
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "Cell voltage";
|
||||
//
|
||||
// lbcvSt
|
||||
//
|
||||
this.lbcvSt.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.lbcvSt.AutoSize = true;
|
||||
this.lbcvSt.Font = new System.Drawing.Font("굴림", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
|
||||
this.lbcvSt.ForeColor = System.Drawing.Color.White;
|
||||
this.lbcvSt.Location = new System.Drawing.Point(148, 82);
|
||||
this.lbcvSt.Name = "lbcvSt";
|
||||
this.lbcvSt.Size = new System.Drawing.Size(39, 27);
|
||||
this.lbcvSt.TabIndex = 8;
|
||||
this.lbcvSt.Text = "●";
|
||||
//
|
||||
// panel9
|
||||
//
|
||||
this.panel9.Controls.Add(this.cv8);
|
||||
@@ -484,93 +567,24 @@
|
||||
this.lbinfost.TabIndex = 2;
|
||||
this.lbinfost.Text = "●";
|
||||
//
|
||||
// groupBox2
|
||||
// lbCycle
|
||||
//
|
||||
this.groupBox2.Controls.Add(this.lbcvSt);
|
||||
this.groupBox2.Controls.Add(this.panel11);
|
||||
this.groupBox2.Controls.Add(this.panel10);
|
||||
this.groupBox2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.groupBox2.ForeColor = System.Drawing.Color.White;
|
||||
this.groupBox2.Location = new System.Drawing.Point(0, 465);
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.Size = new System.Drawing.Size(187, 112);
|
||||
this.groupBox2.TabIndex = 3;
|
||||
this.groupBox2.TabStop = false;
|
||||
this.groupBox2.Text = "Temp";
|
||||
//
|
||||
// panel10
|
||||
//
|
||||
this.panel10.Controls.Add(this.lbTemp1);
|
||||
this.panel10.Controls.Add(this.label3);
|
||||
this.panel10.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.panel10.Location = new System.Drawing.Point(3, 17);
|
||||
this.panel10.Name = "panel10";
|
||||
this.panel10.Size = new System.Drawing.Size(181, 40);
|
||||
this.panel10.TabIndex = 9;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.lbTemp1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lbTemp1.Font = new System.Drawing.Font("Tahoma", 21.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lbTemp1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(128)))));
|
||||
this.lbTemp1.Location = new System.Drawing.Point(47, 0);
|
||||
this.lbTemp1.Name = "label2";
|
||||
this.lbTemp1.Size = new System.Drawing.Size(134, 40);
|
||||
this.lbTemp1.TabIndex = 0;
|
||||
this.lbTemp1.Text = "--";
|
||||
this.lbTemp1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.Dock = System.Windows.Forms.DockStyle.Left;
|
||||
this.label3.Font = new System.Drawing.Font("굴림", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
|
||||
this.label3.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
|
||||
this.label3.Location = new System.Drawing.Point(0, 0);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(47, 40);
|
||||
this.label3.TabIndex = 0;
|
||||
this.label3.Text = "#1";
|
||||
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// panel11
|
||||
//
|
||||
this.panel11.Controls.Add(this.lbtemp2);
|
||||
this.panel11.Controls.Add(this.label7);
|
||||
this.panel11.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.panel11.Location = new System.Drawing.Point(3, 57);
|
||||
this.panel11.Name = "panel11";
|
||||
this.panel11.Size = new System.Drawing.Size(181, 40);
|
||||
this.panel11.TabIndex = 10;
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.lbtemp2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lbtemp2.Font = new System.Drawing.Font("Tahoma", 21.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lbtemp2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(128)))));
|
||||
this.lbtemp2.Location = new System.Drawing.Point(47, 0);
|
||||
this.lbtemp2.Name = "label5";
|
||||
this.lbtemp2.Size = new System.Drawing.Size(134, 40);
|
||||
this.lbtemp2.TabIndex = 0;
|
||||
this.lbtemp2.Text = "--";
|
||||
this.lbtemp2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// label7
|
||||
//
|
||||
this.label7.Dock = System.Windows.Forms.DockStyle.Left;
|
||||
this.label7.Font = new System.Drawing.Font("굴림", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
|
||||
this.label7.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
|
||||
this.label7.Location = new System.Drawing.Point(0, 0);
|
||||
this.label7.Name = "label7";
|
||||
this.label7.Size = new System.Drawing.Size(47, 40);
|
||||
this.label7.TabIndex = 0;
|
||||
this.label7.Text = "#2";
|
||||
this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
this.lbCycle.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.lbCycle.Font = new System.Drawing.Font("Tahoma", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lbCycle.ForeColor = System.Drawing.Color.SkyBlue;
|
||||
this.lbCycle.Location = new System.Drawing.Point(296, 8);
|
||||
this.lbCycle.Name = "lbCycle";
|
||||
this.lbCycle.Size = new System.Drawing.Size(749, 27);
|
||||
this.lbCycle.TabIndex = 3;
|
||||
this.lbCycle.Text = "Cycle(2)";
|
||||
this.lbCycle.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
//
|
||||
// fBms
|
||||
//
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(15)))), ((int)(((byte)(15)))), ((int)(((byte)(15)))));
|
||||
this.ClientSize = new System.Drawing.Size(1056, 583);
|
||||
this.Controls.Add(this.lbCycle);
|
||||
this.Controls.Add(this.lbinfost);
|
||||
this.Controls.Add(this.arLabel1);
|
||||
this.Controls.Add(this.panel1);
|
||||
@@ -581,6 +595,10 @@
|
||||
this.Load += new System.EventHandler(this.fFlag_Load);
|
||||
this.VisibleChanged += new System.EventHandler(this.fAgv_VisibleChanged);
|
||||
this.panel1.ResumeLayout(false);
|
||||
this.groupBox2.ResumeLayout(false);
|
||||
this.groupBox2.PerformLayout();
|
||||
this.panel11.ResumeLayout(false);
|
||||
this.panel10.ResumeLayout(false);
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.panel9.ResumeLayout(false);
|
||||
this.panel8.ResumeLayout(false);
|
||||
@@ -590,10 +608,6 @@
|
||||
this.panel4.ResumeLayout(false);
|
||||
this.panel3.ResumeLayout(false);
|
||||
this.panel2.ResumeLayout(false);
|
||||
this.groupBox2.ResumeLayout(false);
|
||||
this.groupBox2.PerformLayout();
|
||||
this.panel10.ResumeLayout(false);
|
||||
this.panel11.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
@@ -639,5 +653,6 @@
|
||||
private System.Windows.Forms.Panel panel10;
|
||||
private System.Windows.Forms.Label lbTemp1;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Label lbCycle;
|
||||
}
|
||||
}
|
||||
@@ -63,18 +63,26 @@ namespace Project.ViewForm
|
||||
private void timer1_Tick(object sender, EventArgs e)
|
||||
{
|
||||
timer1.Stop();
|
||||
this.arLabel1.Text = PUB.BMS.Current_Level.ToString("N1") + "%";
|
||||
this.arLabel1.Sign = $"{PUB.BMS.Current_Volt}v, {PUB.BMS.Charge_watt}w";// PUB.BMS.Current_Volt.ToString() + "v";
|
||||
this.cv1.Text = PUB.BMS.CellVoltage[0].ToString("N3") + "v";
|
||||
this.cv2.Text = PUB.BMS.CellVoltage[1].ToString("N3") + "v";
|
||||
this.cv3.Text = PUB.BMS.CellVoltage[2].ToString("N3") + "v";
|
||||
this.cv4.Text = PUB.BMS.CellVoltage[3].ToString("N3") + "v";
|
||||
this.cv5.Text = PUB.BMS.CellVoltage[4].ToString("N3") + "v";
|
||||
this.cv6.Text = PUB.BMS.CellVoltage[5].ToString("N3") + "v";
|
||||
this.cv7.Text = PUB.BMS.CellVoltage[6].ToString("N3") + "v";
|
||||
this.cv8.Text = PUB.BMS.CellVoltage[7].ToString("N3") + "v";
|
||||
this.lbTemp1.Text = PUB.BMS.Current_temp1.ToString() + "℃";
|
||||
this.lbtemp2.Text = PUB.BMS.Current_temp2.ToString() + "℃";
|
||||
var data = PUB.BMS.BMSInformation;
|
||||
var volt = PUB.BMS.BMSCellVoltage;
|
||||
if (PUB.BMS.IsOpen == false)
|
||||
this.lbCycle.Text = "통신이 열려있지 않습니다";
|
||||
else if (PUB.BMS.IsValid == false)
|
||||
this.lbCycle.Text = "데이터가 유효하지 않습니다";
|
||||
else
|
||||
this.lbCycle.Text = $"Cell Average:{volt.Average},Delta:{volt.Delta},Cycle({data.cycleCount})";
|
||||
this.arLabel1.Text = $"{data.rsoc}%";
|
||||
this.arLabel1.Sign = $"{data.packVoltage}v, {data.watt}w";// PUB.BMS.Current_Volt.ToString() + "v";
|
||||
this.cv1.Text = volt.Voltage[0].ToString("N3") + "v";
|
||||
this.cv2.Text = volt.Voltage[1].ToString("N3") + "v";
|
||||
this.cv3.Text = volt.Voltage[2].ToString("N3") + "v";
|
||||
this.cv4.Text = volt.Voltage[3].ToString("N3") + "v";
|
||||
this.cv5.Text = volt.Voltage[4].ToString("N3") + "v";
|
||||
this.cv6.Text = volt.Voltage[5].ToString("N3") + "v";
|
||||
this.cv7.Text = volt.Voltage[6].ToString("N3") + "v";
|
||||
this.cv8.Text = volt.Voltage[7].ToString("N3") + "v";
|
||||
this.lbTemp1.Text = data.ntcTemp[0].ToString() + "℃";
|
||||
this.lbtemp2.Text = data.ntcTemp[1].ToString() + "℃";
|
||||
timer1.Start();
|
||||
}
|
||||
|
||||
|
||||
@@ -756,7 +756,7 @@ namespace Project
|
||||
|
||||
private void lbBat_Click(object sender, EventArgs e)
|
||||
{
|
||||
var bat = (int)PUB.BMS.Current_Level;
|
||||
var bat = (int)PUB.BMS.BMSInformation.rsoc;
|
||||
var msg = $"{bat}퍼센트";
|
||||
PUB.Speak(msg, false, false);
|
||||
PUB.counter.CountQA += 1;
|
||||
|
||||
Reference in New Issue
Block a user