Skip to content

Commit

Permalink
Merge pull request #85 from huskyroboticsteam/BaseStationRefactor
Browse files Browse the repository at this point in the history
Consolidated BaseStation projects and organized UserInterface project
  • Loading branch information
Obbay2 authored Oct 20, 2018
2 parents 46d7003 + 89cd3b7 commit d60422b
Show file tree
Hide file tree
Showing 35 changed files with 430 additions and 124 deletions.
44 changes: 15 additions & 29 deletions BaseStation/BaseStation.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Utilities", "Utilities\Util
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UserInterface", "MainWindow\UserInterface.csproj", "{722B3498-9988-4667-B02C-C9D15D288657}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BaseServer", "BaseServer\BaseServer.csproj", "{5FCA414A-CF38-44CB-888D-95D151A5C662}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BaseStation", "BaseStation\BaseStation.csproj", "{717939F0-9BDC-4D66-99B5-AE34D586488E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cotroller Client Test", "Cotroller Client Test\Cotroller Client Test.csproj", "{E1987E62-47E6-426E-BC25-0C551AEC4CB2}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EntryPoint", "BaseStation\EntryPoint.csproj", "{717939F0-9BDC-4D66-99B5-AE34D586488E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SensorDiagnosticsServer", "SensorDiagnostics\SensorDiagnosticsServer\SensorDiagnosticsServer.csproj", "{43D3828E-57A1-47A5-B7F6-3BCA1B3C2BC3}"
EndProject
Expand All @@ -21,6 +17,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SensorRealTimeGraph", "Sens
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PTZCamera", "PTZCamera\PTZCamera.csproj", "{0506B166-5028-4C08-B98E-3C3B1F1E75DE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Server", "Server\Server.csproj", "{D85C3799-A5D9-4993-8356-030483406E22}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -55,18 +53,6 @@ Global
{722B3498-9988-4667-B02C-C9D15D288657}.Release|x64.Build.0 = Release|x64
{722B3498-9988-4667-B02C-C9D15D288657}.Release|x86.ActiveCfg = Release|x86
{722B3498-9988-4667-B02C-C9D15D288657}.Release|x86.Build.0 = Release|x86
{5FCA414A-CF38-44CB-888D-95D151A5C662}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5FCA414A-CF38-44CB-888D-95D151A5C662}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5FCA414A-CF38-44CB-888D-95D151A5C662}.Debug|x64.ActiveCfg = Debug|Any CPU
{5FCA414A-CF38-44CB-888D-95D151A5C662}.Debug|x64.Build.0 = Debug|Any CPU
{5FCA414A-CF38-44CB-888D-95D151A5C662}.Debug|x86.ActiveCfg = Debug|Any CPU
{5FCA414A-CF38-44CB-888D-95D151A5C662}.Debug|x86.Build.0 = Debug|Any CPU
{5FCA414A-CF38-44CB-888D-95D151A5C662}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5FCA414A-CF38-44CB-888D-95D151A5C662}.Release|Any CPU.Build.0 = Release|Any CPU
{5FCA414A-CF38-44CB-888D-95D151A5C662}.Release|x64.ActiveCfg = Release|Any CPU
{5FCA414A-CF38-44CB-888D-95D151A5C662}.Release|x64.Build.0 = Release|Any CPU
{5FCA414A-CF38-44CB-888D-95D151A5C662}.Release|x86.ActiveCfg = Release|Any CPU
{5FCA414A-CF38-44CB-888D-95D151A5C662}.Release|x86.Build.0 = Release|Any CPU
{717939F0-9BDC-4D66-99B5-AE34D586488E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{717939F0-9BDC-4D66-99B5-AE34D586488E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{717939F0-9BDC-4D66-99B5-AE34D586488E}.Debug|x64.ActiveCfg = Debug|Any CPU
Expand All @@ -79,18 +65,6 @@ Global
{717939F0-9BDC-4D66-99B5-AE34D586488E}.Release|x64.Build.0 = Release|Any CPU
{717939F0-9BDC-4D66-99B5-AE34D586488E}.Release|x86.ActiveCfg = Release|Any CPU
{717939F0-9BDC-4D66-99B5-AE34D586488E}.Release|x86.Build.0 = Release|Any CPU
{E1987E62-47E6-426E-BC25-0C551AEC4CB2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E1987E62-47E6-426E-BC25-0C551AEC4CB2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E1987E62-47E6-426E-BC25-0C551AEC4CB2}.Debug|x64.ActiveCfg = Debug|Any CPU
{E1987E62-47E6-426E-BC25-0C551AEC4CB2}.Debug|x64.Build.0 = Debug|Any CPU
{E1987E62-47E6-426E-BC25-0C551AEC4CB2}.Debug|x86.ActiveCfg = Debug|Any CPU
{E1987E62-47E6-426E-BC25-0C551AEC4CB2}.Debug|x86.Build.0 = Debug|Any CPU
{E1987E62-47E6-426E-BC25-0C551AEC4CB2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E1987E62-47E6-426E-BC25-0C551AEC4CB2}.Release|Any CPU.Build.0 = Release|Any CPU
{E1987E62-47E6-426E-BC25-0C551AEC4CB2}.Release|x64.ActiveCfg = Release|Any CPU
{E1987E62-47E6-426E-BC25-0C551AEC4CB2}.Release|x64.Build.0 = Release|Any CPU
{E1987E62-47E6-426E-BC25-0C551AEC4CB2}.Release|x86.ActiveCfg = Release|Any CPU
{E1987E62-47E6-426E-BC25-0C551AEC4CB2}.Release|x86.Build.0 = Release|Any CPU
{43D3828E-57A1-47A5-B7F6-3BCA1B3C2BC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{43D3828E-57A1-47A5-B7F6-3BCA1B3C2BC3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{43D3828E-57A1-47A5-B7F6-3BCA1B3C2BC3}.Debug|x64.ActiveCfg = Debug|Any CPU
Expand Down Expand Up @@ -139,6 +113,18 @@ Global
{0506B166-5028-4C08-B98E-3C3B1F1E75DE}.Release|x64.Build.0 = Release|Any CPU
{0506B166-5028-4C08-B98E-3C3B1F1E75DE}.Release|x86.ActiveCfg = Release|Any CPU
{0506B166-5028-4C08-B98E-3C3B1F1E75DE}.Release|x86.Build.0 = Release|Any CPU
{D85C3799-A5D9-4993-8356-030483406E22}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D85C3799-A5D9-4993-8356-030483406E22}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D85C3799-A5D9-4993-8356-030483406E22}.Debug|x64.ActiveCfg = Debug|Any CPU
{D85C3799-A5D9-4993-8356-030483406E22}.Debug|x64.Build.0 = Debug|Any CPU
{D85C3799-A5D9-4993-8356-030483406E22}.Debug|x86.ActiveCfg = Debug|Any CPU
{D85C3799-A5D9-4993-8356-030483406E22}.Debug|x86.Build.0 = Debug|Any CPU
{D85C3799-A5D9-4993-8356-030483406E22}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D85C3799-A5D9-4993-8356-030483406E22}.Release|Any CPU.Build.0 = Release|Any CPU
{D85C3799-A5D9-4993-8356-030483406E22}.Release|x64.ActiveCfg = Release|Any CPU
{D85C3799-A5D9-4993-8356-030483406E22}.Release|x64.Build.0 = Release|Any CPU
{D85C3799-A5D9-4993-8356-030483406E22}.Release|x86.ActiveCfg = Release|Any CPU
{D85C3799-A5D9-4993-8356-030483406E22}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,9 @@
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Compile Include="GamepadFactory.cs" />
<Compile Include="StartBaseStation.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BaseServer\BaseServer.csproj">
<Project>{5fca414a-cf38-44cb-888d-95d151a5c662}</Project>
<Name>BaseServer</Name>
</ProjectReference>
<ProjectReference Include="..\MainWindow\UserInterface.csproj">
<Project>{722b3498-9988-4667-b02c-c9d15d288657}</Project>
<Name>UserInterface</Name>
Expand All @@ -80,6 +75,10 @@
<Project>{0506b166-5028-4c08-b98e-3c3b1f1e75de}</Project>
<Name>PTZCamera</Name>
</ProjectReference>
<ProjectReference Include="..\Server\Server.csproj">
<Project>{d85c3799-a5d9-4993-8356-030483406e22}</Project>
<Name>Server</Name>
</ProjectReference>
<ProjectReference Include="..\Utilities\Utilities.csproj">
<Project>{a6dfdff4-614f-4225-8f75-c81c6765f23e}</Project>
<Name>Utilities</Name>
Expand All @@ -90,15 +89,6 @@
<HintPath>..\packages\HuskyRobotics.Scarlet.0.5.1\lib\BBBCSIO.dll</HintPath>
</Reference>
<Reference Include="PresentationFramework" />
<Reference Include="Scarlet, Version=0.5.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\HuskyRobotics.Scarlet.0.5.1\lib\Scarlet.dll</HintPath>
</Reference>
<Reference Include="SharpDX, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1, processorArchitecture=MSIL">
<HintPath>..\packages\SharpDX.4.2.0\lib\net45\SharpDX.dll</HintPath>
</Reference>
<Reference Include="SharpDX.XInput, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1, processorArchitecture=MSIL">
<HintPath>..\packages\SharpDX.XInput.4.2.0\lib\net45\SharpDX.XInput.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Half, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\HuskyRobotics.Scarlet.0.5.1\lib\System.Half.dll</HintPath>
Expand Down
37 changes: 0 additions & 37 deletions BaseStation/BaseStation/GamepadFactory.cs

This file was deleted.

11 changes: 4 additions & 7 deletions BaseStation/BaseStation/StartBaseStation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ namespace HuskyRobotics.BaseStation.Start
{
public static class StartBaseStation
{
private static readonly SharpDX.XInput.Controller DriveController = GamepadFactory.GetDriveGamePad();
private static readonly SharpDX.XInput.Controller ArmController = GamepadFactory.GetArmGamepad();

/// <summary>
/// The entry point of the base station system. Starts the base station user interface
/// and communication with the rover.
Expand All @@ -22,7 +19,7 @@ public static class StartBaseStation
[STAThread]
public static void Main(String[] args)
{
BaseServer.Setup();
PacketSender.Setup();
CameraControl.Setup();
new Thread(StartUpdates).Start();
Application app = new Application();
Expand All @@ -32,8 +29,8 @@ public static void Main(String[] args)

private static void Update()
{
BaseServer.Update(DriveController, ArmController);
CameraControl.Update(DriveController);
PacketSender.Update();
CameraControl.Update();
Thread.Sleep(100);
}

Expand All @@ -50,7 +47,7 @@ public static void StartUpdates()
public static void StopUpdates()
{
exit = true;
BaseServer.Shutdown();
PacketSender.Shutdown();
}
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public partial class BeaconFinder : UserControl

public BeaconFinder()
{
BaseServer.RFUpdate += UpdateVoltage;
PacketSender.RFUpdate += UpdateVoltage;
InitializeComponent();
}

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public partial class CompassHeading : UserControl
public CompassHeading()
{
InitializeComponent();
BaseServer.MagnetometerUpdate += UpdateHeading;
PacketSender.MagnetometerUpdate += UpdateHeading;
}

public void UpdateHeading(Object sender, (float, float, float) data)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public ObservableCollection<Waypoint> Waypoints
public MapDisplay()
{
InitializeComponent();
BaseServer.GPSUpdate += UpdateRoverPosition;
PacketSender.GPSUpdate += UpdateRoverPosition;
_roverIconBitmap = LoadImageFromRelativeFile("Icons/RealRoverIcon.png");
_waypointBitmap = LoadImageFromRelativeFile("Icons/waypoint.png");
RoverIcon = new Image { Source = _roverIconBitmap };
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
50 changes: 25 additions & 25 deletions BaseStation/MainWindow/UserInterface.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -126,38 +126,38 @@
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<Compile Include="ArmSideView.cs" />
<Compile Include="ArmTopView.cs" />
<Compile Include="ArmView.xaml.cs">
<Compile Include="Arm\ArmSideView.cs" />
<Compile Include="Arm\ArmTopView.cs" />
<Compile Include="Elements\ArmView.xaml.cs">
<DependentUpon>ArmView.xaml</DependentUpon>
</Compile>
<Compile Include="CompassHeading.xaml.cs">
<Compile Include="Elements\CompassHeading.xaml.cs">
<DependentUpon>CompassHeading.xaml</DependentUpon>
</Compile>
<Compile Include="ConsoleView.xaml.cs">
<Compile Include="Elements\ConsoleView.xaml.cs">
<DependentUpon>ConsoleView.xaml</DependentUpon>
</Compile>
<Compile Include="GamePadView.xaml.cs">
<Compile Include="Elements\GamePadView.xaml.cs">
<DependentUpon>GamePadView.xaml</DependentUpon>
</Compile>
<Compile Include="MapConfiguration.cs" />
<Compile Include="MapDisplay.xaml.cs">
<Compile Include="Map\MapConfiguration.cs" />
<Compile Include="Elements\MapDisplay.xaml.cs">
<DependentUpon>MapDisplay.xaml</DependentUpon>
</Compile>
<Compile Include="MapTileDownloadManager.cs" />
<Compile Include="Map\MapTileDownloadManager.cs" />
<Compile Include="Settings\RemoteDevice.cs" />
<Compile Include="Settings\Settings.cs" />
<Compile Include="Settings\SettingsFile.cs" />
<Compile Include="Settings\SettingsPanel.xaml.cs">
<DependentUpon>SettingsPanel.xaml</DependentUpon>
</Compile>
<Compile Include="Settings\VideoDevice.cs" />
<Compile Include="BeaconFinder.xaml.cs">
<Compile Include="Elements\BeaconFinder.xaml.cs">
<DependentUpon>BeaconFinder.xaml</DependentUpon>
</Compile>
<Compile Include="Utilities\MockObservableMap.cs" />
<Compile Include="Utilities\ProportionToDegree.cs" />
<Compile Include="RoverView.xaml.cs">
<Compile Include="Elements\RoverView.xaml.cs">
<DependentUpon>RoverView.xaml</DependentUpon>
</Compile>
<Compile Include="VideoStreamer\RTSPVideoWindow.xaml.cs">
Expand All @@ -168,45 +168,45 @@
<DependentUpon>RTPVideoWindow.xaml</DependentUpon>
</Compile>
<Compile Include="VideoStreamer\VideoWindow.cs" />
<Compile Include="Waypoint.cs" />
<Compile Include="WaypointsFile.cs" />
<Page Include="ArmView.xaml">
<Compile Include="Map\Waypoint.cs" />
<Compile Include="Map\WaypointsFile.cs" />
<Page Include="Elements\ArmView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="CompassHeading.xaml">
<Page Include="Elements\CompassHeading.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="ConsoleView.xaml">
<Page Include="Elements\ConsoleView.xaml">
<SubType>Designer</SubType>
<Generator>XamlIntelliSenseFileGenerator</Generator>
</Page>
<Page Include="GamePadView.xaml">
<Page Include="Elements\GamePadView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="MainWindow.xaml">
<Page Include="Elements\MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="MainWindow.xaml.cs">
<Compile Include="Elements\MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Page Include="MapDisplay.xaml">
<Page Include="Elements\MapDisplay.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="RoverView.xaml">
<Page Include="Elements\RoverView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Settings\SettingsPanel.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="BeaconFinder.xaml">
<Page Include="Elements\BeaconFinder.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
Expand Down Expand Up @@ -247,9 +247,9 @@
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BaseServer\BaseServer.csproj">
<Project>{5fca414a-cf38-44cb-888d-95d151a5c662}</Project>
<Name>BaseServer</Name>
<ProjectReference Include="..\Server\Server.csproj">
<Project>{d85c3799-a5d9-4993-8356-030483406e22}</Project>
<Name>Server</Name>
</ProjectReference>
<ProjectReference Include="..\Utilities\Utilities.csproj">
<Project>{A6DFDFF4-614F-4225-8F75-C81C6765F23E}</Project>
Expand Down
12 changes: 3 additions & 9 deletions BaseStation/PTZCamera/CameraControl.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
using Scarlet.Utilities;
using SharpDX.XInput;
using SharpDX.XInput;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Threading;
using System.Threading.Tasks;


namespace HuskyRobotics.BaseStation
Expand All @@ -22,8 +15,9 @@ public static class CameraControl

public static void Setup() => cam = new PTZCamera("192.168.0.42", "admin", "1234", new HttpClient());

public static void Update(Controller controller)
public static void Update()
{
Controller controller = GamepadFactory.DriveGamepad;
if(controller.IsConnected)
{
State state = controller.GetState();
Expand Down
6 changes: 6 additions & 0 deletions BaseStation/PTZCamera/PTZCamera.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,11 @@
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Utilities\Utilities.csproj">
<Project>{a6dfdff4-614f-4225-8f75-c81c6765f23e}</Project>
<Name>Utilities</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
Loading

0 comments on commit d60422b

Please sign in to comment.