Skip to content

Commit

Permalink
Merge pull request #1294 from indy91/MCCRelaySatellite
Browse files Browse the repository at this point in the history
MCC: Support for relay satellites and similar "ground" stations
  • Loading branch information
indy91 authored Sep 20, 2024
2 parents 12d0f88 + caa3e4d commit 0b14a5b
Show file tree
Hide file tree
Showing 138 changed files with 581 additions and 76 deletions.
3 changes: 2 additions & 1 deletion Missions/ProjectApollo/ASTP.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ Name=ASTP
SMJCVersion=2
CMCVersion=Skylark048
TEPHEM0=42594.0
HasRateAidedOptics=TRUE
HasRateAidedOptics=TRUE
GroundStation=0 ATS-6 ATS 0.0 0.0 1 18 5 1 0 28 1 1 3 0 6 8
6 changes: 5 additions & 1 deletion Missions/ProjectApollo/Apollo 10.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,8 @@ LMADIAY=20
LMADIAZ=-24
LMADSRAX=5
LMADSRAY=2
LMADSRAZ=-1
LMADSRAZ=-1
GroundStationPosition=15 -17.0 -174.0
GroundStationPosition=16 -32.0 131.0
GroundStationPosition=17 -14.0 145.5
GroundStationPosition=18 25.0 -49.0
6 changes: 5 additions & 1 deletion Missions/ProjectApollo/Apollo 11.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,8 @@ LMADIAY=-4
LMADIAZ=20
LMADSRAX=2
LMADSRAY=26
LMADSRAZ=-11
LMADSRAZ=-11
GroundStationPosition=15 3.0 154.0
GroundStationPosition=16 10.0 -175.2
GroundStationPosition=17 -2.25 166.8
GroundStationPosition=18 25.0 -49.0
3 changes: 2 additions & 1 deletion Missions/ProjectApollo/Apollo 12.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@ LMADIAY=-15
LMADIAZ=13
LMADSRAX=-2
LMADSRAY=4
LMADSRAZ=-2
LMADSRAZ=-2
GroundStationPosition=18 28.0 -49.0
3 changes: 2 additions & 1 deletion Missions/ProjectApollo/Apollo 13.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ LMPVesselName=Fred Haise
CDRSuitName=J. LOVELL
CMPSuitName=J. SWIGERT
LMPSuitName=F. HAISE
CSMCueCard=1 SATURN_BOOST_A14
CSMCueCard=1 SATURN_BOOST_A14
GroundStationPosition=18 28.0 -49.0
3 changes: 2 additions & 1 deletion Missions/ProjectApollo/Apollo 1301.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ LMPVesselName=Fred Haise
CDRSuitName=J. LOVELL
CMPSuitName=J. SWIGERT
LMPSuitName=F. HAISE
CSMCueCard=1 SATURN_BOOST_A14
CSMCueCard=1 SATURN_BOOST_A14
GroundStationPosition=18 28.0 -49.0
3 changes: 2 additions & 1 deletion Missions/ProjectApollo/Apollo 14.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ LMPVesselName=Ed Mitchell
CDRSuitName=A. SHEPARD
CMPSuitName=S. ROOSA
LMPSuitName=E. MITCHELL
CSMCueCard=1 SATURN_BOOST_A14
CSMCueCard=1 SATURN_BOOST_A14
GroundStationPosition=18 28.0 -49.0
3 changes: 2 additions & 1 deletion Missions/ProjectApollo/Apollo 15.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ CSMCueCard=1 SATURN_BOOST_A15
CSMCueCard=1 NOMINAL_SIVB_TLI_1_A15
CSMCueCard=1 MANUAL_SIVB_TLI_1_A15
CSMCueCard=1 NOMINAL_SIVB_TLI_2_A15
CSMCueCard=1 MANUAL_SIVB_TLI_2_A15
CSMCueCard=1 MANUAL_SIVB_TLI_2_A15
GroundStationPosition=18 28.0 -49.0
3 changes: 2 additions & 1 deletion Missions/ProjectApollo/Apollo 16.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ LMPVesselName=Charlie Duke
CDRSuitName=J. YOUNG
CMPSuitName=T. MATTINGLY
LMPSuitName=C. DUKE
CSMCueCard=1 SATURN_BOOST_A15
CSMCueCard=1 SATURN_BOOST_A15
GroundStationPosition=18 28.0 -49.0
3 changes: 2 additions & 1 deletion Missions/ProjectApollo/Apollo 17.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ LMPVesselName=Jack Schmitt
CDRSuitName=E. CERNAN
CMPSuitName=R. EVANS
LMPSuitName=H. SCHMITT
CSMCueCard=1 SATURN_BOOST_A15
CSMCueCard=1 SATURN_BOOST_A15
GroundStationPosition=18 28.0 -49.0
4 changes: 4 additions & 0 deletions Missions/ProjectApollo/Apollo 7.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@ CMADIAZ=20.8
CMADSRAX=3.9
CMADSRAY=-0.4
CMADSRAZ=-8.8
GroundStationPosition=15 25.0 -136.0
GroundStationPosition=16 25.0 125.0
GroundStationPosition=17 -25.0 -118.0
GroundStationPosition=18 32.7 -48.0
6 changes: 5 additions & 1 deletion Missions/ProjectApollo/Apollo 8.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@ CMADIAY=-3.22
CMADIAZ=28.23
CMADSRAX=-2.24
CMADSRAY=1.66
CMADSRAZ=-3.22
CMADSRAZ=-3.22
GroundStationPosition=15 21.0 169.0
GroundStationPosition=16 7.5 -178.5
GroundStationPosition=17 2.5 155.5
GroundStationPosition=18 25.0 -49.0
6 changes: 5 additions & 1 deletion Missions/ProjectApollo/Apollo 9.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,8 @@ LMADIAY=-0.3
LMADIAZ=19.6
LMADSRAX=-0.5
LMADSRAY=16.3
LMADSRAZ=-1.7
LMADSRAZ=-1.7
GroundStationPosition=15 -7.0 170.0
GroundStationPosition=16 -22.0 -160.0
GroundStationPosition=17 22.0 -131.0
GroundStationPosition=18 32.0 -45.0
2 changes: 2 additions & 0 deletions Orbitersdk/samples/ProjectApollo/Build/VC2017/MCC.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@
</Bscmake>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\src_aux\Mission.cpp" />
<ClCompile Include="..\..\src_launch\mccvessel.cpp" />
<ClCompile Include="..\..\src_launch\MCC_Mission_B.cpp" />
<ClCompile Include="..\..\src_launch\MCC_Mission_C.cpp" />
Expand Down Expand Up @@ -199,6 +200,7 @@
<ClCompile Include="..\..\src_launch\mccvc.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src_aux\Mission.h" />
<ClInclude Include="..\..\src_aux\paCBGmessageID.h" />
<ClInclude Include="..\..\src_launch\mccvessel.h" />
<ClInclude Include="..\..\src_launch\MCC_Mission_B.h" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@
<ClCompile Include="..\..\src_rtccmfd\RTCCDisplayFormatting.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src_aux\Mission.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src_launch\mcc.h">
Expand Down Expand Up @@ -269,5 +272,8 @@
<ClInclude Include="..\..\src_rtccmfd\RTCCUtilities.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src_aux\Mission.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
70 changes: 70 additions & 0 deletions Orbitersdk/samples/ProjectApollo/src_aux/Mission.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@ namespace mission {

char line[256];

AdditionalGroundStations.clear();
GroundStationsPositions.clear();
GroundStationsActive.clear();

while (hFile.getline(line, sizeof line))
{
if (!_strnicmp(line, "Name=", 5)) {
Expand Down Expand Up @@ -416,6 +420,15 @@ namespace mission {
else if (!_strnicmp(line, "LMPIPASCALEZ=", 13)) {
sscanf(line + 13, "%lf", &LM_PIPAScale.z);
}
else if (!_strnicmp(line, "GroundStation=", 14)) {
ReadGroundStationLine(line + 14);
}
else if (!_strnicmp(line, "GroundStationPosition=", 22)) {
ReadGroundStationPostionLine(line + 22);
}
else if (!_strnicmp(line, "GroundStationActive=", 20)) {
ReadGroundStationActiveLine(line + 20);
}
}
hFile.close();

Expand Down Expand Up @@ -696,6 +709,63 @@ namespace mission {
return bLMEventTimerReverseAtZero;
}

std::vector<GroundStationData> Mission::GetGroundStationData() const
{
return AdditionalGroundStations;
}

std::vector<GroundStationPosition> Mission::GetGroundStationPosition() const
{
return GroundStationsPositions;
}

std::vector<GroundStationActive> Mission::GetGroundStationActive() const
{
return GroundStationsActive;
}

void Mission::ReadGroundStationLine(char *line)
{
GroundStationData temp;

int itemp[3];

if (sscanf(line, "%d %s %s %lf %lf %d %d %d %d %d %d %d %d %d %d %d %d",
&temp.Num, temp.Name, temp.Code, &temp.Position[0], &temp.Position[1], &itemp[0], &temp.TrackingCaps, &temp.USBCaps, &temp.SBandAntenna, &temp.TelemetryCaps,
&temp.CommCaps, &itemp[1], &itemp[2], &temp.DownTlmCaps, &temp.UpTlmCaps, &temp.StationType, &temp.StationPurpose) == 17)
{
temp.Active = (itemp[0] != 0);
temp.HasRadar = (itemp[1] != 0);
temp.HasAcqAid = (itemp[2] != 0);

AdditionalGroundStations.push_back(temp);
}
}

void Mission::ReadGroundStationPostionLine(char *line)
{
GroundStationPosition temp;

if (sscanf(line, "%d %lf %lf", &temp.Num, &temp.Position[0], &temp.Position[1]) == 3)
{
GroundStationsPositions.push_back(temp);
}
}

void Mission::ReadGroundStationActiveLine(char *line)
{
GroundStationActive temp;

int itemp;

if (sscanf(line, "%d %d", &temp.Num, &itemp) == 2)
{
temp.Active = (itemp != 0);

GroundStationsActive.push_back(temp);
}
}

bool Mission::DoApollo13Failures() const
{
return bApollo13Failures;
Expand Down
46 changes: 46 additions & 0 deletions Orbitersdk/samples/ProjectApollo/src_aux/Mission.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,39 @@ namespace mission
VECTOR3 ofs = _V(0, 0, 0);
};

struct GroundStationData
{
int Num; //0 = crate new station, >=1 = Overload existing station

char Name[64]; // Station name
char Code[8]; // Station ID code
double Position[2]; // Latitude, Longitude
bool Active; // This entry is valid and active
int TrackingCaps; // Tracking capabilities
int USBCaps; // Unified S-Band Capabilities
int SBandAntenna; // S-Band Antenna Type
int TelemetryCaps; // Telemetry Handling Capabilities
int CommCaps; // Radio/Ground Communications Capabilities
bool HasRadar; // Has radar capability
bool HasAcqAid; // Has target acquisition aid
int DownTlmCaps; // Downtelemetry Capabilities
int UpTlmCaps; // Command Capabilities
int StationType; // Station Type
int StationPurpose; // Station Purpose
};

struct GroundStationPosition
{
int Num; //Station number
double Position[2]; // Latitude, Longitude
};

struct GroundStationActive
{
int Num; //Station number
bool Active; // This entry is valid and active
};

class Mission
{
public:
Expand Down Expand Up @@ -125,6 +158,12 @@ namespace mission
virtual const std::string& GetLMPSuitName() const;
//false = LM event timer continues to count down through zero, true = when reaching zero it starts counting up
virtual bool IsLMEventTimerReversingAtZero() const;
//Get additional ground station data
std::vector<GroundStationData> GetGroundStationData() const;
//Overload ground station position
std::vector<GroundStationPosition> GetGroundStationPosition() const;
//Set ground station active/inactive
std::vector<GroundStationActive> GetGroundStationActive() const;
//Run special Apollo 13 failure and audio code
virtual bool DoApollo13Failures() const;
protected:
Expand All @@ -139,6 +178,10 @@ namespace mission

void UpdateTEPHEM0();

void ReadGroundStationLine(char *line);
void ReadGroundStationPostionLine(char *line);
void ReadGroundStationActiveLine(char *line);

std::string strFileName;
std::string strMissionName;
std::string strCMCVersion;
Expand Down Expand Up @@ -177,6 +220,9 @@ namespace mission
double dTEPHEM0;
int iLMNumber;
bool bLMEventTimerReverseAtZero;
std::vector<GroundStationData> AdditionalGroundStations;
std::vector<GroundStationPosition> GroundStationsPositions;
std::vector<GroundStationActive> GroundStationsActive;
bool bApollo13Failures;

MATRIX3 CM_IMUDriftRates;
Expand Down
Loading

0 comments on commit 0b14a5b

Please sign in to comment.