Skip to content

Commit

Permalink
Moved timmer
Browse files Browse the repository at this point in the history
  • Loading branch information
aed10006 committed May 1, 2015
1 parent f2015d8 commit 32dcca8
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 29 deletions.
Binary file modified bin/InputOutput/InputOutput.class
Binary file not shown.
11 changes: 3 additions & 8 deletions bin/interface_xml_files/Thermocontroller.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
<Font name="Helvetica Neue Light" size="50.0" />
</font>
</Label>
<Label fx:id="temp" layoutX="268.0" layoutY="134.0" text="73 ˚F" AnchorPane.bottomAnchor="66.0">
<Label fx:id="temp" layoutX="251.0" layoutY="132.0" text="73 ˚F" AnchorPane.bottomAnchor="92.0">
<font>
<Font name="Helvetica Neue" size="13.0" />
</font>
</Label>
<Slider fx:id="slider" layoutX="112.0" layoutY="133.0" max="85.0" min="50.0" prefHeight="16.0" prefWidth="133.0" value="69.0" AnchorPane.bottomAnchor="67.0" />
<Slider fx:id="slider" layoutX="104.0" layoutY="133.0" max="85.0" min="50.0" prefHeight="16.0" prefWidth="133.0" value="69.0" AnchorPane.bottomAnchor="94.0" />
<Separator layoutX="81.0" layoutY="181.0" prefWidth="200.0" AnchorPane.leftAnchor="20.0" AnchorPane.rightAnchor="20.0" />
<Label layoutX="104.0" layoutY="184.0" text="System Mode: " AnchorPane.bottomAnchor="10.0">
<font>
Expand All @@ -30,11 +30,6 @@
</font>
</Label>
<Separator layoutX="21.0" layoutY="107.0" prefHeight="3.0" prefWidth="299.0" />
<TextField layoutX="165.0" layoutY="109.0" />
<Label fx:id="thermostatLabel" layoutX="38.0" layoutY="112.0" text="Thermostat Name:">
<font>
<Font size="14.0" />
</font>
</Label>
</children>
</AnchorPane>

Binary file modified bin/testing/Networking_Test.class
Binary file not shown.
Binary file modified bin/testing/TestforIO.class
Binary file not shown.
Binary file modified bin/testing/ThermostatTest.class
Binary file not shown.
Binary file modified bin/thermostat/Sensorable.class
Binary file not shown.
Binary file modified bin/thermostat/TemperatureSensor.class
Binary file not shown.
Binary file modified bin/thermostat/ThermostatDevice.class
Binary file not shown.
21 changes: 8 additions & 13 deletions src/InputOutput/Thermocontroller.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
public class Thermocontroller implements Initializable{

public boolean slide = false;
public String _enteredSerial;
server _server;
Timer _timer;

Expand All @@ -40,9 +39,6 @@ public class Thermocontroller implements Initializable{
@FXML
private Label temp;

@FXML
private TextField thermostatName;

@FXML
private Label heating;
@Override
Expand All @@ -54,8 +50,6 @@ public void initialize(URL arg0, ResourceBundle arg1) {
public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
System.out.println("Sliding");
slide = true;
_enteredSerial = thermostatName.getText();
_server.setDesiredTempForSerialNumber(_enteredSerial, Double.toString(slider.getValue()));
temp.setText(newValue.intValue() + "");
if (slider.getValue() <= 60.0){
heating.setText("cooling");
Expand All @@ -65,15 +59,16 @@ public void changed(ObservableValue<? extends Number> observable, Number oldValu
heating.setText("heating");
heating.setTextFill(Color.RED);
}
_timer = new Timer();
_timer.schedule(new TimerTask() {
public void run() {
String currentTempFromServer = _server.getCurrentTempFromSerialNumber(_enteredSerial);
currentTemp.setText(currentTempFromServer);
}
}, 90*10000, 90*1000);

}
});
_timer = new Timer();
_timer.schedule(new TimerTask() {
public void run() {
currentTemp.setText("");
System.out.println("temp changed");
}
}, 90*10, 90*10);
}

public boolean getSlide(){
Expand Down
11 changes: 3 additions & 8 deletions src/interface_xml_files/Thermocontroller.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
<Font name="Helvetica Neue Light" size="50.0" />
</font>
</Label>
<Label fx:id="temp" layoutX="268.0" layoutY="134.0" text="73 ˚F" AnchorPane.bottomAnchor="66.0">
<Label fx:id="temp" layoutX="251.0" layoutY="132.0" text="73 ˚F" AnchorPane.bottomAnchor="92.0">
<font>
<Font name="Helvetica Neue" size="13.0" />
</font>
</Label>
<Slider fx:id="slider" layoutX="112.0" layoutY="133.0" max="85.0" min="50.0" prefHeight="16.0" prefWidth="133.0" value="69.0" AnchorPane.bottomAnchor="67.0" />
<Slider fx:id="slider" layoutX="104.0" layoutY="133.0" max="85.0" min="50.0" prefHeight="16.0" prefWidth="133.0" value="69.0" AnchorPane.bottomAnchor="94.0" />
<Separator layoutX="81.0" layoutY="181.0" prefWidth="200.0" AnchorPane.leftAnchor="20.0" AnchorPane.rightAnchor="20.0" />
<Label layoutX="104.0" layoutY="184.0" text="System Mode: " AnchorPane.bottomAnchor="10.0">
<font>
Expand All @@ -30,11 +30,6 @@
</font>
</Label>
<Separator layoutX="21.0" layoutY="107.0" prefHeight="3.0" prefWidth="299.0" />
<TextField layoutX="165.0" layoutY="109.0" />
<Label fx:id="thermostatLabel" layoutX="38.0" layoutY="112.0" text="Thermostat Name:">
<font>
<Font size="14.0" />
</font>
</Label>
</children>
</AnchorPane>

0 comments on commit 32dcca8

Please sign in to comment.