Skip to content

Commit eb9901b

Browse files
committed
Fixes to resolve battery issues and issues with send can form
1 parent 4607ae9 commit eb9901b

File tree

11 files changed

+63
-54
lines changed

11 files changed

+63
-54
lines changed

ArrowPoint-CANbus-Tools/Canbus/CanReceivingComponent.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public void TestCanPacketReceived(CanPacket canPacket)
131131
CanPacketReceivedInternal(new CanReceivedEventArgs(canPacket));
132132
}
133133

134-
public void CanPacketReceived(CanPacket canPacket) { }
134+
public abstract void CanPacketReceived(CanPacket canPacket);
135135

136136
public Boolean IdMatch(string HexId, int canOffset)
137137
{

ArrowPoint-CANbus-Tools/Forms/BatteryViewerForm.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -193,12 +193,6 @@ private void FormatCell(DataGridViewCell cell, int cmuNo, int cellNo)
193193
Font = new Font(CMUdataGridView.Font, FontStyle.Italic)
194194
};
195195

196-
if (cmuNo + 1 == batteryService.BatteryData.GetBMU(0).CMUNumberMinCell && cellNo == batteryService.BatteryData.GetBMU(0).CellNumberMinCell)
197-
cell.Style.ApplyStyle(boldStyle);
198-
199-
if (cmuNo + 1 == batteryService.BatteryData.GetBMU(0).CMUNumberMaxCell && cellNo == batteryService.BatteryData.GetBMU(0).CellNumberMaxCell)
200-
cell.Style.ApplyStyle(boldStyle);
201-
202196
if (cell != null && cell.Value != null)
203197
{
204198
string cellTxtValue = cell.Value.ToString();
@@ -211,6 +205,13 @@ private void FormatCell(DataGridViewCell cell, int cmuNo, int cellNo)
211205
if (cellValue > activeBMU.BalanceVoltageThresholdRising) cell.Style.ApplyStyle(italicStyle);
212206
}
213207
}
208+
209+
if (cmuNo + 1 == batteryService.BatteryData.GetBMU(0).CMUNumberMinCell && cellNo == batteryService.BatteryData.GetBMU(0).CellNumberMinCell)
210+
cell.Style.Font = new Font(cell.Style.Font, FontStyle.Bold);
211+
212+
if (cmuNo + 1 == batteryService.BatteryData.GetBMU(0).CMUNumberMaxCell && cellNo == batteryService.BatteryData.GetBMU(0).CellNumberMaxCell)
213+
cell.Style.Font = new Font(cell.Style.Font, FontStyle.Bold);
214+
214215
}
215216

216217
}

ArrowPoint-CANbus-Tools/Forms/ChargerControlForm.cs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ private void StartCharge_Click(object sender, EventArgs e)
5555

5656
}
5757

58-
UpdateStartStopButton();
58+
UpdateStartStopDetails();
5959
}
6060

6161
private void ChargerControlForm_Load(object sender, EventArgs e)
@@ -78,15 +78,18 @@ private void ChargerControlForm_FormClosing(object sender, FormClosingEventArgs
7878
chargeService.BatteryService.ShutdownService();
7979
}
8080

81-
private void UpdateStartStopButton()
81+
private void UpdateStartStopDetails()
8282
{
8383
if (chargeService.IsCharging)
8484
{
8585
startCharge.Text = "Stop Charge";
8686
maxSocketCurrent.Enabled = false;
8787
}
8888
else
89-
{
89+
{
90+
ActualVoltageTxt.Text = "";
91+
ActualCurrentTxt.Text = "";
92+
9093
startCharge.Text = "Start Charge";
9194
maxSocketCurrent.Enabled = true;
9295
}
@@ -126,7 +129,7 @@ private void TimerTick(object sender, EventArgs e)
126129
dischargerStripStatusLabel.BackColor = CanReceivingComponent.GetStatusColour(CanReceivingComponent.STATE_NA);
127130
chargerStatusLabel.ToolTipText = CanReceivingComponent.STATE_NA_TEXT;
128131

129-
UpdateStartStopButton();
132+
UpdateStartStopDetails();
130133
}
131134

132135
private void MonitoringDataReceived(ChargeDataReceivedEventArgs e)
@@ -206,7 +209,8 @@ private void RequestedChargeVoltage_ValueChanged(object sender, EventArgs e)
206209

207210
private void ClearData_Click(object sender, EventArgs e)
208211
{
209-
monitoringService.ClearChargeData();
212+
monitoringService.ClearChargeData();
213+
ChargeChart.DataBind();
210214
}
211215

212216
private void SaveData_Click(object sender, EventArgs e)

ArrowPoint-CANbus-Tools/Forms/ChargerControlForm.designer.cs

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ArrowPoint-CANbus-Tools/Forms/SendPacketForm.Designer.cs

Lines changed: 22 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ArrowPoint-CANbus-Tools/Forms/SendPacketForm.cs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -161,72 +161,72 @@ private void CbRtr_MouseClick(object sender, MouseEventArgs e)
161161

162162
private void TbByte0_Leave(object sender, EventArgs e)
163163
{
164-
UpdateByte(0, this.tbByte7.Text);
164+
UpdateByte(0, this.tbByte0.Text);
165165
}
166166

167167
private void TbByte1_Leave(object sender, EventArgs e)
168168
{
169-
UpdateByte(1, this.tbByte6.Text);
169+
UpdateByte(1, this.tbByte1.Text);
170170
}
171171

172172
private void TbByte2_Leave(object sender, EventArgs e)
173173
{
174-
UpdateByte(2, this.tbByte5.Text);
174+
UpdateByte(2, this.tbByte2.Text);
175175
}
176176

177177
private void TbByte3_Leave(object sender, EventArgs e)
178178
{
179-
UpdateByte(3, this.tbByte4.Text);
179+
UpdateByte(3, this.tbByte3.Text);
180180
}
181181

182182
private void TbByte4_Leave(object sender, EventArgs e)
183183
{
184-
UpdateByte(4, this.tbByte3.Text);
184+
UpdateByte(4, this.tbByte4.Text);
185185
}
186186

187187
private void TbByte5_Leave(object sender, EventArgs e)
188188
{
189-
UpdateByte(5, this.tbByte2.Text);
189+
UpdateByte(5, this.tbByte5.Text);
190190
}
191191

192192
private void TbByte6_Leave(object sender, EventArgs e)
193193
{
194-
UpdateByte(6, this.tbByte1.Text);
194+
UpdateByte(6, this.tbByte6.Text);
195195
}
196196

197197
private void TbByte7_Leave(object sender, EventArgs e)
198198
{
199-
UpdateByte(7, this.tbByte0.Text);
199+
UpdateByte(7, this.tbByte7.Text);
200200
}
201201

202202
private void TbInt0_Leave(object sender, EventArgs e)
203203
{
204-
this.UpdateInt(0, this.tbInt3.Text);
204+
this.UpdateInt(0, this.tbInt0.Text);
205205
}
206206

207207
private void TbInt1_Leave(object sender, EventArgs e)
208208
{
209-
this.UpdateInt(1, this.tbInt2.Text);
209+
this.UpdateInt(1, this.tbInt1.Text);
210210
}
211211

212212
private void TbInt2_Leave(object sender, EventArgs e)
213213
{
214-
this.UpdateInt(2, this.tbInt1.Text);
214+
this.UpdateInt(2, this.tbInt2.Text);
215215
}
216216

217217
private void TbInt3_Leave(object sender, EventArgs e)
218218
{
219-
this.UpdateInt(3, this.tbInt0.Text);
219+
this.UpdateInt(3, this.tbInt3.Text);
220220
}
221221

222222
private void TbFloat0_Leave(object sender, EventArgs e)
223223
{
224-
this.UpdateFloat(0, this.tbFloat1.Text);
224+
this.UpdateFloat(0, this.tbFloat0.Text);
225225
}
226226

227227
private void TbFloat1_Leave(object sender, EventArgs e)
228228
{
229-
this.UpdateFloat(1, this.tbFloat0.Text);
229+
this.UpdateFloat(1, this.tbFloat1.Text);
230230
}
231231

232232
private void TimerTick(object sender, EventArgs e)

0 commit comments

Comments
 (0)