Breakpoint visible

This commit is contained in:
2024-06-02 23:14:27 +02:00
parent 7440329d91
commit 0b163589db
2 changed files with 20 additions and 17 deletions

View File

@ -1 +1,3 @@
{"0":255}
{
}

View File

@ -147,8 +147,7 @@ public class Controller_Frontend {
@FXML
public void autoRunGUI(ActionEvent event) {
if (!isAutoRunActive) {
isAutoRunActive = true;
initializeBreakpoints();
isAutoRunActive = true;
}
Thread autoRunThread = new Thread(() -> {
@ -217,18 +216,18 @@ public class Controller_Frontend {
// Überprüfung ob ein Breakpoint gesetzt ist testte
if (breakpoints.contains(currentIndex)) {
if (breakpoints.contains(currentIndex) && !continueExecutionAfterBreakpoint){
if (!continueExecutionAfterBreakpoint){
isBreakpointReached = true;
stopAutoRun(null);
System.out.println("Breakpoint erreicht bei Zeile: " + currentIndex);
continueExecutionAfterBreakpoint = true;
return;
}
}
initializeBreakpoints();
else {
isBreakpointReached = false;
continueExecutionAfterBreakpoint = false;
}
// Scrollen zur ausgewählten Zeile
lstContentListView.scrollTo(currentIndex -2);
@ -245,15 +244,12 @@ public class Controller_Frontend {
markSelectedRow(currentIndex, selectedRowStyle);
if (!isSleeping) {
Commands.decode(prog[DataRegister.getPC()]);
DataRegister.increasePC();
}
else {
Commands.decode(0);
}
WatchdogTimer.testAndTrigger();
Table.refresh();
@ -277,11 +273,21 @@ public class Controller_Frontend {
} else {
setStyle("");
}
CheckBox breakpointCheckBox = new CheckBox();
breakpointCheckBox.setOnAction(event -> {
int index = getIndex();
if (breakpointCheckBox.isSelected()) {
breakpoints.add(index);
} else {
breakpoints.remove(index);
}
});
breakpointCheckBox.setSelected(breakpoints.contains(getIndex()));
setGraphic(breakpointCheckBox);
}
});
}
//////////////testeteet
private Set<Integer> breakpoints = new HashSet<>();
@ -294,7 +300,6 @@ public class Controller_Frontend {
String fileAddress = selectedFile.getAbsolutePath();
DataRegister.initDataRegister();
DataRegister.resetPC();
initialize();
toggleLEDs(null);
IOPorts.reset();
@ -305,7 +310,6 @@ public class Controller_Frontend {
IOPorts.setPORTfromUI(toggleButtonGroup);
} catch (NullPointerException ignored) {}
}
initializeBreakpoints();
breakpoints.clear();
IOPorts.refreshUI(getTRISbuttons(), getPORTbuttons());
Commands.resetTotalExecutionTime();
@ -349,7 +353,6 @@ public class Controller_Frontend {
private Callback<ListView<String>, ListCell<String>> createBreakpointCell() {
return listView -> new ListCell<String>() {
private final CheckBox breakpointCheckBox = new CheckBox();
{
breakpointCheckBox.setOnAction(event -> {
int index = getIndex();
@ -500,8 +503,6 @@ public class Controller_Frontend {
executionTimeComboBox.setItems(FXCollections.observableArrayList("8 MHZ", "4 MHZ", "1 MHZ", "500 HZ", "100 HZ", "32 HZ"));
executionTimeComboBox.setValue("4 MHZ");
executionTimeComboBox.setOnAction(event -> updateExecutionTimeMultiplier());
lstContentListView.setCellFactory(createBreakpointCell());
}