public static void DrawContent() { MarkerForces comv = RCSBuildAid.VesselForces; MassEditorMarker comm = RCSBuildAid.ReferenceMarker.GetComponent <MassEditorMarker> (); GUILayout.BeginHorizontal(); { if (RCSBuildAid.EngineList.Count != 0) { GUILayout.BeginVertical(); { GUILayout.Label("Reference"); GUILayout.Label("Torque"); GUILayout.Label("Thrust"); GUILayout.Label("TWR"); } GUILayout.EndVertical(); GUILayout.BeginVertical(); { MainWindow.referenceButton(); GUILayout.Label(comv.Torque().magnitude.ToString("0.### kNm")); GUILayout.Label(comv.Thrust().magnitude.ToString("0.## kN")); GUILayout.Label((comv.Thrust().magnitude / (comm.mass * 9.81)).ToString("0.##")); } GUILayout.EndVertical(); } else { GUILayout.Label("No engines attached", MainWindow.style.centerText); } } GUILayout.EndHorizontal(); }
protected override void content() { MarkerForces comv = RCSBuildAid.VesselForces; MomentOfInertia moi = comv.MoI; GUILayout.BeginHorizontal(GUI.skin.box); { GUILayout.BeginVertical(); { GUILayout.Label("MoI:"); GUILayout.Label("Ang Acc:"); GUILayout.Label("Ang Acc:"); } GUILayout.EndVertical(); GUILayout.BeginVertical(); { GUILayout.Label(moi.value.ToString("0.## tm²")); float angAcc = comv.Torque().magnitude / moi.value; GUILayout.Label(angAcc.ToString("0.## r/s²")); GUILayout.Label((angAcc * Mathf.Rad2Deg).ToString("0.## °/s²")); } GUILayout.EndVertical(); } GUILayout.EndHorizontal(); DebugSettings.labelMagnitudes = GUILayout.Toggle(DebugSettings.labelMagnitudes, "Show vector magnitudes"); DebugSettings.inFlightAngularInfo = GUILayout.Toggle(DebugSettings.inFlightAngularInfo, "In flight angular data"); DebugSettings.startInOrbit = GUILayout.Toggle(DebugSettings.startInOrbit, "Launch in orbit"); }
static void DrawContent() { MarkerForces comv = RCSBuildAid.VesselForces; GUILayout.BeginHorizontal(); { if (hasAttitudeControl()) { GUILayout.BeginVertical(); { GUILayout.Label("Reference"); GUILayout.Label("Direction"); GUILayout.Label("Torque"); GUILayout.Label("Thrust"); } GUILayout.EndVertical(); GUILayout.BeginVertical(); { MainWindow.referenceButton(); MainWindow.directionButton(); GUILayout.Label(comv.Torque().magnitude.ToString("0.### kNm")); GUILayout.Label(comv.Thrust().magnitude.ToString("0.## kN")); } GUILayout.EndVertical(); } else { GUILayout.Label("No attitude control elements attached", MainWindow.style.centerText); } } GUILayout.EndHorizontal(); }
protected override void DrawContent() { MarkerForces comv = RCSBuildAid.VesselForces; GUILayout.BeginVertical(); { if (RCSBuildAid.RCS.Count != 0) { GUILayout.BeginHorizontal(); { GUILayout.Label("Reference", MainWindow.style.readoutName); MainWindow.ReferenceButton(); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); { GUILayout.Label("Direction", MainWindow.style.readoutName); MainWindow.TranslationButton(); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); { GUILayout.Label("Torque", MainWindow.style.readoutName); GUILayout.Label(comv.Torque().magnitude.ToString("0.### kNm")); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); { GUILayout.Label("Thrust", MainWindow.style.readoutName); GUILayout.Label(comv.Thrust().magnitude.ToString("0.## kN")); } GUILayout.EndHorizontal(); if (DeltaV.sanity) { GUILayout.BeginHorizontal(); { GUILayout.Label("Delta V", MainWindow.style.readoutName); GUILayout.Label(DeltaV.dV.ToString("0.# m/s")); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); { GUILayout.Label("Burn time", MainWindow.style.readoutName); GUILayout.Label(MainWindow.TimeFormat(DeltaV.burnTime)); } GUILayout.EndHorizontal(); } } else { GUILayout.Label("No RCS thrusters attached", MainWindow.style.centerText); } } GUILayout.EndVertical(); }
protected override void DrawContent() { MarkerForces comv = RCSBuildAid.VesselForces; GUILayout.BeginVertical(); { if (RCSBuildAid.Engines.Count != 0) { GUILayout.BeginHorizontal(); { GUILayout.Label("Reference", MainWindow.style.readoutName); MainWindow.ReferenceButton(); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); { GUILayout.Label("Torque", MainWindow.style.readoutName); GUILayout.Label(comv.Torque().magnitude.ToString("0.### kNm")); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); { GUILayout.Label("Thrust", MainWindow.style.readoutName, GUILayout.Width(40)); if (GUILayout.Button(Settings.engines_vac ? "Vac" : "ASL", MainWindow.style.clickLabel, GUILayout.Width(36))) { Settings.engines_vac = !Settings.engines_vac; } GUILayout.Label(comv.Thrust().magnitude.ToString("0.## kN")); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); { GUILayout.Label("Body", MainWindow.style.readoutName); if (GUILayout.Button(Settings.selected_body.name, MainWindow.style.clickLabel)) { MainWindow.cBodyListEnabled = !MainWindow.cBodyListEnabled; MainWindow.cBodyListMode = RCSBuildAid.Mode; } } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); { GUILayout.Label("TWR", MainWindow.style.readoutName); GUILayout.Label(comv.TWR.ToString("0.##")); } GUILayout.EndHorizontal(); gimbals.DrawContent(); } else { GUILayout.Label("No engines attached", MainWindow.style.centerText); } } GUILayout.EndVertical(); }
protected override void content() { MarkerForces comv = RCSBuildAid.VesselForces; MomentOfInertia moi = comv.MoI; GUILayout.BeginHorizontal(GUI.skin.box); { GUILayout.BeginVertical(); { GUILayout.Label("Mouse"); GUILayout.Label("MoI"); GUILayout.Label("Ang Acc"); GUILayout.Label("Ang Acc"); } GUILayout.EndVertical(); GUILayout.BeginVertical(); { GUILayout.Label($"{Input.mousePosition.x}, {Input.mousePosition.y}"); GUILayout.Label(moi.value.ToString("0.## tm²")); float angAcc = comv.Torque().magnitude / moi.value; GUILayout.Label(angAcc.ToString("0.## r/s²")); GUILayout.Label((angAcc * Mathf.Rad2Deg).ToString("0.## °/s²")); } GUILayout.EndVertical(); } GUILayout.EndHorizontal(); Part part = null; if (massInfo) { foreach (var p in EditorLogic.fetch.ship.parts) { if (p.stackIcon.Highlighted) { part = p; break; } } } if (massInfo) { if (part != null) { GUILayout.BeginVertical(GUI.skin.box); { printMassInfo(part); } GUILayout.EndVertical(); } else { if (GUILayout.Button("mouseover a part")) { massInfo = !massInfo; } } } else { if (GUILayout.Button("mass info")) { massInfo = !massInfo; } } DebugSettings.labelMagnitudes = GUILayout.Toggle(DebugSettings.labelMagnitudes, "Show vector magnitudes"); DebugSettings.inFlightAngularInfo = GUILayout.Toggle(DebugSettings.inFlightAngularInfo, "In flight angular data"); DebugSettings.inFlightPartInfo = GUILayout.Toggle(DebugSettings.inFlightPartInfo, "In flight vessel tree"); DebugSettings.startInOrbit = GUILayout.Toggle(DebugSettings.startInOrbit, "Launch in orbit"); if (GUILayout.Button("Toggle vessel tree window")) { if (vesselTreeWindow == null) { vesselTreeWindow = gameObject.AddComponent <DebugVesselTree> (); } else { Destroy(vesselTreeWindow); } } if (GUILayout.Button("Toggle part list window")) { if (partListWindow == null) { partListWindow = gameObject.AddComponent <DebugPartList> (); } else { Destroy(partListWindow); } } if (GUILayout.Button("More info")) { if (debugMiscInfo == null) { debugMiscInfo = gameObject.AddComponent <DebugMiscInfo> (); } else { Destroy(debugMiscInfo); } } }
protected override void DrawContent() { MarkerForces vesselForces = RCSBuildAid.VesselForces; GUILayout.BeginVertical(); { if (RCSBuildAid.HasRCS) { GUILayout.BeginHorizontal(); { GUILayout.Label("Reference", MainWindow.style.readoutName); MainWindow.ReferenceButton(); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); { GUILayout.Label("Direction", MainWindow.style.readoutName); MainWindow.TranslationButton(); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); { GUILayout.Label("Torque", MainWindow.style.readoutName); GUILayout.Label(vesselForces.Torque().magnitude.ToString("0.### kNm")); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); { GUILayout.Label("Thrust", MainWindow.style.readoutName); GUILayout.Label(vesselForces.Thrust().magnitude.ToString("0.## kN")); } GUILayout.EndHorizontal(); if (DeltaV.sanity) { GUILayout.BeginHorizontal(); { GUILayout.Label("ΔV", MainWindow.style.readoutName); GUILayout.Label(DeltaV.dV.ToString("0.# m/s")); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); { GUILayout.Label("Burn time", MainWindow.style.readoutName); GUILayout.Label(MainWindow.TimeFormat(DeltaV.burnTime)); } GUILayout.EndHorizontal(); } if (Settings.show_rcs_twr) { GUILayout.BeginHorizontal(); { GUILayout.Label("Body", MainWindow.style.readoutName); if (GUILayout.Button(Settings.selected_body.name, MainWindow.style.clickLabel)) { MainWindow.cBodyListEnabled = !MainWindow.cBodyListEnabled; MainWindow.cBodyListMode = RCSBuildAid.Mode; } } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); { GUILayout.Label("TWR", MainWindow.style.readoutName); GUILayout.Label(!Settings.selected_body.atmosphere ? vesselForces.TWR.ToString("0.##") : "--"); } GUILayout.EndHorizontal(); } } else { GUILayout.Label("No RCS thrusters attached", MainWindow.style.centerText); } } GUILayout.EndVertical(); }