Compare commits
4 Commits
03941fc302
...
3ae042e0bb
| Author | SHA1 | Date | |
|---|---|---|---|
| 3ae042e0bb | |||
| cf6bcd8498 | |||
| 85bc6e9eba | |||
| 06e9348016 |
@ -1,7 +1,8 @@
|
|||||||
package fabrik.simulator.pic16f84;
|
package fabrik.simulator.pic16f84;
|
||||||
|
|
||||||
import fabrik.simulator.pic16f84.interfaces.*;
|
import fabrik.simulator.pic16f84.interfaces.*;
|
||||||
|
|
||||||
public class Commands extends PICComponent implements CommandInterface {
|
public class Commands extends ExecutionTimeSubject implements CommandInterface {
|
||||||
private int wRegister;
|
private int wRegister;
|
||||||
private long totalExecutionTime;
|
private long totalExecutionTime;
|
||||||
private double executionTimeMultiplier = 1;
|
private double executionTimeMultiplier = 1;
|
||||||
@ -18,16 +19,17 @@ public class Commands extends PICComponent implements CommandInterface {
|
|||||||
|
|
||||||
public void addExecutionTime(int i) {
|
public void addExecutionTime(int i) {
|
||||||
totalExecutionTime += i;
|
totalExecutionTime += i;
|
||||||
timer.cycles(i);
|
super.notifyObservers();
|
||||||
eeprom.registerTime(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public double getTotalExecutionTime() {
|
public double getTotalExecutionTime() {
|
||||||
return (totalExecutionTime * getExecutionTimeMultiplier());
|
return (totalExecutionTime * getExecutionTimeMultiplier());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void resetTotalExecutionTime() {
|
public void resetTotalExecutionTime() {
|
||||||
totalExecutionTime = 0;
|
totalExecutionTime = 0;
|
||||||
|
super.notifyObservers();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -252,7 +254,7 @@ public class Commands extends PICComponent implements CommandInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void SLEEP() {
|
public void SLEEP() {
|
||||||
frontendController.sleep();
|
ExecutionState.sleep();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RETFIE() {
|
public void RETFIE() {
|
||||||
@ -556,10 +558,12 @@ public class Commands extends PICComponent implements CommandInterface {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public double getExecutionTimeMultiplier(){
|
public double getExecutionTimeMultiplier(){
|
||||||
return executionTimeMultiplier;
|
return executionTimeMultiplier;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setExecutionTimeMultiplier(String option){
|
public void setExecutionTimeMultiplier(String option){
|
||||||
switch (option) {
|
switch (option) {
|
||||||
case "8 MHZ":
|
case "8 MHZ":
|
||||||
@ -584,11 +588,6 @@ public class Commands extends PICComponent implements CommandInterface {
|
|||||||
executionTimeMultiplier = 125;
|
executionTimeMultiplier = 125;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
super.notifyObservers();
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void initialize(PICComponentLocator locator) {
|
|
||||||
super.initialize(locator);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
package fabrik.simulator.pic16f84;
|
package fabrik.simulator.pic16f84;
|
||||||
|
|
||||||
import com.gluonhq.charm.glisten.control.ToggleButtonGroup;
|
|
||||||
|
import fabrik.simulator.pic16f84.frontendspecifics.FrontendSpecificToggleButtonGroup;
|
||||||
|
import fabrik.simulator.pic16f84.frontendspecifics.ToggleButtonGroup;
|
||||||
|
|
||||||
import fabrik.simulator.pic16f84.interfaces.*;
|
import fabrik.simulator.pic16f84.interfaces.*;
|
||||||
import javafx.application.Platform;
|
import javafx.application.Platform;
|
||||||
@ -36,7 +38,7 @@ import java.util.Set;
|
|||||||
|
|
||||||
import static java.lang.Math.max;
|
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 [] prog;
|
||||||
private int [][] read;
|
private int [][] read;
|
||||||
@ -163,7 +165,7 @@ public class Controller_Frontend extends PICComponent implements FrontendControl
|
|||||||
|
|
||||||
private void updateExecutionTimeMultiplier() {
|
private void updateExecutionTimeMultiplier() {
|
||||||
String selectedOption = executionTimeComboBox.getValue();
|
String selectedOption = executionTimeComboBox.getValue();
|
||||||
commands.setExecutionTimeMultiplier(selectedOption);
|
executionTime.setExecutionTimeMultiplier(selectedOption);
|
||||||
}
|
}
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
@ -219,15 +221,14 @@ public class Controller_Frontend extends PICComponent implements FrontendControl
|
|||||||
commands.decode(0);
|
commands.decode(0);
|
||||||
}
|
}
|
||||||
watchdogTimer.testAndTrigger();
|
watchdogTimer.testAndTrigger();
|
||||||
Table.refresh();
|
table.refresh();
|
||||||
CreateWindow.refreshTable();
|
CreateWindow.refreshTable();
|
||||||
ioPorts.refreshUI(getTRISbuttons(), getPORTbuttons());
|
ioPorts.refreshUI(getTRISbuttons(), getPORTbuttons());
|
||||||
updateStack();
|
updateStack();
|
||||||
updateWatchdog();
|
updateWatchdog();
|
||||||
double totalExecutionTime = commands.getTotalExecutionTime();
|
|
||||||
totalExecutionTimeLabel.setText("Total Execution Time: " + totalExecutionTime + "µs");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void markSelectedRow(int currentIndex, String selectedRowStyle) {
|
private void markSelectedRow(int currentIndex, String selectedRowStyle) {
|
||||||
lstContentListView.setCellFactory(column -> new ListCell<String>() {
|
lstContentListView.setCellFactory(column -> new ListCell<String>() {
|
||||||
@Override
|
@Override
|
||||||
@ -282,10 +283,10 @@ public class Controller_Frontend extends PICComponent implements FrontendControl
|
|||||||
ExecutionState.wakeUp();
|
ExecutionState.wakeUp();
|
||||||
breakpoints.clear();
|
breakpoints.clear();
|
||||||
ioPorts.refreshUI(getTRISbuttons(), getPORTbuttons());
|
ioPorts.refreshUI(getTRISbuttons(), getPORTbuttons());
|
||||||
commands.resetTotalExecutionTime();
|
executionTime.resetTotalExecutionTime();
|
||||||
watchdogTimer.reset();
|
watchdogTimer.reset();
|
||||||
wdtCheck.setSelected(false);
|
wdtCheck.setSelected(false);
|
||||||
Table.refresh();
|
table.refresh();
|
||||||
read = ParseFile.parseDatei(fileAddress);
|
read = ParseFile.parseDatei(fileAddress);
|
||||||
prog = read [0];
|
prog = read [0];
|
||||||
ind = read[1];
|
ind = read[1];
|
||||||
@ -477,27 +478,27 @@ public class Controller_Frontend extends PICComponent implements FrontendControl
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
private static void setTRISbuttons(ToggleButtonGroup[] allButtons) {
|
private void setTRISbuttons(ToggleButtonGroup[] allButtons) {
|
||||||
allTRISbuttons = allButtons;
|
allTRISbuttons = allButtons;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ToggleButtonGroup [] getTRISbuttons() {
|
public FrontendSpecificToggleButtonGroup [] getTRISbuttons() {
|
||||||
return allTRISbuttons;
|
return allTRISbuttons;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void setPORTbuttons(ToggleButtonGroup[] allButtons) {
|
private void setPORTbuttons(ToggleButtonGroup[] allButtons) {
|
||||||
allPORTbuttons = allButtons;
|
allPORTbuttons = allButtons;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ToggleButtonGroup [] getPORTbuttons() {
|
public ToggleButtonGroup [] getPORTbuttons() {
|
||||||
return allPORTbuttons;
|
return allPORTbuttons;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Circle[] getLEDsA() {
|
public Circle[] getLEDsA() {
|
||||||
return allLEDsA;
|
return allLEDsA;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Circle[] getLEDsB() {
|
public Circle[] getLEDsB() {
|
||||||
return allLEDsB;
|
return allLEDsB;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -565,11 +566,14 @@ public class Controller_Frontend extends PICComponent implements FrontendControl
|
|||||||
@Override
|
@Override
|
||||||
public void initialize(PICComponentLocator locator) {
|
public void initialize(PICComponentLocator locator) {
|
||||||
super.initialize(locator);
|
super.initialize(locator);
|
||||||
|
executionTime.registerObserver(this);
|
||||||
this.picComponents = locator;
|
this.picComponents = locator;
|
||||||
System.out.println("Frontend");
|
System.out.println("Frontend");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void executionTimeChanged() {
|
||||||
|
totalExecutionTimeLabel.setText("Total Execution Time: " + executionTime.getTotalExecutionTime() + "µs");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package fabrik.simulator.pic16f84;
|
package fabrik.simulator.pic16f84;
|
||||||
|
|
||||||
|
import fabrik.simulator.pic16f84.frontendspecifics.VBox;
|
||||||
import fabrik.simulator.pic16f84.interfaces.*;
|
import fabrik.simulator.pic16f84.interfaces.*;
|
||||||
import javafx.application.Application;
|
import javafx.application.Application;
|
||||||
|
|
||||||
@ -8,7 +9,6 @@ import javafx.scene.Parent;
|
|||||||
import javafx.scene.Scene;
|
import javafx.scene.Scene;
|
||||||
|
|
||||||
import javafx.scene.layout.GridPane;
|
import javafx.scene.layout.GridPane;
|
||||||
import javafx.scene.layout.VBox;
|
|
||||||
import javafx.stage.Stage;
|
import javafx.stage.Stage;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -17,19 +17,25 @@ import java.util.Objects;
|
|||||||
public class CreateWindow extends Application implements WindowManagement {
|
public class CreateWindow extends Application implements WindowManagement {
|
||||||
private static PICComponentLocator picComponents; // Subjekt
|
private static PICComponentLocator picComponents; // Subjekt
|
||||||
public static GridPane grid = new GridPane();
|
public static GridPane grid = new GridPane();
|
||||||
private static VBox table;
|
private TableInterface table;
|
||||||
|
private static VBox tableBox;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void start(Stage primaryStage) throws IOException {
|
public void start(Stage primaryStage) throws IOException {
|
||||||
|
picComponents.registerComponent(ToggleButtonInterface.class, new ToggleButtonGroupExt());
|
||||||
|
picComponents.registerComponent(IOPortInterface.class, new IOPorts());
|
||||||
|
picComponents.registerComponent(TableInterface.class, new Table());
|
||||||
picComponents.registerComponent(FrontendControllerInterface.class, new Controller_Frontend());
|
picComponents.registerComponent(FrontendControllerInterface.class, new Controller_Frontend());
|
||||||
picComponents.initAll();
|
picComponents.initAll();
|
||||||
|
|
||||||
|
table = picComponents.getComponent(TableInterface.class);
|
||||||
|
|
||||||
FXMLLoader codewindow = new FXMLLoader(CreateWindow.class.getResource("frontend.fxml"));
|
FXMLLoader codewindow = new FXMLLoader(CreateWindow.class.getResource("frontend.fxml"));
|
||||||
codewindow.setController(picComponents.getComponent(FrontendControllerInterface.class));
|
codewindow.setController(picComponents.getComponent(FrontendControllerInterface.class));
|
||||||
Parent code = codewindow.load();
|
Parent code = codewindow.load();
|
||||||
|
|
||||||
table = Table.init(picComponents);
|
tableBox = (VBox) table.getTable();
|
||||||
grid.add(table, 1, 1);
|
grid.add(tableBox, 1, 1);
|
||||||
grid.add(code, 0, 1);
|
grid.add(code, 0, 1);
|
||||||
|
|
||||||
grid.relocate(0, 0);
|
grid.relocate(0, 0);
|
||||||
@ -50,9 +56,11 @@ public class CreateWindow extends Application implements WindowManagement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void refreshTable() {
|
public static void refreshTable() {
|
||||||
grid.getChildren().remove(table);
|
TableInterface table = picComponents.getComponent(TableInterface.class);
|
||||||
table= Table.refresh();
|
grid.getChildren().remove(table.getTable());
|
||||||
grid.add(table, 1, 1);
|
table.refresh();
|
||||||
|
tableBox = (VBox) table.getTable();
|
||||||
|
grid.add(tableBox, 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -61,7 +69,6 @@ public class CreateWindow extends Application implements WindowManagement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public CreateWindow (){
|
public CreateWindow (){
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -60,7 +60,7 @@ public class DataRegister extends PICComponent implements DataRegisterInterface
|
|||||||
carryFlag = 0;
|
carryFlag = 0;
|
||||||
zeroFlag = 0;
|
zeroFlag = 0;
|
||||||
digitCarryFlag = 0;
|
digitCarryFlag = 0;
|
||||||
ioPorts.resetTRIS();
|
if (null != ioPorts) ioPorts.resetTRIS();
|
||||||
System.out.println(Arrays.toString(dataRegister));
|
System.out.println(Arrays.toString(dataRegister));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -13,7 +13,7 @@ import java.nio.file.Paths;
|
|||||||
|
|
||||||
import fabrik.simulator.pic16f84.interfaces.*;
|
import fabrik.simulator.pic16f84.interfaces.*;
|
||||||
|
|
||||||
public class EEPROM extends PICComponent implements EEPROMInterface {
|
public class EEPROM extends PICComponent implements EEPROMInterface, ExecutionTimeObserver {
|
||||||
private final int EEDATA = 0x08;
|
private final int EEDATA = 0x08;
|
||||||
private final int EEADR = 0x09;
|
private final int EEADR = 0x09;
|
||||||
private final int EECON1 = 0x88;
|
private final int EECON1 = 0x88;
|
||||||
@ -83,13 +83,13 @@ public class EEPROM extends PICComponent implements EEPROMInterface {
|
|||||||
dataRegister.setDirectBit(EECON1, WRERR, 1);
|
dataRegister.setDirectBit(EECON1, WRERR, 1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
registerTime(true);
|
registerTime(executionTime.getTotalExecutionTime(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void registerTime(boolean reset) {
|
public void registerTime(double executionTime, boolean reset) {
|
||||||
if (reset)
|
if (reset)
|
||||||
startTime = commands.getTotalExecutionTime();
|
startTime = executionTime;
|
||||||
else if ((commands.getTotalExecutionTime() >= (startTime + 1000)) && writeControl) {
|
else if ((executionTime >= (startTime + 1000)) && writeControl) {
|
||||||
eecon2stages = new boolean[]{false, false};
|
eecon2stages = new boolean[]{false, false};
|
||||||
dataRegister.setDirectBit(EECON1, EEIF, 1);
|
dataRegister.setDirectBit(EECON1, EEIF, 1);
|
||||||
dataRegister.setDirectBit(EECON1, WR, 0);
|
dataRegister.setDirectBit(EECON1, WR, 0);
|
||||||
@ -174,5 +174,11 @@ public class EEPROM extends PICComponent implements EEPROMInterface {
|
|||||||
@Override
|
@Override
|
||||||
public void initialize(PICComponentLocator locator) {
|
public void initialize(PICComponentLocator locator) {
|
||||||
super.initialize(locator);
|
super.initialize(locator);
|
||||||
|
executionTime.registerObserver(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void executionTimeChanged() {
|
||||||
|
registerTime(executionTime.getTotalExecutionTime(), false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,54 @@
|
|||||||
|
package fabrik.simulator.pic16f84;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
import fabrik.simulator.pic16f84.interfaces.ExecutionTimeObserver;
|
||||||
|
import fabrik.simulator.pic16f84.interfaces.PICComponentInterface;
|
||||||
|
|
||||||
|
public abstract class ExecutionTimeSubject extends PICComponent implements PICComponentInterface{
|
||||||
|
private Set<ExecutionTimeObserver> observers;
|
||||||
|
|
||||||
|
public ExecutionTimeSubject(){
|
||||||
|
super();
|
||||||
|
this.observers = new HashSet<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void registerObserver(ExecutionTimeObserver observer){
|
||||||
|
observers.add(observer);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void unregisterObserver(ExecutionTimeObserver observer){
|
||||||
|
observers.remove(observer);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void notifyObservers(){
|
||||||
|
observers.forEach(o -> o.executionTimeChanged());
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getTotalExecutionTime(){
|
||||||
|
throw new UnsupportedOperationException("No class implements ExecutionTimeSubject correctly!");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addExecutionTime(int i){
|
||||||
|
throw new UnsupportedOperationException("No class implements ExecutionTimeSubject correctly!");
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getExecutionTimeMultiplier(){
|
||||||
|
throw new UnsupportedOperationException("No class implements ExecutionTimeSubject correctly!");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExecutionTimeMultiplier(String option){
|
||||||
|
throw new UnsupportedOperationException("No class implements ExecutionTimeSubject correctly!");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void resetTotalExecutionTime(){
|
||||||
|
throw new UnsupportedOperationException("No class implements ExecutionTimeSubject correctly!");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initialize(PICComponentLocator locator) {
|
||||||
|
super.initialize(locator);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,6 +1,7 @@
|
|||||||
package fabrik.simulator.pic16f84;
|
package fabrik.simulator.pic16f84;
|
||||||
|
|
||||||
import com.gluonhq.charm.glisten.control.ToggleButtonGroup;
|
import fabrik.simulator.pic16f84.frontendspecifics.FrontendSpecificToggleButtonGroup;
|
||||||
|
import fabrik.simulator.pic16f84.frontendspecifics.ToggleButtonGroup;
|
||||||
import fabrik.simulator.pic16f84.interfaces.*;
|
import fabrik.simulator.pic16f84.interfaces.*;
|
||||||
import javafx.collections.ObservableList;
|
import javafx.collections.ObservableList;
|
||||||
import javafx.scene.control.ToggleButton;
|
import javafx.scene.control.ToggleButton;
|
||||||
@ -77,7 +78,7 @@ public class IOPorts extends PICComponent implements IOPortInterface {
|
|||||||
dataRegister.setDirectRegister(TRISB, trisLatch[B]);
|
dataRegister.setDirectRegister(TRISB, trisLatch[B]);
|
||||||
if (((trisLatch[A] >> 4) & 1 )== 1)
|
if (((trisLatch[A] >> 4) & 1 )== 1)
|
||||||
timer.incrementFromPin(dataRegister.getDirectRegister(PORTA));
|
timer.incrementFromPin(dataRegister.getDirectRegister(PORTA));
|
||||||
ToggleButtonGroup[] buttons = Controller_Frontend.getPORTbuttons();
|
ToggleButtonGroup[] buttons = (ToggleButtonGroup[]) frontendController.getPORTbuttons();
|
||||||
for (int i = 0; i < buttons.length; i++){
|
for (int i = 0; i < buttons.length; i++){
|
||||||
int port = (i < 8) ? PORTA : PORTB;
|
int port = (i < 8) ? PORTA : PORTB;
|
||||||
int bit = i % 8;
|
int bit = i % 8;
|
||||||
@ -139,7 +140,7 @@ public class IOPorts extends PICComponent implements IOPortInterface {
|
|||||||
int tris = params[0];
|
int tris = params[0];
|
||||||
int bit = params[1];
|
int bit = params[1];
|
||||||
int value = params[2];
|
int value = params[2];
|
||||||
ToggleButtonGroup [] buttonsPORT = Controller_Frontend.getPORTbuttons();
|
ToggleButtonGroup [] buttonsPORT = (ToggleButtonGroup[]) frontendController.getPORTbuttons();
|
||||||
if (value == 1){
|
if (value == 1){
|
||||||
setBit(tris, bit);
|
setBit(tris, bit);
|
||||||
buttonsPORT[(tris-TRISA)*8 + bit].setDisable(false);
|
buttonsPORT[(tris-TRISA)*8 + bit].setDisable(false);
|
||||||
@ -192,7 +193,7 @@ public class IOPorts extends PICComponent implements IOPortInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void refreshTable(ToggleButtonGroup parent) {
|
public void refreshTable(ToggleButtonGroup parent) {
|
||||||
Table.refresh();
|
table.refresh();
|
||||||
CreateWindow.refreshTable();
|
CreateWindow.refreshTable();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -231,4 +232,20 @@ public class IOPorts extends PICComponent implements IOPortInterface {
|
|||||||
super.initialize(locator);
|
super.initialize(locator);
|
||||||
System.out.println("IOPorts.\n");
|
System.out.println("IOPorts.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setPORTfromUI(FrontendSpecificToggleButtonGroup parent) throws IOException {
|
||||||
|
setPORTfromUI((ToggleButtonGroup) parent);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setTRISfromUI(FrontendSpecificToggleButtonGroup parent) throws IOException {
|
||||||
|
setTRISfromUI((ToggleButtonGroup) parent);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void refreshUI(FrontendSpecificToggleButtonGroup[] trisButtons,
|
||||||
|
FrontendSpecificToggleButtonGroup[] portButtons) {
|
||||||
|
refreshUI((ToggleButtonGroup[]) trisButtons, (ToggleButtonGroup[]) portButtons);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -30,7 +30,7 @@ public class Interrupts extends PICComponent implements InterruptInterface {
|
|||||||
enableFlag = dataRegister.getDirectBit(INTCON, enableFlag);
|
enableFlag = dataRegister.getDirectBit(INTCON, enableFlag);
|
||||||
int globalFlag = dataRegister.getDirectBit(INTCON, GIE);
|
int globalFlag = dataRegister.getDirectBit(INTCON, GIE);
|
||||||
if (enableFlag == 1) {
|
if (enableFlag == 1) {
|
||||||
frontendController.wakeUpFromSleep();
|
ExecutionState.wakeUp();
|
||||||
if (globalFlag == 1) {
|
if (globalFlag == 1) {
|
||||||
dataRegister.clearBit(INTCON, GIE);
|
dataRegister.clearBit(INTCON, GIE);
|
||||||
commands.CALL(ISR);
|
commands.CALL(ISR);
|
||||||
|
|||||||
@ -6,12 +6,12 @@ public class Main {
|
|||||||
private static final PICComponentLocator picComponents = new PICComponentLocator(); // Subjekt
|
private static final PICComponentLocator picComponents = new PICComponentLocator(); // Subjekt
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
picComponents.registerComponent(CommandInterface.class, new Commands());
|
Commands commands = new Commands();
|
||||||
picComponents.registerComponent(ToggleButtonInterface.class, new ToggleButtonGroupExt());
|
picComponents.registerComponent(CommandInterface.class, commands);
|
||||||
|
picComponents.registerComponent(ExecutionTimeSubject.class, commands);
|
||||||
picComponents.registerComponent(DataRegisterInterface.class, new DataRegister());
|
picComponents.registerComponent(DataRegisterInterface.class, new DataRegister());
|
||||||
picComponents.registerComponent(EEPROMInterface.class, new EEPROM());
|
picComponents.registerComponent(EEPROMInterface.class, new EEPROM());
|
||||||
picComponents.registerComponent(InterruptInterface.class, new Interrupts());
|
picComponents.registerComponent(InterruptInterface.class, new Interrupts());
|
||||||
picComponents.registerComponent(IOPortInterface.class, new IOPorts());
|
|
||||||
picComponents.registerComponent(PreScalerInterface.class, new PreScaler());
|
picComponents.registerComponent(PreScalerInterface.class, new PreScaler());
|
||||||
picComponents.registerComponent(ProgramStackInterface.class, new ProgramStack());
|
picComponents.registerComponent(ProgramStackInterface.class, new ProgramStack());
|
||||||
picComponents.registerComponent(TimerInterface.class, new Timer());
|
picComponents.registerComponent(TimerInterface.class, new Timer());
|
||||||
|
|||||||
@ -9,13 +9,15 @@ public abstract class PICComponent {
|
|||||||
IOPortInterface ioPorts;
|
IOPortInterface ioPorts;
|
||||||
TimerInterface timer;
|
TimerInterface timer;
|
||||||
InterruptInterface interrupts;
|
InterruptInterface interrupts;
|
||||||
|
TableInterface table;
|
||||||
FrontendControllerInterface frontendController;
|
FrontendControllerInterface frontendController;
|
||||||
WatchdogTimerInterface watchdogTimer;
|
WatchdogTimerInterface watchdogTimer;
|
||||||
ProgramStackInterface programStack;
|
ProgramStackInterface programStack;
|
||||||
CommandInterface commands;
|
CommandInterface commands;
|
||||||
|
ExecutionTimeSubject executionTime;
|
||||||
ToggleButtonInterface toggleButtonExt;
|
ToggleButtonInterface toggleButtonExt;
|
||||||
|
|
||||||
void initialize(PICComponentLocator locator) {
|
public void initialize(PICComponentLocator locator) {
|
||||||
toggleButtonExt = locator.getComponent(ToggleButtonInterface.class);
|
toggleButtonExt = locator.getComponent(ToggleButtonInterface.class);
|
||||||
dataRegister = locator.getComponent(DataRegisterInterface.class);
|
dataRegister = locator.getComponent(DataRegisterInterface.class);
|
||||||
eeprom = locator.getComponent(EEPROMInterface.class);
|
eeprom = locator.getComponent(EEPROMInterface.class);
|
||||||
@ -27,5 +29,7 @@ public abstract class PICComponent {
|
|||||||
watchdogTimer = locator.getComponent(WatchdogTimerInterface.class);
|
watchdogTimer = locator.getComponent(WatchdogTimerInterface.class);
|
||||||
programStack = locator.getComponent(ProgramStackInterface.class);
|
programStack = locator.getComponent(ProgramStackInterface.class);
|
||||||
commands = locator.getComponent(CommandInterface.class);
|
commands = locator.getComponent(CommandInterface.class);
|
||||||
|
table = locator.getComponent(TableInterface.class);
|
||||||
|
executionTime = locator.getComponent(ExecutionTimeSubject.class);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package fabrik.simulator.pic16f84;
|
package fabrik.simulator.pic16f84;
|
||||||
|
|
||||||
|
import fabrik.simulator.pic16f84.frontendspecifics.VBox;
|
||||||
import fabrik.simulator.pic16f84.interfaces.*;
|
import fabrik.simulator.pic16f84.interfaces.*;
|
||||||
import javafx.beans.property.SimpleStringProperty;
|
import javafx.beans.property.SimpleStringProperty;
|
||||||
import javafx.geometry.Insets;
|
import javafx.geometry.Insets;
|
||||||
@ -10,24 +11,15 @@ import javafx.scene.control.TableColumn;
|
|||||||
import javafx.scene.control.TableView;
|
import javafx.scene.control.TableView;
|
||||||
|
|
||||||
import javafx.scene.layout.HBox;
|
import javafx.scene.layout.HBox;
|
||||||
import javafx.scene.layout.VBox;
|
|
||||||
|
|
||||||
|
|
||||||
import static javafx.application.Application.launch;
|
import static javafx.application.Application.launch;
|
||||||
|
|
||||||
public class Table {
|
public class Table extends PICComponent implements TableInterface {
|
||||||
|
private VBox tableBox;
|
||||||
|
|
||||||
//Hier wird die Tabelle aktualisiert
|
|
||||||
//Tabelle aktualisieren
|
|
||||||
private static DataRegisterInterface dataRegister;
|
|
||||||
private static CommandInterface commands;
|
|
||||||
|
|
||||||
private static final int NUM_COLUMNS = 8; // Anzahl der Spalten
|
private static final int NUM_COLUMNS = 8; // Anzahl der Spalten
|
||||||
private static final double TABLE_WIDTH = 425; // Breite der TableView
|
private static final double TABLE_WIDTH = 425; // Breite der TableView
|
||||||
private static final double TABLE_HEIGHT = 600; // Höhe der TableView
|
private static final double TABLE_HEIGHT = 600; // Höhe der TableView
|
||||||
private static IOPortInterface ioPorts;
|
|
||||||
private static PreScalerInterface preScaler;
|
|
||||||
|
|
||||||
private static String formatHex(String s) {
|
private static String formatHex(String s) {
|
||||||
return (s.length() == 1) ? "0" + s : s;
|
return (s.length() == 1) ? "0" + s : s;
|
||||||
@ -45,27 +37,16 @@ public class Table {
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static VBox init(PICComponentLocator picComponents){
|
public VBox getTable(){
|
||||||
dataRegister = (DataRegisterInterface) picComponents.getComponent(DataRegisterInterface.class);
|
refresh();
|
||||||
commands = (CommandInterface) picComponents.getComponent(CommandInterface.class);
|
return tableBox;
|
||||||
ioPorts = (IOPortInterface) picComponents.getComponent(IOPortInterface.class);
|
|
||||||
preScaler = (PreScalerInterface) picComponents.getComponent(PreScalerInterface.class);
|
|
||||||
return refresh();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static VBox refresh() {
|
public void refresh() {
|
||||||
|
|
||||||
// Erstelle eine Instanz der dataRegister-Klasse
|
|
||||||
|
|
||||||
|
|
||||||
// Erstelle eine TableView für die Datenanzeige
|
// Erstelle eine TableView für die Datenanzeige
|
||||||
TableView<DataEntry[]> tableView = new TableView<>();
|
TableView<DataEntry[]> tableView = new TableView<>();
|
||||||
tableView.setPrefWidth(TABLE_WIDTH);
|
tableView.setPrefWidth(TABLE_WIDTH);
|
||||||
tableView.setPrefHeight(TABLE_HEIGHT);
|
tableView.setPrefHeight(TABLE_HEIGHT);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Erstelle Spalten für die TableView
|
// Erstelle Spalten für die TableView
|
||||||
for (int i = 0; i < NUM_COLUMNS; i++) {
|
for (int i = 0; i < NUM_COLUMNS; i++) {
|
||||||
TableColumn<DataEntry[], String> column = new TableColumn<>("0" + (i));
|
TableColumn<DataEntry[], String> column = new TableColumn<>("0" + (i));
|
||||||
@ -79,7 +60,6 @@ public class Table {
|
|||||||
});
|
});
|
||||||
tableView.getColumns().add(column);
|
tableView.getColumns().add(column);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fülle die TableView mit Daten aus dem Array
|
// Fülle die TableView mit Daten aus dem Array
|
||||||
int numRows = (int) Math.ceil((double) dataRegister.getDataRegister().length / NUM_COLUMNS);
|
int numRows = (int) Math.ceil((double) dataRegister.getDataRegister().length / NUM_COLUMNS);
|
||||||
for (int row = 0; row < numRows; row++) {
|
for (int row = 0; row < numRows; row++) {
|
||||||
@ -135,14 +115,12 @@ public class Table {
|
|||||||
VBox table = new VBox();
|
VBox table = new VBox();
|
||||||
table.getChildren().addAll(tableView, labelsAndButton);
|
table.getChildren().addAll(tableView, labelsAndButton);
|
||||||
VBox.setMargin(tableView, new Insets(0, 0, 0, 0));
|
VBox.setMargin(tableView, new Insets(0, 0, 0, 0));
|
||||||
|
tableBox = table;
|
||||||
return table;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void triggerReset() {
|
private void triggerReset() {
|
||||||
dataRegister.initDataRegister();
|
dataRegister.initDataRegister();
|
||||||
ioPorts.refreshUI(Controller_Frontend.getTRISbuttons(), Controller_Frontend.getPORTbuttons());
|
ioPorts.refreshUI(frontendController.getTRISbuttons(), frontendController.getPORTbuttons());
|
||||||
CreateWindow.refreshTable();
|
CreateWindow.refreshTable();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -169,5 +147,7 @@ public class Table {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void initialize(PICComponentLocator picComponents) {
|
||||||
|
super.initialize(picComponents);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +1,9 @@
|
|||||||
package fabrik.simulator.pic16f84;
|
package fabrik.simulator.pic16f84;
|
||||||
|
|
||||||
|
import fabrik.simulator.pic16f84.interfaces.ExecutionTimeObserver;
|
||||||
import fabrik.simulator.pic16f84.interfaces.TimerInterface;
|
import fabrik.simulator.pic16f84.interfaces.TimerInterface;
|
||||||
|
|
||||||
public class Timer extends PICComponent implements TimerInterface {
|
public class Timer extends PICComponent implements TimerInterface, ExecutionTimeObserver {
|
||||||
private final int TIMERREG = 0x1;
|
private final int TIMERREG = 0x1;
|
||||||
private final int T0SE = 0x4;
|
private final int T0SE = 0x4;
|
||||||
private final int T0CS = 0x5;
|
private final int T0CS = 0x5;
|
||||||
@ -27,7 +28,7 @@ public class Timer extends PICComponent implements TimerInterface {
|
|||||||
|
|
||||||
|
|
||||||
public void incrementFromPin (int register){
|
public void incrementFromPin (int register){
|
||||||
if ((dataRegister.getDirectBit(OPTION, T0CS) == 1) && !frontendController.isSleeping()){
|
if ((dataRegister.getDirectBit(OPTION, T0CS) == 1) && !ExecutionState.isSleeping()){
|
||||||
int newpin = (register >> 4) & 1;
|
int newpin = (register >> 4) & 1;
|
||||||
if (newpin != oldpin) {
|
if (newpin != oldpin) {
|
||||||
if (dataRegister.getDirectBit(OPTION, T0SE) == 0) {
|
if (dataRegister.getDirectBit(OPTION, T0SE) == 0) {
|
||||||
@ -66,5 +67,11 @@ public class Timer extends PICComponent implements TimerInterface {
|
|||||||
@Override
|
@Override
|
||||||
public void initialize(PICComponentLocator locator) {
|
public void initialize(PICComponentLocator locator) {
|
||||||
super.initialize(locator);
|
super.initialize(locator);
|
||||||
|
executionTime.registerObserver(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void executionTimeChanged() {
|
||||||
|
cycles((int) executionTime.getTotalExecutionTime());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
package fabrik.simulator.pic16f84;
|
package fabrik.simulator.pic16f84;
|
||||||
|
|
||||||
import com.gluonhq.charm.glisten.control.ToggleButtonGroup;
|
|
||||||
|
import fabrik.simulator.pic16f84.frontendspecifics.FrontendSpecificObject;
|
||||||
|
import fabrik.simulator.pic16f84.frontendspecifics.ToggleButtonGroup;
|
||||||
import fabrik.simulator.pic16f84.interfaces.ToggleButtonInterface;
|
import fabrik.simulator.pic16f84.interfaces.ToggleButtonInterface;
|
||||||
import javafx.collections.ListChangeListener;
|
import javafx.collections.ListChangeListener;
|
||||||
import javafx.event.EventHandler;
|
import javafx.event.EventHandler;
|
||||||
@ -10,7 +12,7 @@ import javafx.scene.input.MouseEvent;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
public class ToggleButtonGroupExt extends PICComponent implements ToggleButtonInterface {
|
public class ToggleButtonGroupExt extends PICComponent implements ToggleButtonInterface, FrontendSpecificObject {
|
||||||
|
|
||||||
|
|
||||||
private static ToggleButtonGroupExt me;
|
private static ToggleButtonGroupExt me;
|
||||||
@ -57,7 +59,7 @@ public class ToggleButtonGroupExt extends PICComponent implements ToggleButtonIn
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@Override
|
|
||||||
public void initialize(PICComponentLocator locator) {
|
public void initialize(PICComponentLocator locator) {
|
||||||
System.out.println("ToggleButtonGroupExt");
|
System.out.println("ToggleButtonGroupExt");
|
||||||
super.initialize(locator);
|
super.initialize(locator);
|
||||||
|
|||||||
@ -21,18 +21,18 @@ public class WatchdogTimer extends PICComponent implements WatchdogTimerInterfac
|
|||||||
if (enabled) {
|
if (enabled) {
|
||||||
if (realtimer >= (watchdogTime + lastReset - 1)) {
|
if (realtimer >= (watchdogTime + lastReset - 1)) {
|
||||||
dataRegister.clearBit(3, 4);
|
dataRegister.clearBit(3, 4);
|
||||||
lastReset = commands.getTotalExecutionTime();
|
lastReset = executionTime.getTotalExecutionTime();
|
||||||
frontendController.stopRunFromBackend("Watchdog Timer");
|
frontendController.stopRunFromBackend("Watchdog Timer");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
rawtimer++;
|
rawtimer++;
|
||||||
realtimer = (long) (rawtimer * commands.getExecutionTimeMultiplier());
|
realtimer = (long) (rawtimer * executionTime.getExecutionTimeMultiplier());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void reset (){
|
public void reset (){
|
||||||
lastReset = commands.getTotalExecutionTime();
|
lastReset = executionTime.getTotalExecutionTime();
|
||||||
rawtimer = 0;
|
rawtimer = 0;
|
||||||
realtimer = 0;
|
realtimer = 0;
|
||||||
preScaler.reset();
|
preScaler.reset();
|
||||||
|
|||||||
@ -0,0 +1,4 @@
|
|||||||
|
package fabrik.simulator.pic16f84.frontendspecifics;
|
||||||
|
|
||||||
|
public interface FrontendSpecificObject {
|
||||||
|
}
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
package fabrik.simulator.pic16f84.frontendspecifics;
|
||||||
|
|
||||||
|
public interface FrontendSpecificToggleButtonGroup extends FrontendSpecificObject{
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
package fabrik.simulator.pic16f84.frontendspecifics;
|
||||||
|
|
||||||
|
public interface FrontendSpecificVBox extends FrontendSpecificObject {
|
||||||
|
}
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
package fabrik.simulator.pic16f84.frontendspecifics;
|
||||||
|
|
||||||
|
import javafx.scene.control.ToggleButton;
|
||||||
|
|
||||||
|
public class ToggleButtonGroup extends com.gluonhq.charm.glisten.control.ToggleButtonGroup implements FrontendSpecificToggleButtonGroup {
|
||||||
|
public ToggleButtonGroup(){
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ToggleButtonGroup(ToggleButton... toggles) {
|
||||||
|
super(toggles);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
package fabrik.simulator.pic16f84.frontendspecifics;
|
||||||
|
|
||||||
|
public class VBox extends javafx.scene.layout.VBox implements FrontendSpecificVBox {
|
||||||
|
public VBox(){
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -3,17 +3,10 @@ package fabrik.simulator.pic16f84.interfaces;
|
|||||||
public interface CommandInterface extends PICComponentInterface {
|
public interface CommandInterface extends PICComponentInterface {
|
||||||
void CALL(int isr);
|
void CALL(int isr);
|
||||||
|
|
||||||
double getTotalExecutionTime();
|
|
||||||
|
|
||||||
int get_wRegister();
|
int get_wRegister();
|
||||||
|
|
||||||
void decode(int i);
|
void decode(int i);
|
||||||
|
|
||||||
void resetTotalExecutionTime();
|
|
||||||
|
|
||||||
void addExecutionTime(int i);
|
|
||||||
|
|
||||||
double getExecutionTimeMultiplier();
|
|
||||||
|
|
||||||
void setExecutionTimeMultiplier(String option);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
package fabrik.simulator.pic16f84.interfaces;
|
package fabrik.simulator.pic16f84.interfaces;
|
||||||
|
|
||||||
public interface EEPROMInterface extends PICComponentInterface {
|
public interface EEPROMInterface extends PICComponentInterface {
|
||||||
void registerTime(boolean b);
|
void registerTime(double executionTime, boolean b);
|
||||||
|
|
||||||
void parse(int i, int content, int i1);
|
void parse(int i, int content, int i1);
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,5 @@
|
|||||||
|
package fabrik.simulator.pic16f84.interfaces;
|
||||||
|
|
||||||
|
public interface ExecutionTimeObserver {
|
||||||
|
void executionTimeChanged();
|
||||||
|
}
|
||||||
@ -1,8 +1,13 @@
|
|||||||
package fabrik.simulator.pic16f84.interfaces;
|
package fabrik.simulator.pic16f84.interfaces;
|
||||||
|
|
||||||
public interface FrontendControllerInterface extends PICComponentInterface {
|
import fabrik.simulator.pic16f84.frontendspecifics.FrontendSpecificObject;
|
||||||
|
import fabrik.simulator.pic16f84.frontendspecifics.FrontendSpecificToggleButtonGroup;
|
||||||
|
|
||||||
|
public interface FrontendControllerInterface extends PICComponentInterface, FrontendSpecificObject {
|
||||||
|
|
||||||
|
FrontendSpecificToggleButtonGroup[] getPORTbuttons();
|
||||||
|
|
||||||
|
FrontendSpecificToggleButtonGroup[] getTRISbuttons();
|
||||||
|
|
||||||
void stopRunFromBackend(String watchdogTimer);
|
void stopRunFromBackend(String watchdogTimer);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,11 +1,13 @@
|
|||||||
package fabrik.simulator.pic16f84.interfaces;
|
package fabrik.simulator.pic16f84.interfaces;
|
||||||
|
|
||||||
import com.gluonhq.charm.glisten.control.ToggleButtonGroup;
|
|
||||||
import javafx.scene.shape.Circle;
|
import javafx.scene.shape.Circle;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
public interface IOPortInterface extends PICComponentInterface {
|
import fabrik.simulator.pic16f84.frontendspecifics.FrontendSpecificObject;
|
||||||
|
import fabrik.simulator.pic16f84.frontendspecifics.FrontendSpecificToggleButtonGroup;
|
||||||
|
|
||||||
|
public interface IOPortInterface extends PICComponentInterface, FrontendSpecificObject {
|
||||||
void resetTRIS();
|
void resetTRIS();
|
||||||
|
|
||||||
void setRegister(int i, int content);
|
void setRegister(int i, int content);
|
||||||
@ -14,11 +16,11 @@ public interface IOPortInterface extends PICComponentInterface {
|
|||||||
|
|
||||||
void setBit(int i, int bit);
|
void setBit(int i, int bit);
|
||||||
|
|
||||||
void setPORTfromUI(ToggleButtonGroup parent) throws IOException;
|
void setPORTfromUI(FrontendSpecificToggleButtonGroup parent) throws IOException;
|
||||||
|
|
||||||
void setTRISfromUI(ToggleButtonGroup parent) throws IOException;
|
void setTRISfromUI(FrontendSpecificToggleButtonGroup parent) throws IOException;
|
||||||
|
|
||||||
void refreshUI(ToggleButtonGroup[] triSbuttons, ToggleButtonGroup[] porTbuttons);
|
void refreshUI(FrontendSpecificToggleButtonGroup[] trisButtons, FrontendSpecificToggleButtonGroup[] portButtons);
|
||||||
|
|
||||||
void reset();
|
void reset();
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,10 @@
|
|||||||
package fabrik.simulator.pic16f84.interfaces;
|
package fabrik.simulator.pic16f84.interfaces;
|
||||||
|
|
||||||
|
import fabrik.simulator.pic16f84.frontendspecifics.FrontendSpecificVBox;
|
||||||
import javafx.scene.layout.VBox;
|
import javafx.scene.layout.VBox;
|
||||||
|
|
||||||
public interface TableInterface extends PICComponentInterface {
|
public interface TableInterface extends PICComponentInterface {
|
||||||
VBox refresh();
|
void refresh();
|
||||||
|
|
||||||
|
FrontendSpecificVBox getTable();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
package fabrik.simulator.pic16f84.interfaces;
|
package fabrik.simulator.pic16f84.interfaces;
|
||||||
|
|
||||||
import com.gluonhq.charm.glisten.control.ToggleButtonGroup;
|
import fabrik.simulator.pic16f84.frontendspecifics.FrontendSpecificObject;
|
||||||
|
import fabrik.simulator.pic16f84.frontendspecifics.ToggleButtonGroup;
|
||||||
|
|
||||||
public interface ToggleButtonInterface extends PICComponentInterface {
|
public interface ToggleButtonInterface extends PICComponentInterface, FrontendSpecificObject {
|
||||||
void addAlwaysOneSelectedSupport(ToggleButtonGroup allTRISButton);
|
void addAlwaysOneSelectedSupport(ToggleButtonGroup allTRISButton);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,7 +11,9 @@ module fabrik.simulator.pic16f84 {
|
|||||||
requires json.simple;
|
requires json.simple;
|
||||||
|
|
||||||
opens fabrik.simulator.pic16f84 to javafx.fxml;
|
opens fabrik.simulator.pic16f84 to javafx.fxml;
|
||||||
|
opens fabrik.simulator.pic16f84.frontendspecifics to javafx.fxml;
|
||||||
exports fabrik.simulator.pic16f84;
|
exports fabrik.simulator.pic16f84;
|
||||||
exports fabrik.simulator.pic16f84.interfaces;
|
exports fabrik.simulator.pic16f84.interfaces;
|
||||||
|
exports fabrik.simulator.pic16f84.frontendspecifics;
|
||||||
opens fabrik.simulator.pic16f84.interfaces to javafx.fxml;
|
opens fabrik.simulator.pic16f84.interfaces to javafx.fxml;
|
||||||
}
|
}
|
||||||
@ -1,5 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<?import fabrik.simulator.pic16f84.frontendspecifics.*?>
|
||||||
<?import com.gluonhq.charm.glisten.control.*?>
|
<?import com.gluonhq.charm.glisten.control.*?>
|
||||||
<?import java.lang.*?>
|
<?import java.lang.*?>
|
||||||
<?import javafx.collections.*?>
|
<?import javafx.collections.*?>
|
||||||
|
|||||||
@ -27,7 +27,7 @@ class CommandsTests {
|
|||||||
EEPROMInterface eepromMock = mock(EEPROMInterface.class);
|
EEPROMInterface eepromMock = mock(EEPROMInterface.class);
|
||||||
picComponents.registerComponent(EEPROMInterface.class, eepromMock);
|
picComponents.registerComponent(EEPROMInterface.class, eepromMock);
|
||||||
|
|
||||||
CommandInterface commands = new Commands();
|
Commands commands = new Commands();
|
||||||
picComponents.registerComponent(CommandInterface.class, commands);
|
picComponents.registerComponent(CommandInterface.class, commands);
|
||||||
picComponents.initAll();
|
picComponents.initAll();
|
||||||
|
|
||||||
@ -47,7 +47,7 @@ class CommandsTests {
|
|||||||
EEPROMInterface eepromMock = mock(EEPROMInterface.class);
|
EEPROMInterface eepromMock = mock(EEPROMInterface.class);
|
||||||
picComponents.registerComponent(EEPROMInterface.class, eepromMock);
|
picComponents.registerComponent(EEPROMInterface.class, eepromMock);
|
||||||
|
|
||||||
CommandInterface commands = new Commands();
|
Commands commands = new Commands();
|
||||||
picComponents.registerComponent(CommandInterface.class, commands);
|
picComponents.registerComponent(CommandInterface.class, commands);
|
||||||
picComponents.initAll();
|
picComponents.initAll();
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ class CommandsTests {
|
|||||||
EEPROMInterface eepromMock = mock(EEPROMInterface.class);
|
EEPROMInterface eepromMock = mock(EEPROMInterface.class);
|
||||||
picComponents.registerComponent(EEPROMInterface.class, eepromMock);
|
picComponents.registerComponent(EEPROMInterface.class, eepromMock);
|
||||||
|
|
||||||
CommandInterface commands = new Commands();
|
Commands commands = new Commands();
|
||||||
picComponents.registerComponent(CommandInterface.class, commands);
|
picComponents.registerComponent(CommandInterface.class, commands);
|
||||||
picComponents.initAll();
|
picComponents.initAll();
|
||||||
|
|
||||||
|
|||||||
@ -69,8 +69,8 @@ class EEPROMTests {
|
|||||||
DataRegisterInterface mockDataRegister = Mockito.mock(DataRegisterInterface.class);
|
DataRegisterInterface mockDataRegister = Mockito.mock(DataRegisterInterface.class);
|
||||||
picComponents.registerComponent(DataRegisterInterface.class, mockDataRegister);
|
picComponents.registerComponent(DataRegisterInterface.class, mockDataRegister);
|
||||||
|
|
||||||
CommandInterface mockCommands = mock(CommandInterface.class);
|
ExecutionTimeSubject mockExecutionTime = mock(ExecutionTimeSubject.class);
|
||||||
picComponents.registerComponent(CommandInterface.class, mockCommands);
|
picComponents.registerComponent(ExecutionTimeSubject.class, mockExecutionTime);
|
||||||
|
|
||||||
EEPROMInterface eeprom = new EEPROM();
|
EEPROMInterface eeprom = new EEPROM();
|
||||||
picComponents.registerComponent(EEPROMInterface.class, eeprom);
|
picComponents.registerComponent(EEPROMInterface.class, eeprom);
|
||||||
|
|||||||
@ -29,13 +29,13 @@ class WatchDogTimerTests {
|
|||||||
picComponents.registerComponent(PreScalerInterface.class, mockPreScaler);
|
picComponents.registerComponent(PreScalerInterface.class, mockPreScaler);
|
||||||
|
|
||||||
|
|
||||||
CommandInterface mockCommands = mock(CommandInterface.class);
|
ExecutionTimeSubject mockExecutionTime = mock(ExecutionTimeSubject.class);
|
||||||
when(
|
when(
|
||||||
mockCommands.getExecutionTimeMultiplier()
|
mockExecutionTime.getExecutionTimeMultiplier()
|
||||||
).thenReturn(
|
).thenReturn(
|
||||||
1.0
|
1.0
|
||||||
);
|
);
|
||||||
picComponents.registerComponent(CommandInterface.class, mockCommands);
|
picComponents.registerComponent(ExecutionTimeSubject.class, mockExecutionTime);
|
||||||
|
|
||||||
WatchdogTimerInterface watchDogTimer = new WatchdogTimer();
|
WatchdogTimerInterface watchDogTimer = new WatchdogTimer();
|
||||||
picComponents.registerComponent(WatchdogTimerInterface.class, watchDogTimer);
|
picComponents.registerComponent(WatchdogTimerInterface.class, watchDogTimer);
|
||||||
|
|||||||
Reference in New Issue
Block a user