From 9274727fa956e555b001afc99734d33afd1761e8 Mon Sep 17 00:00:00 2001 From: backuppc Date: Thu, 18 Dec 2025 10:32:20 +0900 Subject: [PATCH] .. --- Cs_HMI/Project/Device/BMS.cs | 17 ++++++++++++++++- Cs_HMI/Project/ViewForm/fBms.cs | 2 +- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Cs_HMI/Project/Device/BMS.cs b/Cs_HMI/Project/Device/BMS.cs index f7092c5..d46a276 100644 --- a/Cs_HMI/Project/Device/BMS.cs +++ b/Cs_HMI/Project/Device/BMS.cs @@ -106,7 +106,7 @@ namespace arDev else { var rxstr = string.Join(" ", data.Select(t => t.ToString("X2"))); - RaiseMessage(MessageType.Recv, $"Querh:{QueryIndex},Data:{rxstr}" ); + RaiseMessage(MessageType.Recv, $"Querh:{QueryIndex},Data:{rxstr}"); } if (QueryIndex == 0) @@ -179,6 +179,13 @@ namespace arDev batH = (UInt16)(batH | batL); Current_Volt = (float)(batH / 100.0); + //충방전전류 + //batH = (UInt16)LastReceiveBuffer[6]; + //batL = (UInt16)LastReceiveBuffer[7]; + //batH = (UInt16)(batH << 8); + //batH = (UInt16)(batH | batL); + //Charge_Amp = (float)(batH / 100.0); + //잔량확인 batH = (UInt16)LastReceiveBuffer[8]; batL = (UInt16)LastReceiveBuffer[9]; @@ -325,6 +332,14 @@ namespace arDev 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 / 100.0) * Current_Volt); + } + } /// /// 전압 /// diff --git a/Cs_HMI/Project/ViewForm/fBms.cs b/Cs_HMI/Project/ViewForm/fBms.cs index afea04f..d952b80 100644 --- a/Cs_HMI/Project/ViewForm/fBms.cs +++ b/Cs_HMI/Project/ViewForm/fBms.cs @@ -64,7 +64,7 @@ namespace Project.ViewForm { timer1.Stop(); this.arLabel1.Text = PUB.BMS.Current_Level.ToString("N1") + "%"; - this.arLabel1.Sign = PUB.BMS.Current_Volt.ToString() + "v"; + this.arLabel1.Sign = $"{PUB.BMS.Current_Volt}v, {PUB.BMS.Charge_watt}w, {PUB.BMS.Charge_Amp}";// 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";