Skip to content

Commit

Permalink
Merge remote-tracking branch 'Tainfante_origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
opetany93 committed Jan 13, 2018
2 parents e056ad7 + dacf1ef commit 90b4c0d
Show file tree
Hide file tree
Showing 5 changed files with 414 additions and 71 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 38 additions & 2 deletions src/mainwindow/Channel.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@

import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.control.Alert;
import javafx.scene.control.ChoiceBox;
import javafx.scene.control.ColorPicker;
import javafx.scene.control.TextField;
import javafx.scene.paint.Color;
import javafx.stage.Stage;

import java.net.URL;
import java.util.ResourceBundle;
Expand Down Expand Up @@ -35,10 +38,43 @@ public void initialize(URL location, ResourceBundle resources) {
}

public void onSetAction(ActionEvent actionEvent) {
String channel=(String)channelBox.getSelectionModel().getSelectedItem();
String channel=new String();
String name=nameText.getText();
String units=unitText.getText();
Color color=colorPicker.getValue();

try{
channel=(String)channelBox.getSelectionModel().getSelectedItem();
if(channel.equals("Channel 1")){
Chart.getInstance().channelUpdate(1,name+" ["+units+"]",color);
}
else if(channel.equals("Channel 2")){
Chart.getInstance().channelUpdate(2,name+" ["+units+"]",color);
}
else if(channel.equals("Channel 3")){
Chart.getInstance().channelUpdate(3,name+" ["+units+"]", color);
}
else if(channel.equals("Channel 4")){
Chart.getInstance().channelUpdate(4,name+" ["+units+"]", color);
}
else if(channel.equals("Channel 5")){
Chart.getInstance().channelUpdate(5,name+" ["+units+"]", color);
}
else if(channel.equals("Channel 6")){
Chart.getInstance().channelUpdate(6,name+" ["+units+"]", color);
}
else if(channel.equals("Channel 7")){
Chart.getInstance().channelUpdate(7,name+" ["+units+"]", color);
}
else if(channel.equals("Channel 8")){
Chart.getInstance().channelUpdate(8,name+" ["+units+"]", color);
}
}
catch(NullPointerException exe){
Alert alert = new Alert(Alert.AlertType.ERROR);
alert.setTitle("Channel has not been chosen");
alert.setHeaderText("To submit channel settings you have to choose a channel");
alert.setContentText("Please, choose a channel");
alert.showAndWait();
}
}
}
Loading

0 comments on commit 90b4c0d

Please sign in to comment.