Introduce ExecutionTimeSubject
This commit is contained in:
@ -38,7 +38,7 @@ import java.util.Set;
|
||||
|
||||
import static java.lang.Math.max;
|
||||
|
||||
public class Controller_Frontend extends PICComponent implements FrontendControllerInterface {
|
||||
public class Controller_Frontend extends PICComponent implements FrontendControllerInterface, ExecutionTimeObserver {
|
||||
|
||||
private int [] prog;
|
||||
private int [][] read;
|
||||
@ -165,7 +165,7 @@ public class Controller_Frontend extends PICComponent implements FrontendControl
|
||||
|
||||
private void updateExecutionTimeMultiplier() {
|
||||
String selectedOption = executionTimeComboBox.getValue();
|
||||
commands.setExecutionTimeMultiplier(selectedOption);
|
||||
executionTime.setExecutionTimeMultiplier(selectedOption);
|
||||
}
|
||||
|
||||
@FXML
|
||||
@ -226,10 +226,9 @@ public class Controller_Frontend extends PICComponent implements FrontendControl
|
||||
ioPorts.refreshUI(getTRISbuttons(), getPORTbuttons());
|
||||
updateStack();
|
||||
updateWatchdog();
|
||||
double totalExecutionTime = commands.getTotalExecutionTime();
|
||||
totalExecutionTimeLabel.setText("Total Execution Time: " + totalExecutionTime + "µs");
|
||||
}
|
||||
|
||||
|
||||
private void markSelectedRow(int currentIndex, String selectedRowStyle) {
|
||||
lstContentListView.setCellFactory(column -> new ListCell<String>() {
|
||||
@Override
|
||||
@ -284,7 +283,7 @@ public class Controller_Frontend extends PICComponent implements FrontendControl
|
||||
ExecutionState.wakeUp();
|
||||
breakpoints.clear();
|
||||
ioPorts.refreshUI(getTRISbuttons(), getPORTbuttons());
|
||||
commands.resetTotalExecutionTime();
|
||||
executionTime.resetTotalExecutionTime();
|
||||
watchdogTimer.reset();
|
||||
wdtCheck.setSelected(false);
|
||||
table.refresh();
|
||||
@ -570,5 +569,10 @@ public class Controller_Frontend extends PICComponent implements FrontendControl
|
||||
this.picComponents = locator;
|
||||
System.out.println("Frontend");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void executionTimeChanged() {
|
||||
totalExecutionTimeLabel.setText("Total Execution Time: " + executionTime.getTotalExecutionTime() + "µs");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user