Skip to content

Commit 49747bc

Browse files
committed
[DEV]: Small UI change on FunctionsAndTelemetryJPanel
1 parent 4e109ad commit 49747bc

3 files changed

Lines changed: 15 additions & 3 deletions

File tree

src/com/pesterenan/controllers/LandingController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ private void changeControlMode() throws RPCException, StreamException, Interrupt
139139
velPID = velocityCtrl.calcPID(velVertical.get(), -Utilities.clamp(altitudeSup.get() * 0.1, 1, 10));
140140
throttle(Utilities.linearInterpolation(velPID, altPID, threshold));
141141
navigation.aimForLanding();
142-
if (threshold < 0.25) {
142+
if (threshold < 0.25 || altitudeSup.get() < landingDistanceThreshold) {
143143
hoverAltitude = landingDistanceThreshold;
144144
getNaveAtual().getControl().setGear(true);
145145
if (hoverAfterApproximation) {

src/com/pesterenan/views/FunctionsAndTelemetryJPanel.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ public void layoutComponents() {
9090

9191
JPanel pnlFunctionControls = new JPanel();
9292
pnlFunctionControls.setLayout(new BoxLayout(pnlFunctionControls, BoxLayout.Y_AXIS));
93+
pnlFunctionControls.add(MainGui.createMarginComponent(0, 4));
9394
pnlFunctionControls.add(btnLiftoff);
9495
pnlFunctionControls.add(btnLanding);
9596
pnlFunctionControls.add(btnManeuver);
@@ -100,10 +101,15 @@ public void layoutComponents() {
100101
pnlLeftPanel.setBorder(MainGui.MARGIN_BORDER_10_PX_LR);
101102
pnlLeftPanel.setLayout(new BoxLayout(pnlLeftPanel, BoxLayout.Y_AXIS));
102103
pnlLeftPanel.add(lblAltitude);
104+
pnlLeftPanel.add(Box.createVerticalStrut(5));
103105
pnlLeftPanel.add(lblSurfaceAlt);
106+
pnlLeftPanel.add(Box.createVerticalStrut(5));
104107
pnlLeftPanel.add(lblApoapsis);
108+
pnlLeftPanel.add(Box.createVerticalStrut(5));
105109
pnlLeftPanel.add(lblPeriapsis);
110+
pnlLeftPanel.add(Box.createVerticalStrut(5));
106111
pnlLeftPanel.add(lblHorzSpeed);
112+
pnlLeftPanel.add(Box.createVerticalStrut(5));
107113
pnlLeftPanel.add(lblVertSpeed);
108114
pnlLeftPanel.add(Box.createGlue());
109115

@@ -117,10 +123,15 @@ public void layoutComponents() {
117123
lblHorzSpeedValue.setAlignmentX(RIGHT_ALIGNMENT);
118124
lblVertSpeedValue.setAlignmentX(RIGHT_ALIGNMENT);
119125
pnlRightPanel.add(lblAltitudeValue);
126+
pnlRightPanel.add(Box.createVerticalStrut(5));
120127
pnlRightPanel.add(lblSurfaceAltValue);
128+
pnlRightPanel.add(Box.createVerticalStrut(5));
121129
pnlRightPanel.add(lblApoapsisValue);
130+
pnlRightPanel.add(Box.createVerticalStrut(5));
122131
pnlRightPanel.add(lblPeriapsisValue);
132+
pnlRightPanel.add(Box.createVerticalStrut(5));
123133
pnlRightPanel.add(lblHorzSpeedValue);
134+
pnlRightPanel.add(Box.createVerticalStrut(5));
124135
pnlRightPanel.add(lblVertSpeedValue);
125136
pnlRightPanel.add(Box.createGlue());
126137

@@ -131,8 +142,7 @@ public void layoutComponents() {
131142

132143
JPanel pnlTelemetry = new JPanel();
133144
pnlTelemetry.setLayout(new BoxLayout(pnlTelemetry, BoxLayout.Y_AXIS));
134-
pnlTelemetry.setBorder(new TitledBorder(null, Bundle.getString("pnl_tel_border"), TitledBorder.LEADING,
135-
TitledBorder.TOP, null, null));
145+
pnlTelemetry.setBorder(new TitledBorder(null, Bundle.getString("pnl_tel_border")));
136146
pnlTelemetry.add(pnlLeftRightContainer);
137147
pnlTelemetry.add(Box.createGlue());
138148
btnCancel.setAlignmentX(CENTER_ALIGNMENT);

src/com/pesterenan/views/LandingJPanel.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ private void handleLandingAction(ActionEvent e) {
148148
commands.put(Modulos.MAX_TWR.get(), txfMaxTWR.getText());
149149
commands.put(Modulos.SOBREVOO_POS_POUSO.get(), String.valueOf(chkHoverAfterLanding.isSelected()));
150150
MechPeste.newInstance().startModule(commands);
151+
MainGui.backToTelemetry(e);
152+
chkHoverAfterLanding.setSelected(false);
151153
} catch (NumberFormatException nfe) {
152154
StatusJPanel.setStatusMessage(Bundle.getString("pnl_land_hover_alt_err"));
153155
} catch (NullPointerException npe) {

0 commit comments

Comments
 (0)