Skip to content

Commit

Permalink
MED button also separate from the other MPT init inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
indy91 committed Aug 1, 2023
1 parent bb15164 commit bb42c86
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 27 deletions.
37 changes: 19 additions & 18 deletions Orbitersdk/samples/ProjectApollo/src_rtccmfd/ApolloRTCCMFD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,7 @@ void ApolloRTCCMFD::menuSetMPTInitPage()

GC->mptInitError = 0;
marker = 0;
markermax = 6;
markermax = 5;
}

void ApolloRTCCMFD::menuSetDescPlanTablePage()
Expand Down Expand Up @@ -3760,22 +3760,23 @@ void ApolloRTCCMFD::menuCycleMPTTable()
}
}

void ApolloRTCCMFD::menuCycleMPTMED()
{
if (G->mptinitmode < 3)
{
G->mptinitmode++;
}
else
{
G->mptinitmode = 0;
}
}

void ApolloRTCCMFD::menuSetMPTInitInput()
{
switch (marker)
{
case 0:
//MED
if (G->mptinitmode < 3)
{
G->mptinitmode++;
}
else
{
G->mptinitmode = 0;
}
break;
case 1: //Second option on MED
case 0: //Second option on MED
switch (G->mptinitmode)
{
case 0: //M49: SPS Fuel Remaining
Expand All @@ -3795,7 +3796,7 @@ void ApolloRTCCMFD::menuSetMPTInitInput()
break;
}
break;
case 2: //Third option on MED
case 1: //Third option on MED
switch (G->mptinitmode)
{
case 0: //M49: CSM RCS Fuel Remaining
Expand All @@ -3812,7 +3813,7 @@ void ApolloRTCCMFD::menuSetMPTInitInput()
break;
}
break;
case 3: //Fourth option on MED
case 2: //Fourth option on MED
switch (G->mptinitmode)
{
case 0: //M49: S-IVB Fuel Remaining
Expand All @@ -3829,7 +3830,7 @@ void ApolloRTCCMFD::menuSetMPTInitInput()
break;
}
break;
case 4: //Fifth option on MED
case 3: //Fifth option on MED
switch (G->mptinitmode)
{
case 0: //M49: LM APS Fuel Remaining
Expand All @@ -3843,7 +3844,7 @@ void ApolloRTCCMFD::menuSetMPTInitInput()
break;
}
break;
case 5: //Sixth option on MED
case 4: //Sixth option on MED
switch (G->mptinitmode)
{
case 0: //M49: LM RCS Fuel Remaining
Expand All @@ -3857,7 +3858,7 @@ void ApolloRTCCMFD::menuSetMPTInitInput()
break;
}
break;
case 6: //Seventh option on MED
case 5: //Seventh option on MED
switch (G->mptinitmode)
{
case 0: //M49: LM DPS Fuel Remaining
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,7 @@ class ApolloRTCCMFD: public MFD2 {
void menuTransferPoweredDescentToMPT();
void CheckoutMonitorCalc();
void menuCycleMPTTable();
void menuCycleMPTMED();
void menuSetMPTInitInput();
void set_MPTInitM55Config(char *cfg);
void menuMPTUpdate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5317,13 +5317,13 @@ bool ApolloRTCCMFD::Update(oapi::Sketchpad *skp)

skp->SetTextAlign(oapi::Sketchpad::LEFT);

skp->Text(1 * W / 16, (marker + 5) * H / 16, "*", 1);
skp->Text(1 * W / 16, (marker + 6) * H / 16, "*", 1);

skp->Text(10 * W / 16, 5 * H / 16, "MPT:", 4);

if (G->mptinitmode == 0)
{
skp->Text(2 * W / 16, 5 * H / 16, "MED M49: Fuel Remaining", 23);
skp->Text(2 * W / 16, 4 * H / 14, "MED M49: Fuel Remaining", 23);

if (GC->rtcc->med_m49.Table == RTCC_MPT_LM)
{
Expand Down Expand Up @@ -5411,7 +5411,7 @@ bool ApolloRTCCMFD::Update(oapi::Sketchpad *skp)
}
else if (G->mptinitmode == 1)
{
skp->Text(2 * W / 16, 5 * H / 16, "MED M50: Weights", 16);
skp->Text(2 * W / 16, 4 * H / 14, "MED M50: Weights", 16);

if (GC->rtcc->med_m50.Table == RTCC_MPT_LM)
{
Expand Down Expand Up @@ -5481,7 +5481,7 @@ bool ApolloRTCCMFD::Update(oapi::Sketchpad *skp)
}
else if (G->mptinitmode == 2)
{
skp->Text(2 * W / 16, 5 * H / 16, "MED M51: Areas", 14);
skp->Text(2 * W / 16, 4 * H / 14, "MED M51: Areas", 14);

if (GC->rtcc->med_m51.Table == RTCC_MPT_LM)
{
Expand Down Expand Up @@ -5521,7 +5521,7 @@ bool ApolloRTCCMFD::Update(oapi::Sketchpad *skp)
}
else
{
skp->Text(2 * W / 16, 5 * H / 16, "MED M55: Configuration", 22);
skp->Text(2 * W / 16, 4 * H / 14, "MED M55: Configuration", 22);

if (GC->rtcc->med_m55.Table == RTCC_MPT_LM)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2012,11 +2012,11 @@ ApolloRTCCMFDButtons::ApolloRTCCMFDButtons()
static const MFDBUTTONMENU mnu59[] =
{
{ "Choose Table", 0, 'T' },
{ "Choose MED", 0, 'E' },
{ "Update MPT", 0, 'M' },
{ "Previous Item", 0, 'P' },
{ "Next Item", 0, 'N' },
{ "Set input", 0, 'S' },
{ "Update MPT", 0, 'M' },
{ "", 0, ' ' },

{ "Select vehicle", 0, 'D' },
{ "Auto update of parameters", 0, 'U' },
Expand All @@ -2029,11 +2029,11 @@ ApolloRTCCMFDButtons::ApolloRTCCMFDButtons()
RegisterPage(mnu59, sizeof(mnu59) / sizeof(MFDBUTTONMENU));

RegisterFunction("TAB", OAPI_KEY_A, &ApolloRTCCMFD::menuCycleMPTTable);
RegisterFunction("MED", OAPI_KEY_E, &ApolloRTCCMFD::menuCycleMPTMED);
RegisterFunction("UPD", OAPI_KEY_M, &ApolloRTCCMFD::menuMPTUpdate);
RegisterFunction("<<", OAPI_KEY_P, &ApolloRTCCMFD::menuCycleMarkerDown);
RegisterFunction(">>", OAPI_KEY_N, &ApolloRTCCMFD::menuCycleMarkerUp);
RegisterFunction("SET", OAPI_KEY_S, &ApolloRTCCMFD::menuSetMPTInitInput);
RegisterFunction("UPD", OAPI_KEY_M, &ApolloRTCCMFD::menuMPTUpdate);
RegisterFunction("", OAPI_KEY_E, &ApolloRTCCMFD::menuVoid);

RegisterFunction("TGT", OAPI_KEY_D, &ApolloRTCCMFD::menuMPTInitM50M55Vehicle);
RegisterFunction("AUT", OAPI_KEY_U, &ApolloRTCCMFD::menuMPTInitAutoUpdate);
Expand Down

0 comments on commit bb42c86

Please sign in to comment.