Skip to content

Commit a6665b7

Browse files
committed
2 parents 3398b30 + 4e109af commit a6665b7

File tree

10 files changed

+27057
-13
lines changed

10 files changed

+27057
-13
lines changed

ArrowPoint-CANbus-Test/Test-Data/Battery Pack/RawDataLog-20190708-1957-Small Pack

Lines changed: 24733 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
Recv time , Packet num, ID , flags, data , float[1] , float[0] , sender addr
2+
20:25:31.803 , 1 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
3+
20:25:31.904 , 2 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
4+
20:25:32.005 , 3 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
5+
20:25:32.106 , 4 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
6+
20:25:32.207 , 5 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
7+
20:25:32.310 , 6 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
8+
20:25:32.411 , 7 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
9+
20:25:32.511 , 8 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
10+
20:25:32.612 , 9 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
11+
20:25:32.713 , 10 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
12+
20:25:32.814 , 11 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
13+
20:25:32.915 , 12 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
14+
20:25:33.016 , 13 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
15+
20:25:33.117 , 14 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
16+
20:25:33.217 , 15 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
17+
20:25:33.318 , 16 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
18+
20:25:33.419 , 17 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
19+
20:25:33.520 , 18 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
20+
20:25:33.622 , 19 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
21+
20:25:33.723 , 20 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
22+
20:25:33.823 , 21 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
23+
20:25:33.924 , 22 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
24+
20:25:34.026 , 23 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
25+
20:25:34.127 , 24 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
26+
20:25:34.228 , 25 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
27+
20:25:34.328 , 26 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
28+
20:25:34.429 , 27 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
29+
20:25:34.530 , 28 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
30+
20:25:34.631 , 29 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
31+
20:25:34.732 , 30 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
32+
20:25:34.833 , 31 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
33+
20:25:34.935 , 32 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
34+
20:25:35.036 , 33 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
35+
20:25:35.137 , 34 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
36+
20:25:35.238 , 35 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
37+
20:25:35.339 , 36 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
38+
20:25:35.440 , 37 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
39+
20:25:35.541 , 38 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
40+
20:25:35.642 , 39 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
41+
20:25:35.743 , 40 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
42+
20:25:35.845 , 41 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
43+
20:25:35.946 , 42 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
44+
20:25:36.047 , 43 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
45+
20:25:36.149 , 44 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
46+
20:25:36.250 , 45 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
47+
20:25:36.351 , 46 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
48+
20:25:36.452 , 47 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
49+
20:25:36.553 , 48 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
50+
20:25:36.654 , 49 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
51+
20:25:36.755 , 50 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
52+
20:25:36.855 , 51 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
53+
20:25:36.956 , 52 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
54+
20:25:37.057 , 53 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
55+
20:25:37.158 , 54 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
56+
20:25:37.259 , 55 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
57+
20:25:37.360 , 56 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
58+
20:25:37.460 , 57 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
59+
20:25:37.561 , 58 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
60+
20:25:37.662 , 59 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
61+
20:25:37.763 , 60 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
62+
20:25:37.864 , 61 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
63+
20:25:37.965 , 62 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
64+
20:25:38.066 , 63 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
65+
20:25:38.168 , 64 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
66+
20:25:38.269 , 65 , 0x0x500 , , 0x0000000100001002, 1.401298E-45 , 5.742521E-42 , 192.168.1.50
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0"?>
2+
<NetworkDefinition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://kayak.2codeornot2code.org/1.0">
3+
<Document name="kcdexample.dbc" company="foo" date="Tue Aug 18 09:27:40 CEST 2015">Converted with CANBabel (https://github.com/julietkilo/CANBabel)</Document>
4+
<Node id="15" name="ECU_Clima" />
5+
<Node id="25" name="ECU_Test" />
6+
<Bus name="Comfort" baudrate="125000">
7+
<Message id="0x21C" name="Temperature">
8+
<Producer>
9+
<NodeRef id="25" />
10+
</Producer>
11+
<Signal name="InsideTempC" offset="0" length="2">
12+
<Consumer />
13+
<Value type="signed" unit="Cel" />
14+
<LabelSet />
15+
</Signal>
16+
<Signal name="OutsideTempC" offset="4" length="4">
17+
<Consumer />
18+
<Value type="signed" unit="Cel" />
19+
<LabelSet />
20+
</Signal>
21+
</Message>
22+
<Message name="Test2">
23+
<Producer>
24+
<NodeRef id="15" />
25+
</Producer>
26+
</Message>
27+
<Message name="Test3">
28+
<Producer>
29+
<NodeRef id="25" />
30+
</Producer>
31+
</Message>
32+
</Bus>
33+
</NetworkDefinition>

ArrowPoint-CANbus-Tools/ArrowPointCANBusTool.csproj

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@
8282
<Compile Include="Canbus\CanLoopback.cs" />
8383
<Compile Include="Canbus\CanReceivedEventArgs.cs" />
8484
<Compile Include="Canbus\ICanTrafficInterface.cs" />
85+
<Compile Include="Forms\BatteryControllerForm.cs">
86+
<SubType>Form</SubType>
87+
</Compile>
88+
<Compile Include="Forms\BatteryControllerForm.Designer.cs">
89+
<DependentUpon>BatteryControllerForm.cs</DependentUpon>
90+
</Compile>
8591
<Compile Include="Services\ConfigService.cs" />
8692
<Compile Include="Configuration\KCD.designer.cs" />
8793
<Compile Include="Controls\CanTreeTag.cs" />
@@ -215,6 +221,9 @@
215221
<EmbeddedResource Include="Forms\AboutBox.resx">
216222
<DependentUpon>AboutBox.cs</DependentUpon>
217223
</EmbeddedResource>
224+
<EmbeddedResource Include="Forms\BatteryControllerForm.resx">
225+
<DependentUpon>BatteryControllerForm.cs</DependentUpon>
226+
</EmbeddedResource>
218227
<EmbeddedResource Include="Forms\BatteryViewerForm.resx">
219228
<DependentUpon>BatteryViewerForm.cs</DependentUpon>
220229
</EmbeddedResource>

ArrowPoint-CANbus-Tools/Canbus/CanPacket.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,15 @@ public uint CanId {
161161
public uint CanIdBase10 {
162162
get
163163
{
164-
string trimmedValue = MyExtensions.Trim0x(CanIdAsHex);
165-
return uint.Parse(trimmedValue, System.Globalization.NumberStyles.HexNumber);
164+
try
165+
{
166+
string trimmedValue = MyExtensions.Trim0x(CanIdAsHex);
167+
return uint.Parse(trimmedValue, System.Globalization.NumberStyles.HexNumber);
168+
}
169+
catch
170+
{
171+
return 0;
172+
}
166173
}
167174

168175
set

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

Lines changed: 66 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
using ArrowPointCANBusTool.Services;
2+
using System;
3+
using System.Collections.Generic;
4+
using System.ComponentModel;
5+
using System.Data;
6+
using System.Drawing;
7+
using System.Linq;
8+
using System.Text;
9+
using System.Threading.Tasks;
10+
using System.Windows.Forms;
11+
12+
namespace ArrowPointCANBusTool.Forms
13+
{
14+
public partial class BatteryControllerForm : Form
15+
{
16+
17+
private BatteryService batteryService;
18+
private Timer timer;
19+
20+
public BatteryControllerForm()
21+
{
22+
InitializeComponent();
23+
24+
batteryService = new BatteryService(true);
25+
}
26+
27+
private void ContactorsButton_Click(object sender, EventArgs e)
28+
{
29+
if (batteryService.IsContactorsEngaged)
30+
{
31+
batteryService.DisengageContactors();
32+
}
33+
else
34+
{
35+
batteryService.DisengageContactors();
36+
}
37+
38+
UpdateButtonText();
39+
}
40+
41+
private void UpdateButtonText()
42+
{
43+
if (batteryService.IsContactorsEngaged)
44+
{
45+
ContactorsButton.Text = "Disengage Contactors";
46+
}
47+
else
48+
{
49+
ContactorsButton.Text = "Engage Contactors";
50+
}
51+
}
52+
53+
54+
private void TimerTick(object sender, EventArgs e)
55+
{
56+
UpdateButtonText();
57+
}
58+
59+
private void BatteryControllerForm_Load(object sender, EventArgs e)
60+
{
61+
timer = new Timer
62+
{
63+
Interval = (100)
64+
};
65+
timer.Tick += new EventHandler(TimerTick);
66+
timer.Start();
67+
}
68+
69+
}
70+
}

0 commit comments

Comments
 (0)