Skip to content

Commit

Permalink
Remove oat sim (#54)
Browse files Browse the repository at this point in the history
* Removed OAT Sim

Will make a standalone client instead!

* Removed server
  • Loading branch information
christian-kardach authored Sep 28, 2024
1 parent d9af9b4 commit de5fcf1
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 182 deletions.
127 changes: 0 additions & 127 deletions OATCommunications/Server/SimulationServer.cs

This file was deleted.

10 changes: 2 additions & 8 deletions OATControl/OATControl.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29814.53
# Visual Studio Version 17
VisualStudioVersion = 17.1.32421.90
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OATControl", "OATControl.csproj", "{99D141F1-4E6D-4BD0-B160-5E67A3BE33D0}"
ProjectSection(ProjectDependencies) = postProject
Expand All @@ -15,8 +15,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OATCommunications.WPF", "..
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OATCommunications.ASCOM", "..\OATCommunications.ASCOM\OATCommunications.ASCOM.csproj", "{9DA34FCF-6464-491C-88B1-7726454A1183}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OATSimulation", "..\OATSimulation\OATSimulation.csproj", "{717F35FE-FAF0-4055-8733-B70B92200FAC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OATTest", "..\OATTest\OATTest.csproj", "{2943ACA1-4753-486E-A411-135C1EA6E10C}"
EndProject
Global
Expand All @@ -41,10 +39,6 @@ Global
{9DA34FCF-6464-491C-88B1-7726454A1183}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9DA34FCF-6464-491C-88B1-7726454A1183}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9DA34FCF-6464-491C-88B1-7726454A1183}.Release|Any CPU.Build.0 = Release|Any CPU
{717F35FE-FAF0-4055-8733-B70B92200FAC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{717F35FE-FAF0-4055-8733-B70B92200FAC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{717F35FE-FAF0-4055-8733-B70B92200FAC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{717F35FE-FAF0-4055-8733-B70B92200FAC}.Release|Any CPU.Build.0 = Release|Any CPU
{2943ACA1-4753-486E-A411-135C1EA6E10C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2943ACA1-4753-486E-A411-135C1EA6E10C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2943ACA1-4753-486E-A411-135C1EA6E10C}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down
47 changes: 0 additions & 47 deletions OATControl/ViewModels/MountVM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,6 @@ public class MountVM : ViewModelBase
private ICommunicationHandler _commHandler;
private string _serialBaudRate;

private SimulationServer _oatSimComm = new SimulationServer();

private OatmealTelescopeCommandHandlers _oatMount;
private PointsOfInterest _pointsOfInterest;
PointOfInterest _selectedPointOfInterest;
Expand Down Expand Up @@ -342,11 +340,6 @@ public MountVM()
LoadCustomCommands();
ShowChecklist = AppSettings.Instance.ShowChecklist;

// Start Simulation Server
_oatSimComm.Start(4035);
_oatSimComm.ClientConnected += OnSimulationClientConnect;
_oatSimComm.ClientCommand += OnSimationClientCommand;

ScopeType = "OAM";

if (ShowChecklist == ChecklistShowOn.OnStartup)
Expand Down Expand Up @@ -1349,8 +1342,6 @@ public async Task UpdateStatus()
TrkStepper = int.Parse(parts[4]);
}

UpdateSimulationClient();

CurrentRAHour = int.Parse(parts[5].Substring(0, 2));
CurrentRAMinute = int.Parse(parts[5].Substring(2, 2));
CurrentRASecond = int.Parse(parts[5].Substring(4, 2));
Expand Down Expand Up @@ -1974,12 +1965,6 @@ public void Disconnect()

ShowDECLimits = false;

if (_oatSimComm != null)
{
_oatSimComm.Stop();
_oatSimComm = null;
}

if (_commHandler != null)
{
_commHandler.Disconnect();
Expand Down Expand Up @@ -2108,7 +2093,6 @@ private async void OnConnectToTelescope()
if (await this.ChooseTelescope())
{
await RecalculatePointsPositions(true);
OnSimulationClientConnect();
}
if (_showChecklist == ChecklistShowOn.OnConnect)
{
Expand Down Expand Up @@ -4115,37 +4099,6 @@ public bool KeepMiniControlOnTop
}
}
}
private void OnSimulationClientConnect()
{
if (_oatSimComm != null && _oatSimComm.IsClientConnected == true)
{
_oatSimComm.Send($"Version|{Version}");
_oatSimComm.Send($"FirmwareVersion|{ScopeVersion}");
_oatSimComm.Send($"ScopeRASlewMS|{ScopeRASlewMS}");
_oatSimComm.Send($"ScopeRATrackMS|{ScopeRATrackMS}");
_oatSimComm.Send($"ScopeDECSlewMS|{ScopeDECSlewMS}");
_oatSimComm.Send($"ScopeDECGuideMS|{ScopeDECGuideMS}");
_oatSimComm.Send($"ScopeLongitude|{ScopeLongitude}");
_oatSimComm.Send($"ScopeLatitude|{ScopeLatitude}");
_oatSimComm.Send($"RAStepsPerDegree|{RAStepsPerDegree}");
_oatSimComm.Send($"DECStepsPerDegree|{DECStepsPerDegree}");
}
}

private void UpdateSimulationClient()
{
if (_oatSimComm != null && _oatSimComm.IsClientConnected == true)
{
_oatSimComm.Send($"CurrentRAString|{CurrentRAHour},{CurrentRAMinute},{CurrentRASecond}");
_oatSimComm.Send($"CurrentDECString|{CurrentDECSign}{CurrentDECDegree},{CurrentDECMinute},{CurrentDECSecond}");
_oatSimComm.Send($"RAStepper|{RAStepper}");
_oatSimComm.Send($"DECStepper|{DECStepper}");
_oatSimComm.Send($"TrkStepper|{TrkStepper}");
_oatSimComm.Send($"ScopeSiderealTime|{ScopeSiderealTime}");
_oatSimComm.Send($"ScopePolarisHourAngle|{ScopePolarisHourAngle}");
_oatSimComm.Send($"ScopeTime|{ScopeTime}");
}
}

private void OnSimationClientCommand(string cmd)
{
Expand Down

0 comments on commit de5fcf1

Please sign in to comment.