-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PID plots added. Motor gauges on seperate tab
- Loading branch information
1 parent
09e6c8f
commit eeef9a0
Showing
17 changed files
with
876 additions
and
281 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
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
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<?import eu.hansolo.medusa.Gauge?> | ||
<?import javafx.scene.layout.HBox?> | ||
<?import javafx.scene.layout.VBox?> | ||
|
||
<fx:root alignment="CENTER" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" spacing="10.0" type="HBox" xmlns="http://javafx.com/javafx/8.0.60" xmlns:fx="http://javafx.com/fxml/1"> | ||
<children> | ||
<VBox alignment="CENTER" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" spacing="10.0" HBox.hgrow="ALWAYS"> | ||
<children> | ||
<Gauge fx:id="flMotor" maxHeight="1.7976931348623157E308" maxValue="1000.0" maxWidth="1.7976931348623157E308" minMeasuredValue="0.0" prefHeight="130.0" prefWidth="120.0" skinType="FLAT" title="Front Left" value="200.0" VBox.vgrow="ALWAYS" /> | ||
<Gauge fx:id="rlMotor" maxHeight="1.7976931348623157E308" maxValue="1000.0" maxWidth="1.7976931348623157E308" minMeasuredValue="0.0" prefHeight="130.0" prefWidth="120.0" skinType="FLAT" title="Rear Left" value="200.0" VBox.vgrow="ALWAYS" /> | ||
</children> | ||
</VBox> | ||
<Gauge fx:id="throttle" animated="true" interactive="true" maxHeight="1.7976931348623157E308" maxValue="2000.0" maxWidth="1.7976931348623157E308" minMeasuredValue="1000.0" minValue="1000.0" skinType="MODERN" subTitle="OFF" title="Throttle" value="1200.0" HBox.hgrow="ALWAYS" /> | ||
<VBox alignment="CENTER" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" spacing="10.0" HBox.hgrow="ALWAYS"> | ||
<children> | ||
<Gauge fx:id="frMotor" averageVisible="true" averagingEnabled="true" maxHeight="1.7976931348623157E308" maxValue="1000.0" maxWidth="1.7976931348623157E308" minMeasuredValue="0.0" prefHeight="130.0" prefWidth="120.0" skinType="FLAT" startAngle="0.0" title="Front Right" value="200.0" VBox.vgrow="ALWAYS" /> | ||
<Gauge fx:id="rrMotor" maxHeight="1.7976931348623157E308" maxValue="1000.0" maxWidth="1.7976931348623157E308" minMeasuredValue="0.0" prefHeight="130.0" prefWidth="120.0" skinType="FLAT" title="Rear Right" value="200.0" VBox.vgrow="ALWAYS" /> | ||
</children> | ||
</VBox> | ||
</children> | ||
</fx:root> |
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 |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package ground.station; | ||
|
||
import eu.hansolo.medusa.Gauge; | ||
import java.io.IOException; | ||
import java.net.URL; | ||
import java.util.ResourceBundle; | ||
import java.util.logging.Level; | ||
import java.util.logging.Logger; | ||
import javafx.collections.FXCollections; | ||
import javafx.fxml.FXML; | ||
import javafx.fxml.FXMLLoader; | ||
import javafx.fxml.Initializable; | ||
import javafx.scene.control.ComboBox; | ||
import javafx.scene.layout.HBox; | ||
|
||
/** | ||
* FXML Controller class | ||
* | ||
* @author Siddhesh Rane | ||
*/ | ||
public class MotorController extends HBox implements Initializable { | ||
|
||
@FXML | ||
private Gauge flMotor; | ||
@FXML | ||
private Gauge rlMotor; | ||
@FXML | ||
private Gauge throttle; | ||
@FXML | ||
private Gauge frMotor; | ||
@FXML | ||
private Gauge rrMotor; | ||
|
||
public MotorController() { | ||
FXMLLoader loader = new FXMLLoader(SensorPlotter.class.getResource("Motor.fxml")); | ||
loader.setRoot(this); | ||
loader.setController(this); | ||
try { | ||
loader.load(); | ||
} catch (IOException ex) { | ||
Logger.getLogger(SensorPlotter.class.getName()).log(Level.SEVERE, null, ex); | ||
} | ||
} | ||
|
||
/** | ||
* Initializes the controller class. | ||
*/ | ||
@Override | ||
public void initialize(URL url, ResourceBundle rb) { | ||
ComboBox<Gauge.SkinType> skinType = new ComboBox<>(FXCollections.observableArrayList(Gauge.SkinType.values())); | ||
skinType.setOnAction(ae->{throttle.setSkinType(skinType.getValue());}); | ||
} | ||
|
||
public void processSensorData(SerialDevice.SensorData sensorData) { | ||
flMotor.setValue(sensorData.motorFL - 1000); | ||
frMotor.setValue(sensorData.motorFR - 1000); | ||
rrMotor.setValue(sensorData.motorRR - 1000); | ||
rlMotor.setValue(sensorData.motorRL - 1000); | ||
throttle.setValue(sensorData.rcThrottle); | ||
throttle.setSubTitle(sensorData.rcMode < 1500 ? "OFF" : "ON"); | ||
} | ||
} |
Oops, something went wrong.