diff --git a/eeprom.json b/eeprom.json index 4969254..0e0dcd2 100644 --- a/eeprom.json +++ b/eeprom.json @@ -1 +1,3 @@ -{"0":255} \ No newline at end of file +{ + +} \ No newline at end of file diff --git a/src/main/java/fabrik/simulator/pic16f84/Controller_Frontend.java b/src/main/java/fabrik/simulator/pic16f84/Controller_Frontend.java index 978be1d..ef94a29 100644 --- a/src/main/java/fabrik/simulator/pic16f84/Controller_Frontend.java +++ b/src/main/java/fabrik/simulator/pic16f84/Controller_Frontend.java @@ -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 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, ListCell> createBreakpointCell() { return listView -> new ListCell() { 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()); - }