Skip to content

Commit 1e6e37b

Browse files
committed
Added Wiring Diagrams(still need BTS7960B), Fixed Long startup time
1 parent 3ba3c4e commit 1e6e37b

11 files changed

+1228
-15
lines changed

BaseStationInstaller.csproj

+13-1
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,19 @@
209209
<Resource Include="dcc-ex-installer.ico" />
210210
</ItemGroup>
211211
<ItemGroup>
212-
<EmbeddedResource Include="Resources\dcc-ex-logo.png" />
212+
<Resource Include="Resources\dcc-ex-logo.png" />
213+
</ItemGroup>
214+
<ItemGroup>
215+
<Resource Include="Resources\mega-arduino.png" />
216+
</ItemGroup>
217+
<ItemGroup>
218+
<Resource Include="Resources\mega-pololu.png" />
219+
</ItemGroup>
220+
<ItemGroup>
221+
<Resource Include="Resources\uno-arduino.png" />
222+
</ItemGroup>
223+
<ItemGroup>
224+
<Resource Include="Resources\uno-pololu.png" />
213225
</ItemGroup>
214226
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
215227
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">

Models/BaseStationSettings.cs

+44-8
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,10 @@ public static class BaseStationSettings
4343
},
4444
SupportedMotorShields = new List<MotorShield>()
4545
{
46-
new MotorShield("Arduino Motor Shield"),
47-
new MotorShield("Pololu MC33926 Motor Shield"),
48-
new MotorShield("BTS7960B Motor Shield"),
49-
},
50-
WiringDiagram = "pack://application:,,,/Resources/dcc-ex-logo.png"
46+
new MotorShield("Arduino Motor Shield", MotorShieldType.Arduino),
47+
new MotorShield("Pololu MC33926 Motor Shield", MotorShieldType.Pololu),
48+
new MotorShield("BTS7960B Motor Shield", MotorShieldType.BTS7960B),
49+
}
5150
}
5251
},
5352
{
@@ -67,12 +66,49 @@ public static class BaseStationSettings
6766
},
6867
SupportedMotorShields = new List<MotorShield>()
6968
{
70-
new MotorShield("Arduino Motor Shield"),
71-
new MotorShield("Pololu MC33926 Motor Shield"),
69+
new MotorShield("Arduino Motor Shield", MotorShieldType.Arduino),
70+
new MotorShield("Pololu MC33926 Motor Shield", MotorShieldType.Pololu),
7271
},
73-
WiringDiagram = "pack://application:,,,/Resources/dcc_ex_logo.png"
7472
}
7573
}
7674
};
75+
76+
77+
public static string GetWiringDiagram(ArduinoModel model, MotorShieldType type)
78+
{
79+
string wiringDiagram = "pack://application:,,,/Resources/dcc-ex-logo.png";
80+
switch (model)
81+
{
82+
case ArduinoModel.Mega2560:
83+
switch (type)
84+
{
85+
case MotorShieldType.Arduino:
86+
wiringDiagram = "pack://application:,,,/Resources/mega-arduino.png";
87+
break;
88+
case MotorShieldType.Pololu:
89+
wiringDiagram = "pack://application:,,,/Resources/mega-pololu.png";
90+
break;
91+
case MotorShieldType.BTS7960B:
92+
wiringDiagram = "pack://application:,,,/Resources/dcc-ex-logo.png";
93+
break;
94+
}
95+
break;
96+
case ArduinoModel.UnoR3:
97+
switch (type)
98+
{
99+
case MotorShieldType.Arduino:
100+
wiringDiagram = "pack://application:,,,/Resources/uno-arduino.png";
101+
break;
102+
case MotorShieldType.Pololu:
103+
wiringDiagram = "pack://application:,,,/Resources/uno-pololu.png";
104+
break;
105+
case MotorShieldType.BTS7960B:
106+
wiringDiagram = "pack://application:,,,/Resources/dcc-ex-logo.png";
107+
break;
108+
}
109+
break;
110+
}
111+
return wiringDiagram;
112+
}
77113
}
78114
}

Models/MotorShield.cs

+9-1
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,20 @@
66

77
namespace BaseStationInstaller.Models
88
{
9+
public enum MotorShieldType
10+
{
11+
Arduino,
12+
Pololu,
13+
BTS7960B
14+
}
915
public class MotorShield
1016
{
11-
public MotorShield(string name)
17+
public MotorShield(string name, MotorShieldType type)
1218
{
1319
Name = name;
20+
ShieldType = type;
1421
}
1522
public string Name { get; set; }
23+
public MotorShieldType ShieldType { get; set; }
1624
}
1725
}

Properties/Resources.Designer.cs

+40
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)