Permalink
Browse files

Iridium log has been updated. State panel is now optional

Signed-off-by: Victor Hertel <victor.hertel@web.de>
  • Loading branch information...
vhertel committed Aug 6, 2017
1 parent 38993ef commit e397278367094be62c627254dc661bef6ffd6739
@@ -25,6 +25,13 @@
import com.ksatstuttgart.usoc.controller.MainController;
import com.ksatstuttgart.usoc.gui.MainFrame;
import java.io.IOException;
import java.net.URL;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
/**
* <h1>Ground Segment</h1>
@@ -36,15 +43,46 @@
* @author Valentin Starlinger
* @version 1.0
*/
public class GroundSegment {
public class GroundSegment extends Application {
/**
* Calls the MainFrame class
* @param args - does not support any arguments.
* @param stage
*/
@Override
public void start(Stage stage) {
try {
MainController.getInstance().setFrame(new MainFrame());
MainController.getInstance().connectToMail();
/**
* Checks whether a regeneration of the FXML structure is
* necessary and carries it out in case it is
*/
ConfigHandler.rebuildGui("config/config.properties", "config/configMod.properties");
// JavaFX GUI
String fxmlFile = "/fxml/MainFrame.fxml";
URL location = getClass().getResource(fxmlFile);
FXMLLoader loader = new FXMLLoader( );
loader.setLocation( location );
Parent root = (Parent) loader.load();
Scene scene = new Scene(root);
stage.setScene(scene);
stage.show();
} catch (IOException e) {
System.out.println(e);
}
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
MainController.getInstance().setFrame(new MainFrame());
MainController.getInstance().connectToMail();
launch(args);
}
}
@@ -458,62 +458,68 @@ public static void currentStateBuilder(String filePath, String configPath) throw
// Declares necessary parameters
Properties config = ConfigHandler.getAllValues(configPath);
boolean statePanel = Boolean.parseBoolean(config.getProperty("statePanel"));
int numberOfBoxes = ConfigHandler.countItems("boxTitle", configPath);
String path = "src/main/resources/";
// Writes data in CurrentStatePanel.fxml file
PrintWriter writer = new PrintWriter(path + filePath);
writer.println("<?import javafx.scene.control.*?> \n"
+ "<?import javafx.scene.layout.*?> \n");
writer.println("<ScrollPane prefHeight=\"200.0\" prefWidth=\"200.0\" BorderPane.alignment=\"CENTER\"> \n"
+ " <content> \n"
+ " <VBox prefHeight=\"200.0\" prefWidth=\"100.0\"> \n"
+ " <children>");
// Generates boxes
for (int counter=1; counter<=numberOfBoxes; counter++) {
writer.println(" <GridPane> \n"
+ " <columnConstraints> \n"
+ " <ColumnConstraints hgrow=\"SOMETIMES\" minWidth=\"10.0\" prefWidth=\"100.0\" /> \n"
+ " <ColumnConstraints hgrow=\"SOMETIMES\" minWidth=\"10.0\" prefWidth=\"100.0\" /> \n"
+ " </columnConstraints> \n"
+ " <rowConstraints>");
// Declares necessary parameters
int numberOfValues = ConfigHandler.countItems("keyword[" + counter + "]", configPath);
int numberOfRows;
// Sets number of rows depending on required number of control items
if (numberOfValues%2 == 0) {
numberOfRows = numberOfValues/2;
} else {
numberOfRows = (numberOfValues + 1)/2;
}
// Writes FXML data
for (int i=1; i<=numberOfRows; i++) {
writer.println(" <RowConstraints minHeight=\"10.0\" prefHeight=\"30.0\" vgrow=\"SOMETIMES\" />");
}
writer.println(" </rowConstraints> \n"
+ " <children> \n"
+ " <Label text=\"" + config.getProperty("boxTitle[" + counter + "]") + "\" GridPane.columnIndex=\"0\" GridPane.rowIndex=\"0\" />");
// Writes FXML data of box content
for (int j=1; j<=numberOfValues; j++) {
String keyword = config.getProperty("keyword[" + counter + "][" + j + "]");
writer.println(" <Label text=\"" + keyword + "\" GridPane.columnIndex=\"0\" GridPane.rowIndex=\"" + j + "\" />");
if (statePanel) {
writer.println("<?import javafx.scene.control.*?> \n"
+ "<?import javafx.scene.layout.*?> \n");
writer.println("<ScrollPane prefHeight=\"200.0\" prefWidth=\"200.0\" BorderPane.alignment=\"CENTER\"> \n"
+ " <content> \n"
+ " <VBox prefHeight=\"200.0\" prefWidth=\"100.0\"> \n"
+ " <children>");
// Generates boxes
for (int counter=1; counter<=numberOfBoxes; counter++) {
writer.println(" <GridPane> \n"
+ " <columnConstraints> \n"
+ " <ColumnConstraints hgrow=\"SOMETIMES\" minWidth=\"10.0\" prefWidth=\"100.0\" /> \n"
+ " <ColumnConstraints hgrow=\"SOMETIMES\" minWidth=\"10.0\" prefWidth=\"100.0\" /> \n"
+ " </columnConstraints> \n"
+ " <rowConstraints>");
// Declares necessary parameters
int numberOfValues = ConfigHandler.countItems("keyword[" + counter + "]", configPath);
int numberOfRows;
// Sets number of rows depending on required number of control items
if (numberOfValues%2 == 0) {
numberOfRows = numberOfValues/2;
} else {
numberOfRows = (numberOfValues + 1)/2;
}
// Writes FXML data
for (int i=1; i<=numberOfRows; i++) {
writer.println(" <RowConstraints minHeight=\"10.0\" prefHeight=\"30.0\" vgrow=\"SOMETIMES\" />");
}
writer.println(" </rowConstraints> \n"
+ " <children> \n"
+ " <Label text=\"" + config.getProperty("boxTitle[" + counter + "]") + "\" GridPane.columnIndex=\"0\" GridPane.rowIndex=\"0\" />");
// Writes FXML data of box content
for (int j=1; j<=numberOfValues; j++) {
String keyword = config.getProperty("keyword[" + counter + "][" + j + "]");
writer.println(" <Label text=\"" + keyword + "\" GridPane.columnIndex=\"0\" GridPane.rowIndex=\"" + j + "\" />");
}
writer.println(" </children> \n"
+ " </GridPane>");
}
writer.println(" </children> \n"
+ " </GridPane>");
writer.println(" </children> \n"
+ " </VBox> \n"
+ " </content> \n"
+ "</ScrollPane>");
// Prints status update
System.out.println("Data panel has been updated!");
} else {
writer.println("");
}
writer.println(" </children> \n"
+ " </VBox> \n"
+ " </content> \n"
+ "</ScrollPane>");
writer.close();
// Prints status update
System.out.println("Data panel has been updated!");
writer.close();
}
}
@@ -36,6 +36,13 @@ RESET = true
#
#
statePanel = true
GNSS3dView = true
# Name of experiment the ground station is used for
# Mandatory: YES
# Expected input: String
@@ -56,17 +56,29 @@
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label text="Last message from:" GridPane.columnIndex="0" GridPane.rowIndex="0" />
<Label text="Subject:" GridPane.columnIndex="0" GridPane.rowIndex="1" />
<Label text="Filename:" GridPane.columnIndex="0" GridPane.rowIndex="2" />
<Label text="Received at:" GridPane.columnIndex="0" GridPane.rowIndex="3" />
<Label text="Label" GridPane.columnIndex="1" GridPane.rowIndex="0" />
<Label text="Label" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<Label text="Label" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<Label text="Label" GridPane.columnIndex="1" GridPane.rowIndex="3" />
<Button text="Reconnect" onAction="#iridiumReconnect" GridPane.columnIndex="1" GridPane.rowIndex="4" />
<Label text="Add file:" GridPane.columnIndex="0" GridPane.rowIndex="4" />
<Button text="Clear Data" GridPane.columnIndex="0" GridPane.rowIndex="5" />
<Label text="#Masseges on reconnect:" GridPane.columnIndex="0" GridPane.rowIndex="6" />
<Button text="exportCSV" GridPane.columnIndex="0" GridPane.rowIndex="7" />
<Label text="" GridPane.columnIndex="1" GridPane.rowIndex="0" />
<Label text="" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<Label text="" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<Label text="" GridPane.columnIndex="1" GridPane.rowIndex="3" />
<Button text="Open" GridPane.columnIndex="1" GridPane.rowIndex="4" />
<Label text="" GridPane.columnIndex="1" GridPane.rowIndex="5" />
<TextField GridPane.columnIndex="1" GridPane.rowIndex="6" />
<Button text="Reconnect" onAction="#iridiumReconnect" GridPane.columnIndex="1" GridPane.rowIndex="7" />
</children>
</GridPane>
</top>
@@ -13,17 +13,29 @@
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label text="Last message from:" GridPane.columnIndex="0" GridPane.rowIndex="0" />
<Label text="Subject:" GridPane.columnIndex="0" GridPane.rowIndex="1" />
<Label text="Filename:" GridPane.columnIndex="0" GridPane.rowIndex="2" />
<Label text="Received at:" GridPane.columnIndex="0" GridPane.rowIndex="3" />
<Label text="Label" GridPane.columnIndex="1" GridPane.rowIndex="0" />
<Label text="Label" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<Label text="Label" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<Label text="Label" GridPane.columnIndex="1" GridPane.rowIndex="3" />
<Button text="Reconnect" onAction="#iridiumReconnect" GridPane.columnIndex="1" GridPane.rowIndex="4" />
<Label text="Add file:" GridPane.columnIndex="0" GridPane.rowIndex="4" />
<Button text="Clear Data" GridPane.columnIndex="0" GridPane.rowIndex="5" />
<Label text="#Masseges on reconnect:" GridPane.columnIndex="0" GridPane.rowIndex="6" />
<Button text="exportCSV" GridPane.columnIndex="0" GridPane.rowIndex="7" />
<Label text="" GridPane.columnIndex="1" GridPane.rowIndex="0" />
<Label text="" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<Label text="" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<Label text="" GridPane.columnIndex="1" GridPane.rowIndex="3" />
<Button text="Open" GridPane.columnIndex="1" GridPane.rowIndex="4" />
<Label text="" GridPane.columnIndex="1" GridPane.rowIndex="5" />
<TextField GridPane.columnIndex="1" GridPane.rowIndex="6" />
<Button text="Reconnect" onAction="#iridiumReconnect" GridPane.columnIndex="1" GridPane.rowIndex="7" />
</children>
</GridPane>
</top>
@@ -1,41 +1 @@
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<ScrollPane prefHeight="200.0" prefWidth="200.0" BorderPane.alignment="CENTER">
<content>
<VBox prefHeight="200.0" prefWidth="100.0">
<children>
<GridPane>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label text="firstTitle" GridPane.columnIndex="0" GridPane.rowIndex="0" />
<Label text="keyword" GridPane.columnIndex="0" GridPane.rowIndex="1" />
<Label text="keyword" GridPane.columnIndex="0" GridPane.rowIndex="2" />
<Label text="keyword" GridPane.columnIndex="0" GridPane.rowIndex="3" />
</children>
</GridPane>
<GridPane>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label text="secondTitle" GridPane.columnIndex="0" GridPane.rowIndex="0" />
<Label text="keyword" GridPane.columnIndex="0" GridPane.rowIndex="1" />
<Label text="keyword" GridPane.columnIndex="0" GridPane.rowIndex="2" />
</children>
</GridPane>
</children>
</VBox>
</content>
</ScrollPane>

0 comments on commit e397278

Please sign in to comment.