forked from DrTon/jMAVSim
-
Notifications
You must be signed in to change notification settings - Fork 210
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
79 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
package me.drton.jmavsim; | ||
|
||
import com.intellij.uiDesigner.core.GridConstraints; | ||
import com.intellij.uiDesigner.core.GridLayoutManager; | ||
|
||
import javax.swing.*; | ||
import javax.swing.event.ChangeEvent; | ||
import javax.swing.event.ChangeListener; | ||
import java.awt.*; | ||
|
||
/** | ||
* @author SungTae Moon <[email protected]> | ||
* @file SensorParamPanel.java | ||
* Sensor Control Parameter Panel | ||
* | ||
* <p> | ||
* This panel is used for the sensor test and analysis | ||
* | ||
* @author SungTae Moon <[email protected]> | ||
*/ | ||
|
||
public class SensorParamPanel extends JPanel { | ||
public class SensorParamPanel extends JPanel { | ||
private JSpinner accelSpinner; | ||
private JSpinner gyroSpinner; | ||
private JPanel mainPanel; | ||
|
@@ -38,47 +41,47 @@ public SensorParamPanel() { | |
accelSpinner.addChangeListener(new ChangeListener() { | ||
@Override | ||
public void stateChanged(ChangeEvent e) { | ||
Double value = (Double)accelSpinner.getValue(); | ||
Double value = (Double) accelSpinner.getValue(); | ||
sensors.setParameter("noise_Acc", value.floatValue()); | ||
} | ||
}); | ||
|
||
gyroSpinner.addChangeListener(new ChangeListener() { | ||
@Override | ||
public void stateChanged(ChangeEvent e) { | ||
Double value = (Double)gyroSpinner.getValue(); | ||
Double value = (Double) gyroSpinner.getValue(); | ||
sensors.setParameter("noise_Gyo", value.floatValue()); | ||
} | ||
}); | ||
|
||
magSpinner.addChangeListener(new ChangeListener() { | ||
@Override | ||
public void stateChanged(ChangeEvent e) { | ||
Double value = (Double)magSpinner.getValue(); | ||
Double value = (Double) magSpinner.getValue(); | ||
sensors.setParameter("noise_Mag", value.floatValue()); | ||
} | ||
}); | ||
|
||
presSpinner.addChangeListener(new ChangeListener() { | ||
@Override | ||
public void stateChanged(ChangeEvent e) { | ||
Double value = (Double)presSpinner.getValue(); | ||
Double value = (Double) presSpinner.getValue(); | ||
sensors.setParameter("noise_Prs", value.floatValue()); | ||
} | ||
}); | ||
|
||
gpsSpinner.addChangeListener(new ChangeListener() { | ||
@Override | ||
public void stateChanged(ChangeEvent e) { | ||
Double value = (Double)gpsSpinner.getValue(); | ||
Double value = (Double) gpsSpinner.getValue(); | ||
sensors.setParameter("gpsNoiseStdDev", value.floatValue()); | ||
} | ||
}); | ||
|
||
massSpinner.addChangeListener(new ChangeListener() { | ||
@Override | ||
public void stateChanged(ChangeEvent e) { | ||
Double value = (Double)massSpinner.getValue(); | ||
Double value = (Double) massSpinner.getValue(); | ||
sensors.setParameter("mass", value.floatValue()); | ||
} | ||
}); | ||
|
@@ -102,4 +105,65 @@ public void setSensor(Sensors sensors) { | |
|
||
} | ||
|
||
{ | ||
// GUI initializer generated by IntelliJ IDEA GUI Designer | ||
// >>> IMPORTANT!! <<< | ||
// DO NOT EDIT OR ADD ANY CODE HERE! | ||
$$$setupUI$$$(); | ||
} | ||
|
||
/** | ||
* Method generated by IntelliJ IDEA GUI Designer | ||
* >>> IMPORTANT!! <<< | ||
* DO NOT edit this method OR call it in your code! | ||
* | ||
* @noinspection ALL | ||
*/ | ||
private void $$$setupUI$$$() { | ||
mainPanel = new JPanel(); | ||
mainPanel.setLayout(new GridLayoutManager(8, 2, new Insets(0, 0, 0, 0), -1, -1)); | ||
final JLabel label1 = new JLabel(); | ||
label1.setText("Accel Noise StdDev"); | ||
mainPanel.add(label1, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); | ||
accelSpinner = new JSpinner(); | ||
mainPanel.add(accelSpinner, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); | ||
final JLabel label2 = new JLabel(); | ||
label2.setText("Gyro Noise StdDev"); | ||
mainPanel.add(label2, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); | ||
gyroSpinner = new JSpinner(); | ||
mainPanel.add(gyroSpinner, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); | ||
final JLabel label3 = new JLabel(); | ||
label3.setText("Mag Noise StdDev"); | ||
mainPanel.add(label3, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); | ||
final JLabel label4 = new JLabel(); | ||
label4.setText("Pressure Noise StdDev"); | ||
mainPanel.add(label4, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); | ||
final JLabel label5 = new JLabel(); | ||
label5.setText("GPS Noise StdDev"); | ||
mainPanel.add(label5, new GridConstraints(5, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); | ||
magSpinner = new JSpinner(); | ||
mainPanel.add(magSpinner, new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); | ||
presSpinner = new JSpinner(); | ||
mainPanel.add(presSpinner, new GridConstraints(4, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); | ||
gpsSpinner = new JSpinner(); | ||
mainPanel.add(gpsSpinner, new GridConstraints(5, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); | ||
final JLabel label6 = new JLabel(); | ||
label6.setText("--- VEHICLE ---"); | ||
mainPanel.add(label6, new GridConstraints(6, 0, 1, 2, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); | ||
final JLabel label7 = new JLabel(); | ||
label7.setText("mass"); | ||
mainPanel.add(label7, new GridConstraints(7, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); | ||
massSpinner = new JSpinner(); | ||
mainPanel.add(massSpinner, new GridConstraints(7, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); | ||
final JLabel label8 = new JLabel(); | ||
label8.setText("--- SENSORS ---"); | ||
mainPanel.add(label8, new GridConstraints(0, 0, 1, 2, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); | ||
} | ||
|
||
/** | ||
* @noinspection ALL | ||
*/ | ||
public JComponent $$$getRootComponent$$$() { | ||
return mainPanel; | ||
} | ||
} |