private void Confirm() { ICommand newCommand; switch (mMode) { default: // Off mAttitude = 0; newCommand = AttitudeCommand.Off(); break; case 1: // Killrot mAttitude = 0; newCommand = AttitudeCommand.KillRot(); break; case 2: // Node mAttitude = 0; newCommand = AttitudeCommand.ManeuverNode(); break; case 3: // Target Parallel mAttitude = (mAttitude == 0) ? 1 : mAttitude; newCommand = AttitudeCommand.WithAttitude(Attitude, ReferenceFrame.TargetParallel); break; case 4: // Orbital reference mAttitude = (mAttitude == 0) ? 1 : mAttitude; newCommand = AttitudeCommand.WithAttitude(Attitude, ReferenceFrame.Orbit); break; case 5: // Surface reference mAttitude = (mAttitude == 0) ? 1 : mAttitude; newCommand = AttitudeCommand.WithAttitude(Attitude, ReferenceFrame.Surface); break; case 6: // Target Velocity mAttitude = (mAttitude == 0) ? 1 : mAttitude; newCommand = AttitudeCommand.WithAttitude(Attitude, ReferenceFrame.TargetVelocity); break; case 7: // Custom Surface Heading mAttitude = 0; newCommand = AttitudeCommand.WithSurface(Pitch, Heading, Roll); break; } mFlightComputer.Enqueue(newCommand); }
private void Confirm() { DelayedCommand newCommand; switch (mMode) { default: // Off mAttitude = 0; newCommand = AttitudeCommand.Off(); break; case 1: // Killrot mAttitude = 0; newCommand = AttitudeCommand.KillRot(); break; case 2: // Node mAttitude = 0; newCommand = AttitudeCommand.ManeuverNode(); break; case 3: // Pitch, heading, roll mAttitude = 0; newCommand = AttitudeCommand.WithSurface( Pitch, Heading, mRollEnabled ? Roll : Single.NaN); break; case 4: // Orbital reference mAttitude = (mAttitude == 0) ? 1 : mAttitude; newCommand = AttitudeCommand.WithAttitude(Attitude, ReferenceFrame.Orbit); break; case 5: // Surface reference mAttitude = (mAttitude == 0) ? 1 : mAttitude; newCommand = AttitudeCommand.WithAttitude(Attitude, ReferenceFrame.Surface); break; case 6: // Target reference mAttitude = (mAttitude == 0) ? 1 : mAttitude; newCommand = AttitudeCommand.WithAttitude(Attitude, ReferenceFrame.Target); break; } mFlightComputer.Enqueue(newCommand); }