Skip to content

Commit

Permalink
Changes on the LogPanel has been done
Browse files Browse the repository at this point in the history
Signed-off-by: Victor Hertel <victor.hertel@web.de>
  • Loading branch information
vhertel committed Aug 26, 2017
1 parent d265888 commit 46ceaec
Show file tree
Hide file tree
Showing 12 changed files with 512 additions and 420 deletions.
Expand Up @@ -424,7 +424,7 @@ public static boolean rebuildGui(String path, String pathMod, Stage stage) throw
GuiBuilder.logPanelBuilder("fxml/LogPanel.fxml", path);
GuiBuilder.logPanelControlBuilder("gui/controller/LogPanelController.java", path);
GuiBuilder.mainFrameBuilder("fxml/MainFrame.fxml", path);
GuiBuilder.StateBuilder("fxml/StatePanel.fxml", path);
GuiBuilder.StatePanelBuilder("fxml/StatePanel.fxml", path);
GuiBuilder.statePanelControlBuilder("gui/controller/StatePanelController.java", path);

System.out.println("FXML has been reseted and regenerated completely.");
Expand Down Expand Up @@ -453,7 +453,7 @@ public static boolean rebuildGui(String path, String pathMod, Stage stage) throw
// Checks if STATE PROPERTIES has been modified since last compilation
if (statePanelMod) {
GuiBuilder.mainFrameBuilder("fxml/MainFrame.fxml", path);
GuiBuilder.StateBuilder("fxml/StatePanel.fxml", path);
GuiBuilder.StatePanelBuilder("fxml/StatePanel.fxml", path);
GuiBuilder.statePanelControlBuilder("gui/controller/StatePanelController.java", path);
}
rebuildGui = true;
Expand Down

Large diffs are not rendered by default.

@@ -1,23 +1,31 @@
package com.ksatstuttgart.usoc.gui.controller;
package com.ksatstuttgart.usoc.gui.controller;

import java.net.URL;
import java.util.ResourceBundle;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import com.ksatstuttgart.usoc.controller.communication.SerialComm;
import com.ksatstuttgart.usoc.controller.communication.MailReceiver;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;

// Imports for serialLog or iridiumLog
import com.ksatstuttgart.usoc.controller.MainController;
import java.util.ArrayList;
import com.ksatstuttgart.usoc.controller.MessageController;
import com.ksatstuttgart.usoc.data.DataSource;
import com.ksatstuttgart.usoc.data.ErrorEvent;
import com.ksatstuttgart.usoc.data.MailEvent;
import com.ksatstuttgart.usoc.data.SerialEvent;
import com.ksatstuttgart.usoc.data.USOCEvent;
import javafx.fxml.Initializable;
import javafx.scene.control.ComboBox;
import javafx.scene.control.TextArea;
import javax.mail.Address;

// Specific imports for serialLog
import com.ksatstuttgart.usoc.controller.communication.SerialComm;
import java.util.ArrayList;
import com.ksatstuttgart.usoc.data.SerialEvent;
import javafx.scene.control.ComboBox;

// Specific imports for iridiumLog
import com.ksatstuttgart.usoc.controller.communication.MailReceiver;
import com.ksatstuttgart.usoc.data.MailEvent;
import java.util.Date;
import javafx.scene.control.Label;
import javax.mail.Address;

/**
*
Expand Down Expand Up @@ -60,6 +68,10 @@ private void serialSendCommand(ActionEvent event) {
}

@FXML private TextArea iridiumTextArea;
@FXML private Label iridiumLastFrom;
@FXML private Label iridiumLastSubject;
@FXML private Label iridiumLastFilename;
@FXML private Label iridiumLastTimestamp;

@FXML
private void iridiumOpen(ActionEvent event) {
Expand All @@ -85,6 +97,34 @@ private void iridiumReconnect(ActionEvent event) {
MailReceiver.getInstance().reconnect();
}

@Override
public void updateData(MessageController msgController, USOCEvent ue) {
if (ue instanceof MailEvent) {
MailEvent e = (MailEvent) ue;
String s = "";
for (Address from : e.getFrom()) {
s += "," + from.toString();
}
//Setting label texts
iridiumLastFrom.setText(s.substring(1));
iridiumLastSubject.setText(e.getSubject());
iridiumLastFilename.setText(e.getFilename());
iridiumLastTimestamp.setText(new Date(e.getTimeStampGmail()).toString());
iridiumTextArea.setText(msgController.getData().toString());
} else if (ue instanceof SerialEvent) {
serialTextArea.setText(((SerialEvent)ue).getMsg());
} else if (ue instanceof ErrorEvent) {
if (DataSource.MAIL == ue.getDataSource()) {
iridiumTextArea.setText(((ErrorEvent) ue).getErrorMessage());
} else if (DataSource.SERIAL == ue.getDataSource()) {
serialTextArea.setText(((ErrorEvent) ue).getErrorMessage());
}
} else {
serialTextArea.setText(msgController.getData().toString());
iridiumTextArea.setText(msgController.getData().toString());
}
}

@FXML
private void button11(ActionEvent event) {
// Automatically generated method button11()
Expand All @@ -109,41 +149,11 @@ private void button26(ActionEvent event) {
System.out.println("Button26 was pressed!");
}

@Override
public void updateData(MessageController msgController, USOCEvent ue) {
if (ue instanceof MailEvent) {
MailEvent e = (MailEvent) ue;
String s = "";
for (Address from : e.getFrom()) {
s += "," + from.toString();
}
//Setting label texts
//lastFrom.setText(s.substring(1));
//lastSubject.setText(e.getSubject());
//lastFilename.setText(e.getFilename());
//lastTimestamp.setText(new Date(e.getTimeStampGmail()).toString());

//TODO: change this to iridiumTextArea
serialTextArea.setText(msgController.getData().toString());
} else if (ue instanceof SerialEvent) {
serialTextArea.setText(((SerialEvent)ue).getMsg());
} else if (ue instanceof ErrorEvent) {
if (DataSource.MAIL == ue.getDataSource()) {
//TODO: change this to iridiumTextArea
serialTextArea.setText(((ErrorEvent) ue).getErrorMessage());
} else if (DataSource.SERIAL == ue.getDataSource()) {
serialTextArea.setText(((ErrorEvent) ue).getErrorMessage());
}
} else {
serialTextArea.setText(msgController.getData().toString());
}
}

@Override
public void initialize(URL url, ResourceBundle rb) {
// TODO
// TODO
MainController.startPortThread(this);
MainController.getInstance().addDataUpdateListener(new UpdateListener());
setData();
setData();
}
}
Expand Up @@ -9,6 +9,7 @@
import com.ksatstuttgart.usoc.data.message.Var;
import com.ksatstuttgart.usoc.data.message.dataPackage.Sensor;
import java.util.ResourceBundle;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.chart.LineChart;
import javafx.scene.chart.XYChart;
Expand Down
Expand Up @@ -19,8 +19,8 @@ public class StatePanelController implements Initializable {
@FXML Label labelExecution;
@FXML Label labelObservation;
@FXML Label labelDiagnosis;
@FXML Label labeltest1;
@FXML Label labeltest2;
@FXML Label labelTestLabel1;
@FXML Label labelTestLabel2;

public void updateStates() {
labelSafe.setText("labelSafe");
Expand All @@ -29,8 +29,8 @@ public void updateStates() {
labelExecution.setText("labelExecution");
labelObservation.setText("labelObservation");
labelDiagnosis.setText("labelDiagnosis");
labeltest1.setText("labeltest1");
labeltest2.setText("labeltest2");
labelTestLabel1.setText("labelTestLabel1");
labelTestLabel2.setText("labelTestLabel2");
}

@Override
Expand Down
Expand Up @@ -48,7 +48,7 @@ GNSS3dView = true
# Name of experiment the ground station is used for
# Mandatory: YES
# Expected input: String
experimentName = MIRKA2-RX
experimentName = MIRKA2-ICV



Expand Down Expand Up @@ -156,12 +156,12 @@ control[2][6] = button
boxTitle[1] = Mode
boxTitle[2] = Test
#
# Configurtion of boxes
# Configurtion of the labels
keyword[1][1] = Safe
keyword[1][2] = Idle
keyword[1][3] = Preparation
keyword[1][4] = Execution
keyword[1][5] = Observation
keyword[1][6] = Diagnosis
keyword[2][1] = test1
keyword[2][2] = test2
keyword[2][1] = TestLabel1
keyword[2][2] = TestLabel2
Expand Up @@ -4,30 +4,28 @@
# and modifications are not intended!
-- listing properties --
keyword[1][6]=Diagnosis
keyword[2][2]=test
keyword[2][2]=TestLabel2
serialPanel=true
boxTitle[1]=MODE
boxTitle[1]=Mode
control[1][1]=button
control[1][4]=button
x[3]=Time [s]
x[6]=Time [s]
control[2][3]=textField
promptText[2][3]=Prompt Text 2
control[2][6]=button
y[1]=Current [A]
y[1]=Temperature [°C]
bText[1][1]=Button 1
textArea[2]=false
y[4]=Current [A]
y[4]=Voltage [V]
bText[1][4]=Button 2
lText[1][2]=Label 1
bText[2][6]=Text
lText[2][4]=Label 2
keyword[1][2]=Idle
chartTitle[3]=Chart 3
chartTitle[3]=Time Signal
keyword[1][5]=Observation
chartTitle[6]=Chart 6
keyword[2][1]=test
statePanel=false
keyword[2][1]=TestLabel1
statePanel=true
control[1][3]=textField
x[2]=Time [s]
promptText[1][3]=Prompt Text 1
Expand All @@ -36,26 +34,25 @@ control[2][2]=label
control[2][5]=textField
promptText[2][5]=Prompt Text 3
textArea[1]=true
y[3]=Height [m]
y[6]=Height [m]
GNSS3dView=false
experimentName=PAPELL
y[3]=Time
GNSS3dView=true
experimentName=MIRKA2-ICV
iridiumPanel=true
keyword[1][1]=Safe
chartTitle[2]=Chart 2
chartTitle[2]=Pressuresensors
keyword[1][4]=Execution
chartTitle[5]=Chart 5
chartTitle[5]=IMU
boxTitle[2]=Test
control[1][2]=label
x[1]=Time [s]
x[4]=Time [s]
control[2][1]=button
control[2][4]=label
y[2]=Power [W]
y[5]=Power [W]
y[2]=Pressure [kPa]
y[5]=Quaternions
RESET=false
bText[2][1]=Button 3
lText[2][2]=Label 2
chartTitle[1]=Chart 1
chartTitle[1]=Thermocouples
keyword[1][3]=Preparation
chartTitle[4]=Chart 4
chartTitle[4]=Battery Voltage

0 comments on commit 46ceaec

Please sign in to comment.