Well.. did some things ^^3
This commit is contained in:
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
@@ -4,5 +4,5 @@
|
||||
"java.project.referencedLibraries": [
|
||||
"lib/**/*.jar"
|
||||
],
|
||||
"java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx4G -Xms100m"
|
||||
"java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx8G -Xms100m"
|
||||
}
|
||||
|
||||
BIN
bin/Control/MyControlModel.class
Normal file
BIN
bin/Control/MyControlModel.class
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
bin/Model/Microcontroller/RUNTIMER.class
Normal file
BIN
bin/Model/Microcontroller/RUNTIMER.class
Normal file
Binary file not shown.
Binary file not shown.
BIN
bin/Model/MyModelData.class
Normal file
BIN
bin/Model/MyModelData.class
Normal file
Binary file not shown.
BIN
bin/Model/ProgramStepInformation.class
Normal file
BIN
bin/Model/ProgramStepInformation.class
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
bin/Runtime/Main.class
Normal file
BIN
bin/Runtime/Main.class
Normal file
Binary file not shown.
BIN
bin/Runtime/TODO.class
Normal file
BIN
bin/Runtime/TODO.class
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
bin/View/GUIProgramMemory.class
Normal file
BIN
bin/View/GUIProgramMemory.class
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
bin/View/MyViewData.class
Normal file
BIN
bin/View/MyViewData.class
Normal file
Binary file not shown.
@@ -0,0 +1 @@
|
||||
,aaron_moser,aaron-moser-ThinkPad-T430,08.04.2022 11:11,file:///home/aaron_moser/.config/libreoffice/4;
|
||||
Binary file not shown.
296
src/Control/MyControlModel.java
Normal file
296
src/Control/MyControlModel.java
Normal file
@@ -0,0 +1,296 @@
|
||||
package Control;
|
||||
|
||||
import Model.MyModelData;
|
||||
import Model.EepromLoader.ReadEepromFile;
|
||||
import Model.Microcontroller.PIC;
|
||||
import View.MyView;
|
||||
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JCheckBox;
|
||||
import javax.swing.JComboBox;
|
||||
import javax.swing.JFileChooser;
|
||||
import javax.swing.JMenuItem;
|
||||
|
||||
public class MyControlModel implements ActionListener {
|
||||
|
||||
MyView oMyView;
|
||||
|
||||
ArrayList<JCheckBox> oBreakpoints;
|
||||
ArrayList<JButton> oControlButtons;
|
||||
JCheckBox oWDTEnabled;
|
||||
JComboBox<String> oQuarzIntervals;
|
||||
ArrayList<JMenuItem> oMenuItems;
|
||||
|
||||
ConcurrentLinkedQueue<Integer> qCommandsForModel;
|
||||
ConcurrentLinkedQueue<MyModelData> qDataForModel;
|
||||
|
||||
ReadEepromFile oRef;
|
||||
int iTestFileLoaded = 0;
|
||||
boolean[] abBreakpoints;
|
||||
PIC oPIC;
|
||||
|
||||
MyModelData oMyModelData = new MyModelData();
|
||||
|
||||
public MyControlModel(MyView view, ConcurrentLinkedQueue<Integer> qCommandsForModel, ConcurrentLinkedQueue<MyModelData> qDataForModel) {
|
||||
oMyView = view;
|
||||
this.oPIC = new PIC();
|
||||
this.qCommandsForModel = qCommandsForModel;
|
||||
this.qDataForModel = qDataForModel;
|
||||
oControlButtons = oMyView.getGUIMCMenu().getControlButtons();
|
||||
oBreakpoints = oMyView.getGUITestFileTable().getCheckboxes();
|
||||
oWDTEnabled = oMyView.getGUITime().getWDTEnableCheckbox();
|
||||
oQuarzIntervals = oMyView.getGUITime().getQuarzComboBox();
|
||||
oMenuItems = oMyView.getGUIMenuBar().getMenuItems();
|
||||
addActionListeners();
|
||||
}
|
||||
|
||||
private void startProgramModel() {
|
||||
qCommandsForModel.add(1); // 1 == start
|
||||
}
|
||||
|
||||
private void pauseProgramModel() {
|
||||
qCommandsForModel.add(2); // 2 == pause
|
||||
}
|
||||
|
||||
private void resetProgramModel() {
|
||||
qCommandsForModel.add(3); // 3 == reset
|
||||
}
|
||||
|
||||
private void stepProgramModel() {
|
||||
qCommandsForModel.add(4); // 4 == step
|
||||
}
|
||||
|
||||
public void controlWDTModel(boolean bEnabled) {
|
||||
|
||||
}
|
||||
|
||||
private void loadTestFile() {
|
||||
File oFile;
|
||||
//select file to open
|
||||
JFileChooser oFileChooser = new JFileChooser();
|
||||
int iResponse = oFileChooser.showOpenDialog(null);
|
||||
if (iResponse == JFileChooser.APPROVE_OPTION) {
|
||||
oFile = new File(oFileChooser.getSelectedFile().getAbsolutePath());
|
||||
//System.out.println(oFile);
|
||||
oRef = new ReadEepromFile();
|
||||
oRef.setData(oFile);
|
||||
oRef.setOPCode(oRef.getData());
|
||||
oMyView.getGUITestFileTable().setData(oRef.getData());
|
||||
setBreakpointsActionListeners();
|
||||
oRef.readFileAndWriteToEEPROM(oPIC);
|
||||
oMyView.updateWindow();
|
||||
iTestFileLoaded = 1;
|
||||
oMyModelData.setPIC(oPIC);
|
||||
oMyModelData.setBreakpoints(abBreakpoints);
|
||||
qDataForModel.add(oMyModelData);
|
||||
}
|
||||
}
|
||||
|
||||
private void loadProgStateItem() {
|
||||
//TODO
|
||||
}
|
||||
|
||||
private void saveProgStateItem() {
|
||||
//TODO
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets interval of visual running. (instant, 1 sec, 2 sec)
|
||||
* @param i
|
||||
*/
|
||||
private void setIntervalProgramModel(int i) {
|
||||
oMyModelData.setVisualInterval(i);
|
||||
qDataForModel.add(oMyModelData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets ActionListeners for breakpoints.
|
||||
*/
|
||||
private void setBreakpointsActionListeners() {
|
||||
ArrayList<String> data = oRef.getData();
|
||||
int iDataSize = data.size();
|
||||
ArrayList<String> opcode = oRef.getOPCode();
|
||||
|
||||
int iOPCodeSize = opcode.size();
|
||||
//If testfile was loaded before, reset all checkboxes
|
||||
if (iTestFileLoaded > 0) {
|
||||
oBreakpoints = oMyView.getGUITestFileTable().getCheckboxes();
|
||||
for (int i = 0; i < iDataSize; i++) {
|
||||
oBreakpoints.get(i).setEnabled(false);
|
||||
}
|
||||
}
|
||||
//Enable only checkboxes which belong to real code
|
||||
int[] aiProgramLines = new int[iOPCodeSize];
|
||||
int k = 0;
|
||||
for (int i = 0; i < iDataSize; i++) {
|
||||
for (int j = 0; j < iOPCodeSize; j++) {
|
||||
if (data.get(i).equals(opcode.get(j))) {
|
||||
aiProgramLines[k] = i;
|
||||
k++;
|
||||
oBreakpoints = oMyView.getGUITestFileTable().getCheckboxes();
|
||||
oBreakpoints.get(i).setEnabled(true);
|
||||
oBreakpoints.get(i).addActionListener(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
oPIC.getEeprom().setProgramLines(aiProgramLines);
|
||||
abBreakpoints = new boolean[iOPCodeSize];
|
||||
}
|
||||
|
||||
private void controlBreakpoints(ActionEvent e) {
|
||||
if (oRef != null) {
|
||||
int iOPCode = oRef.getOPCode().size();
|
||||
if (iOPCode > 0) {
|
||||
for (int i = 0; i < oBreakpoints.size(); i++) {
|
||||
if (e.getSource() == oBreakpoints.get(i)) {
|
||||
for (int j = 0; j < iOPCode; j++) {
|
||||
if (oRef.getOPCode().get(j).equals(oRef.getData().get(i))) {
|
||||
abBreakpoints[j] = !abBreakpoints[j];
|
||||
oMyModelData.setBreakpoints(abBreakpoints);
|
||||
qDataForModel.add(oMyModelData);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
//Breakpoints set/reset
|
||||
controlBreakpoints(e);
|
||||
|
||||
//Runtime control Buttons
|
||||
if (e.getSource() == oControlButtons.get(0)) {
|
||||
startProgramModel();
|
||||
}
|
||||
if (e.getSource() == oControlButtons.get(1)) {
|
||||
stepProgramModel();
|
||||
}
|
||||
if (e.getSource() == oControlButtons.get(2)) {
|
||||
pauseProgramModel();
|
||||
}
|
||||
if (e.getSource() == oControlButtons.get(3)) {
|
||||
resetProgramModel();
|
||||
}
|
||||
|
||||
//WDT-Enabled Checkbox
|
||||
if (e.getSource() == oWDTEnabled) {
|
||||
//Enable/disable watchdog
|
||||
System.out.println("Watchdog got set to " + oWDTEnabled.isSelected());//TODO
|
||||
}
|
||||
|
||||
//Quarzfrequency
|
||||
if (e.getSource() == oQuarzIntervals) {
|
||||
oMyModelData.setQuartzInterval(oQuarzIntervals.getSelectedIndex());
|
||||
qDataForModel.add(oMyModelData);
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
for (JMenuItem oMenuItem : oMenuItems) {
|
||||
if (e.getSource() == oMenuItem) {
|
||||
switch (i) {
|
||||
case 0: {
|
||||
//Load testfile
|
||||
loadTestFile();
|
||||
}break;
|
||||
case 1: {
|
||||
//Load Program State
|
||||
loadProgStateItem();
|
||||
}break;
|
||||
case 2: {
|
||||
//Save Program State
|
||||
saveProgStateItem();
|
||||
}break;
|
||||
case 3: {
|
||||
//Exit Program
|
||||
qCommandsForModel.add(0);
|
||||
System.exit(0);
|
||||
}break;
|
||||
case 4: {
|
||||
//Dark theme
|
||||
oMyView.setTheme(1);
|
||||
}break;
|
||||
case 5: {
|
||||
//Light theme
|
||||
oMyView.setTheme(0);
|
||||
}break;
|
||||
case 6: {
|
||||
//Start pic
|
||||
startProgramModel();
|
||||
}break;
|
||||
case 7: {
|
||||
//Pause pic
|
||||
pauseProgramModel();
|
||||
}break;
|
||||
case 8: {
|
||||
//Reset pic
|
||||
resetProgramModel();
|
||||
}break;
|
||||
case 9: {
|
||||
//Step pic
|
||||
stepProgramModel();
|
||||
}break;
|
||||
case 10: {
|
||||
//Set interval to as soon as possible
|
||||
setIntervalProgramModel(0);
|
||||
}break;
|
||||
case 11: {
|
||||
//Set interval to 1 sec
|
||||
setIntervalProgramModel(1);
|
||||
}break;
|
||||
case 12: {
|
||||
//Set interval to 2 sec
|
||||
setIntervalProgramModel(2);
|
||||
}break;
|
||||
case 13: {
|
||||
//Change language to german
|
||||
oMyView.setLanguage(0);
|
||||
}break;
|
||||
case 14: {
|
||||
//Change language to english
|
||||
oMyView.setLanguage(1);
|
||||
}break;
|
||||
case 15: {
|
||||
//Show manual
|
||||
}break;
|
||||
case 16: {
|
||||
//Show about
|
||||
}break;
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
private void addActionListeners() {
|
||||
if (oBreakpoints != null) {
|
||||
for (JCheckBox oBreakpoint : oBreakpoints) {
|
||||
oBreakpoint.addActionListener(this);
|
||||
}
|
||||
}
|
||||
if (oControlButtons != null) {
|
||||
for (JButton oButton : oControlButtons) {
|
||||
oButton.addActionListener(this);
|
||||
}
|
||||
}
|
||||
if (oWDTEnabled != null) {
|
||||
oWDTEnabled.addActionListener(this);
|
||||
}
|
||||
if (oQuarzIntervals != null) {
|
||||
oQuarzIntervals.addActionListener(this);
|
||||
}
|
||||
if (oMenuItems != null) {
|
||||
for (JMenuItem oMenuItem : oMenuItems) {
|
||||
oMenuItem.addActionListener(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,98 +0,0 @@
|
||||
package Control;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import Model.MyModel;
|
||||
import View.MyView;
|
||||
|
||||
public class MyControlModelPIC {
|
||||
|
||||
MyModel oModel;
|
||||
MyView oView;
|
||||
//put Objects to manipulate here
|
||||
|
||||
public MyControlModelPIC(MyModel model, MyView view) {
|
||||
oModel = model;
|
||||
oView = view;
|
||||
}
|
||||
|
||||
public void setWRegisterModel(int iValue) {
|
||||
|
||||
}
|
||||
|
||||
public void setPCinternModel(int iValue) {
|
||||
|
||||
}
|
||||
|
||||
public void setPCLATHModel(int iValue) {
|
||||
|
||||
}
|
||||
|
||||
public void setPCLModel(int iValue) {
|
||||
|
||||
}
|
||||
|
||||
public void setFSRModel(int iValue) {
|
||||
|
||||
}
|
||||
|
||||
public void setStatusModel(int iValue) {
|
||||
|
||||
}
|
||||
|
||||
public void setOptionModel(int iValue) {
|
||||
|
||||
}
|
||||
|
||||
public void setPrescalerModel(int iValue) {
|
||||
|
||||
}
|
||||
|
||||
public void setTMR0Model(int iValue) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setPortAPinXToYModel(int iPort, boolean bEnabled) {
|
||||
|
||||
}
|
||||
|
||||
public void setPortBPinXToYModel(int iPort, boolean bEnabled) {
|
||||
|
||||
}
|
||||
|
||||
public void setPortATrisXToYModel(int iPort, boolean bEnabled) {
|
||||
|
||||
}
|
||||
|
||||
public void setPortBTrisXToYModel(int iPort, boolean bEnabled) {
|
||||
|
||||
}
|
||||
|
||||
public void setRamModel(int[][] aiiRam) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void setQuarzModel(int iElement) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void loadFileToEEPROMModel(ArrayList<String> oData) {
|
||||
|
||||
}
|
||||
|
||||
public void saveSimulatorStateModel() {
|
||||
|
||||
}
|
||||
|
||||
public void loadSimulatorStateModel() {
|
||||
|
||||
}
|
||||
|
||||
public void exitSimulatorModel() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
package Control;
|
||||
|
||||
import Model.MyModel;
|
||||
import View.MyView;
|
||||
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.awt.event.KeyEvent;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JCheckBox;
|
||||
|
||||
public class MyControlModelRuntime implements ActionListener {
|
||||
|
||||
MyModel oMyModel;
|
||||
|
||||
ArrayList<JCheckBox> oBreakpoints;
|
||||
ArrayList<JButton> oControlButtons;
|
||||
|
||||
public MyControlModelRuntime(MyModel model, MyView view) {
|
||||
oMyModel = model;
|
||||
oControlButtons = view.getGUIMCMenu().getControlButtons();
|
||||
oBreakpoints = view.getGUITestFileTable().getCheckboxes();
|
||||
addActionListeners();
|
||||
}
|
||||
|
||||
private void startProgramEnvironment() {
|
||||
oMyModel.start();
|
||||
}
|
||||
|
||||
private void stepProgramEnvironment() {
|
||||
oMyModel.step();
|
||||
}
|
||||
|
||||
private void pauseProgramEnvironment() {
|
||||
oMyModel.pause();
|
||||
}
|
||||
|
||||
private void resetProgramEnvironment() {
|
||||
|
||||
}
|
||||
|
||||
public void controlWDTEnvironment(boolean bEnabled) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
int i = 0;
|
||||
for (JCheckBox oBreakpoint : oBreakpoints) {
|
||||
if (e.getSource() == oBreakpoint) {
|
||||
oMyModel.controlBreakpoint(i);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if (e.getSource() == oControlButtons.get(0)) {
|
||||
//startProgramEnvironment();
|
||||
System.out.println("Test");
|
||||
}
|
||||
if (e.getSource() == oControlButtons.get(1)) {
|
||||
|
||||
}
|
||||
if (e.getSource() == oControlButtons.get(2)) {
|
||||
|
||||
}
|
||||
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
private void addActionListeners() {
|
||||
if (oBreakpoints != null) {
|
||||
for (JCheckBox oBreakpoint : oBreakpoints) {
|
||||
oBreakpoint.addActionListener(this);
|
||||
}
|
||||
}
|
||||
if (oControlButtons != null) {
|
||||
for (JButton oButton : oControlButtons) {
|
||||
oButton.addActionListener(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,17 +2,21 @@ package Control;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import Model.MyModel;
|
||||
import Model.Microcontroller.PIC;
|
||||
import View.MyView;
|
||||
|
||||
/**
|
||||
* Class to set fields of parts of view.
|
||||
*/
|
||||
public class MyControlView {
|
||||
|
||||
MyView oMyView;
|
||||
MyModel oMyModel;
|
||||
PIC oPIC;
|
||||
|
||||
public MyControlView(MyModel model, MyView view) {
|
||||
public MyControlView(PIC oPIC, MyView view) {
|
||||
oMyView = view;
|
||||
oMyModel = model;
|
||||
this.oPIC = oPIC;
|
||||
updateView();
|
||||
}
|
||||
|
||||
public void updateView() {
|
||||
@@ -22,6 +26,7 @@ public class MyControlView {
|
||||
setRamView();
|
||||
setRegistersDetailed();
|
||||
setStack();
|
||||
setTestFileTable();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -31,19 +36,19 @@ public class MyControlView {
|
||||
|
||||
//Get values from pic
|
||||
int[] aiValues = new int[9];
|
||||
aiValues[0] = oMyModel.getPIC().getRam().get_TMR0();
|
||||
aiValues[1] = oMyModel.getPIC().getRam().get_Programcounter();
|
||||
aiValues[2] = oMyModel.getPIC().getRam().get_STATUS();
|
||||
aiValues[3] = oMyModel.getPIC().getRam().get_PCLATH();
|
||||
aiValues[4] = oMyModel.getPIC().getRam().get_FSR();
|
||||
aiValues[5] = oMyModel.getPIC().getRam().get_PCL();
|
||||
aiValues[6] = oMyModel.getPIC().getRam().get_OPTION();
|
||||
if (oMyModel.getPIC().getRam().get_PSA()) {
|
||||
aiValues[7] = oMyModel.getPIC().getRam().get_WDT_PrescalerRate();
|
||||
aiValues[0] = oPIC.getRam().get_TMR0();
|
||||
aiValues[1] = oPIC.getRam().get_Programcounter();
|
||||
aiValues[2] = oPIC.getRam().get_STATUS();
|
||||
aiValues[3] = oPIC.getRam().get_PCLATH();
|
||||
aiValues[4] = oPIC.getRam().get_FSR();
|
||||
aiValues[5] = oPIC.getRam().get_PCL();
|
||||
aiValues[6] = oPIC.getRam().get_OPTION();
|
||||
if (oPIC.getRam().get_PSA()) {
|
||||
aiValues[7] = oPIC.getRam().get_WDT_PrescalerRate();
|
||||
} else {
|
||||
aiValues[7] = oMyModel.getPIC().getRam().get_TMR0_PrescalerRate();
|
||||
aiValues[7] = oPIC.getRam().get_TMR0_PrescalerRate();
|
||||
}
|
||||
aiValues[8] = oMyModel.getPIC().get_WRegister();
|
||||
aiValues[8] = oPIC.get_WRegister();
|
||||
|
||||
//Fill gui element with gathered values
|
||||
oMyView.getGUIRegister().setRegisters(aiValues);
|
||||
@@ -53,9 +58,9 @@ public class MyControlView {
|
||||
* Sets detailed register-table values to values from PIC.
|
||||
*/
|
||||
public void setRegistersDetailed() {
|
||||
int iStatus = oMyModel.getPIC().getRam().get_STATUS();
|
||||
int iOption = oMyModel.getPIC().getRam().get_OPTION();
|
||||
int iIntcon = oMyModel.getPIC().getRam().get_INTCON();
|
||||
int iStatus = oPIC.getRam().get_STATUS();
|
||||
int iOption = oPIC.getRam().get_OPTION();
|
||||
int iIntcon = oPIC.getRam().get_INTCON();
|
||||
|
||||
int iS0 = ((iStatus & 1) == 1) ? 1:0;
|
||||
int iS1 = ((iStatus & 2) == 2) ? 1:0;
|
||||
@@ -101,11 +106,11 @@ public class MyControlView {
|
||||
|
||||
boolean[] abEnabled = new boolean[10];
|
||||
|
||||
abEnabled[0] = oMyModel.getPIC().getRam().get_TRISA0();
|
||||
abEnabled[1] = oMyModel.getPIC().getRam().get_TRISA1();
|
||||
abEnabled[2] = oMyModel.getPIC().getRam().get_TRISA2();
|
||||
abEnabled[3] = oMyModel.getPIC().getRam().get_TRISA3();
|
||||
abEnabled[4] = oMyModel.getPIC().getRam().get_TRISA4();
|
||||
abEnabled[0] = oPIC.getRam().get_TRISA0();
|
||||
abEnabled[1] = oPIC.getRam().get_TRISA1();
|
||||
abEnabled[2] = oPIC.getRam().get_TRISA2();
|
||||
abEnabled[3] = oPIC.getRam().get_TRISA3();
|
||||
abEnabled[4] = oPIC.getRam().get_TRISA4();
|
||||
|
||||
abEnabled[5] = true;
|
||||
abEnabled[6] = true;
|
||||
@@ -123,14 +128,14 @@ public class MyControlView {
|
||||
|
||||
boolean[] abEnabled = new boolean[16];
|
||||
|
||||
abEnabled[0] = oMyModel.getPIC().getRam().get_TRISB0();
|
||||
abEnabled[1] = oMyModel.getPIC().getRam().get_TRISB1();
|
||||
abEnabled[2] = oMyModel.getPIC().getRam().get_TRISB2();
|
||||
abEnabled[3] = oMyModel.getPIC().getRam().get_TRISB3();
|
||||
abEnabled[4] = oMyModel.getPIC().getRam().get_TRISB4();
|
||||
abEnabled[5] = oMyModel.getPIC().getRam().get_TRISB5();
|
||||
abEnabled[6] = oMyModel.getPIC().getRam().get_TRISB6();
|
||||
abEnabled[7] = oMyModel.getPIC().getRam().get_TRISB7();
|
||||
abEnabled[0] = oPIC.getRam().get_TRISB0();
|
||||
abEnabled[1] = oPIC.getRam().get_TRISB1();
|
||||
abEnabled[2] = oPIC.getRam().get_TRISB2();
|
||||
abEnabled[3] = oPIC.getRam().get_TRISB3();
|
||||
abEnabled[4] = oPIC.getRam().get_TRISB4();
|
||||
abEnabled[5] = oPIC.getRam().get_TRISB5();
|
||||
abEnabled[6] = oPIC.getRam().get_TRISB6();
|
||||
abEnabled[7] = oPIC.getRam().get_TRISB7();
|
||||
|
||||
abEnabled[8] = true;
|
||||
abEnabled[9] = true;
|
||||
@@ -146,8 +151,8 @@ public class MyControlView {
|
||||
|
||||
public void setRamView() {
|
||||
int[] aiData;
|
||||
int[] aiBank0 = oMyModel.getPIC().getRam().get_Bank0();
|
||||
int[] aiBank1 = oMyModel.getPIC().getRam().get_Bank1();
|
||||
int[] aiBank0 = oPIC.getRam().get_Bank0();
|
||||
int[] aiBank1 = oPIC.getRam().get_Bank1();
|
||||
|
||||
aiData = new int[256];
|
||||
for (int i = 0; i < 128; i++) {
|
||||
@@ -162,7 +167,22 @@ public class MyControlView {
|
||||
}
|
||||
|
||||
public void setStack() {
|
||||
oMyView.getGUIStack().setStack(oMyModel.getPIC().getStack().getSTACK());
|
||||
oMyView.getGUIStack().setStack(oPIC.getStack().getSTACK());
|
||||
}
|
||||
|
||||
public void setTestFileTable() {
|
||||
if (oPIC.getEeprom().getProgramLines() != null) {
|
||||
if (oPIC.getRam().get_LastProgramcounter() > -1) {
|
||||
oMyView.getGUITestFileTable().unmarkLine(oPIC.getEeprom().getProgramLine(oPIC.getRam().get_LastProgramcounter()));
|
||||
oMyView.getGUITestFileTable().markLine(oPIC.getEeprom().getProgramLine(oPIC.getRam().get_Programcounter()));
|
||||
} else {
|
||||
int[] aiProgList = oPIC.getEeprom().getProgramLines();
|
||||
for (int i = 0; i < aiProgList.length; i++) {
|
||||
oMyView.getGUITestFileTable().unmarkLine(aiProgList[i]);
|
||||
}
|
||||
oMyView.getGUITestFileTable().markLine(oPIC.getEeprom().getProgramLine(0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void startProgramView() {
|
||||
@@ -205,4 +225,8 @@ public class MyControlView {
|
||||
public void exitSimulatorView() {
|
||||
|
||||
}
|
||||
|
||||
public void setPIC(PIC oPic) {
|
||||
oPIC = oPic;
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ public class Bitmask {
|
||||
* @param oPIC
|
||||
*/
|
||||
public int bitMaskDecoderAndExecuteCommand(int iCommandAsIntToMask, PIC oPIC) {
|
||||
|
||||
System.out.println("Command " + Integer.toHexString(iCommandAsIntToMask));
|
||||
//Return-value will be -1 if command can't be read.
|
||||
int iDecodedCommand = -1;
|
||||
|
||||
|
||||
@@ -12,11 +12,38 @@ public class EEPROM
|
||||
private int[] eeprom;
|
||||
private int eepromLength = 0;
|
||||
|
||||
private int[] aiProgramLines;
|
||||
|
||||
public EEPROM()
|
||||
{
|
||||
eeprom = new int[1024];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns array of program lines in data
|
||||
* @return
|
||||
*/
|
||||
public int[] getProgramLines() {
|
||||
return aiProgramLines;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return element i of program lines in data
|
||||
* @param i
|
||||
* @return
|
||||
*/
|
||||
public int getProgramLine(int i) {
|
||||
return aiProgramLines[i];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets program lines of data
|
||||
* @param aiProgLines
|
||||
*/
|
||||
public void setProgramLines(int[] aiProgLines) {
|
||||
aiProgramLines = aiProgLines;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns element of index element in eeprom-array.
|
||||
* @param element index of array.
|
||||
|
||||
@@ -1207,9 +1207,6 @@ public class PIC {
|
||||
public void SUBLW(int eightK) {
|
||||
int wRegValue = get_WRegister();
|
||||
|
||||
//Build Two's complement
|
||||
//eightK = (eightK ^ 0b11111111) + 1;
|
||||
|
||||
//Build Two's complement
|
||||
wRegValue = (wRegValue ^ 0b11111111) + 1;
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ public class RAM {
|
||||
private int[] bank1;
|
||||
|
||||
//Last programmcounter for function getLastLine in main.
|
||||
private int lastProgramcounter;
|
||||
private int lastProgramcounter = -1;
|
||||
|
||||
//
|
||||
private int iPrescaledTMR0;
|
||||
|
||||
5
src/Model/Microcontroller/RUNTIMER.java
Normal file
5
src/Model/Microcontroller/RUNTIMER.java
Normal file
@@ -0,0 +1,5 @@
|
||||
package Model.Microcontroller;
|
||||
|
||||
public class RUNTIMER {
|
||||
|
||||
}
|
||||
@@ -1,160 +1,178 @@
|
||||
package Model;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
|
||||
import Model.Microcontroller.Bitmask;
|
||||
import Model.Microcontroller.PIC;
|
||||
import Model.Microcontroller.WATCHDOG;
|
||||
import View.GUIMainFrame;
|
||||
|
||||
public class MyModel {
|
||||
private PIC oPIC;
|
||||
public class MyModel extends Thread {
|
||||
PIC oPIC = new PIC();
|
||||
|
||||
MyModelData oMyModelData;
|
||||
|
||||
private int iModelState = 3;
|
||||
private int iActualLine;
|
||||
private int iLastLine;
|
||||
boolean bStopProgram = false;
|
||||
|
||||
private ArrayList<Integer> listBreakpoints = new ArrayList<Integer>();
|
||||
int iProgState = 0;
|
||||
int iVisualInterval = 0;
|
||||
|
||||
private long liRuntimeRun;
|
||||
private long liRuntimeStep;
|
||||
double dRTIncrVal = 0;
|
||||
|
||||
private boolean[] bBreakpoints;
|
||||
private boolean[] abBreakpoints;
|
||||
|
||||
private WATCHDOG watchdog;
|
||||
GUIMainFrame oMainFrame;
|
||||
ConcurrentLinkedQueue<Integer> qReceivedCommands;
|
||||
ConcurrentLinkedQueue<MyModelData> qDataToModel;
|
||||
ConcurrentLinkedQueue<PIC> qDataToView;
|
||||
|
||||
public MyModel() {
|
||||
oPIC = new PIC();
|
||||
public MyModel(ConcurrentLinkedQueue<Integer> qCommands, ConcurrentLinkedQueue<PIC> qDataS, ConcurrentLinkedQueue<MyModelData> qDataR) {
|
||||
qReceivedCommands = qCommands;
|
||||
qDataToView = qDataS;
|
||||
qDataToModel = qDataR;
|
||||
}
|
||||
|
||||
public PIC getPIC() {
|
||||
return this.oPIC;
|
||||
@Override
|
||||
public void run() {
|
||||
//Check if end or error
|
||||
while (!bStopProgram) {
|
||||
//Check if element to set model
|
||||
while (!qDataToModel.isEmpty()) {
|
||||
setModel(qDataToModel.poll());
|
||||
}
|
||||
//Check if element at command-queue
|
||||
if (!qReceivedCommands.isEmpty()) {
|
||||
/* -1 == ERROR, 0 == END, 1 == START, 2 == PAUSE, 3 == RESET*/
|
||||
iProgState = qReceivedCommands.poll();
|
||||
switch (iProgState) {
|
||||
case (-1): {
|
||||
System.out.println("Fehler");
|
||||
bStopProgram = true;
|
||||
}break;
|
||||
case (0): {
|
||||
System.out.println("Programm wurde beendet.");
|
||||
bStopProgram = true;
|
||||
}break;
|
||||
case (1): {
|
||||
//start program
|
||||
while (iProgState == 1) {
|
||||
//Check if pause/stop was pressed
|
||||
if (!qReceivedCommands.isEmpty()) {
|
||||
iProgState = qReceivedCommands.poll();
|
||||
}
|
||||
//Check if breakpoint is set
|
||||
if (abBreakpoints != null) {
|
||||
if (!abBreakpoints[oPIC.getRam().get_Programcounter()]) {
|
||||
if(iVisualInterval > 0) {
|
||||
try {
|
||||
Thread.sleep(iVisualInterval * 1000);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
step();
|
||||
qDataToView.add(oPIC);
|
||||
} else {
|
||||
//Pause program
|
||||
iProgState = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}break;
|
||||
case (2): {
|
||||
|
||||
}break;
|
||||
case (3): {
|
||||
oPIC.resetPIC();
|
||||
qDataToView.add(oPIC); //TODO
|
||||
}break;
|
||||
case (4): {
|
||||
if (abBreakpoints != null) {
|
||||
//Check if breakpoint is set
|
||||
if (!abBreakpoints[oPIC.getRam().get_Programcounter()]) {
|
||||
step();
|
||||
qDataToView.add(oPIC); //TODO
|
||||
}
|
||||
} else {
|
||||
System.out.println("Please load file!");
|
||||
}
|
||||
}break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private int getModelState() {
|
||||
return iModelState;
|
||||
}
|
||||
|
||||
/**
|
||||
* -1 == ERROR, 0 == END, 1 == START, 2 == PAUSE, 3 == RESET
|
||||
* @param i
|
||||
*/
|
||||
public void setModelState(int i) {
|
||||
iModelState = i;
|
||||
}
|
||||
|
||||
public ArrayList<Integer> getBreakpointsList() {
|
||||
return listBreakpoints;
|
||||
}
|
||||
|
||||
public void setBreakpointsList(ArrayList<Integer> liBreakpoints) {
|
||||
listBreakpoints = liBreakpoints;
|
||||
bBreakpoints = new boolean[listBreakpoints.size()];
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public int getActualLine() {
|
||||
return iActualLine;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public int getLastLine() {
|
||||
return iLastLine;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public long getRuntimeRun() {
|
||||
return liRuntimeRun;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public long getRuntimeStep() {
|
||||
return liRuntimeStep;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public WATCHDOG getWatchdog() {
|
||||
return watchdog;
|
||||
}
|
||||
|
||||
public void step() {
|
||||
private void step() {
|
||||
//Check if step valid
|
||||
if (oPIC.getRam().get_Programcounter() < (oPIC.getEeprom().getLengthEEPROM() - 1)) {
|
||||
final long timeStart = System.nanoTime();
|
||||
|
||||
if (oPIC.getRam().get_Programcounter() < (oPIC.getEeprom().getLengthEEPROM())) {
|
||||
//Makes one step through the eeprom.
|
||||
Bitmask oBitmask = new Bitmask();
|
||||
oBitmask.bitMaskDecoderAndExecuteCommand(oPIC.getEeprom().getElement(oPIC.getRam().get_Programcounter()), oPIC);
|
||||
|
||||
final long timeEnd = System.nanoTime();
|
||||
|
||||
liRuntimeStep += (timeEnd - timeStart);
|
||||
|
||||
qDataToView.add(oPIC);
|
||||
} else {
|
||||
System.out.println("Step invalid, end of file reached!");
|
||||
}
|
||||
}
|
||||
|
||||
public void start() {
|
||||
if (getModelState() != 2) { //Do not start again if paused, instead call start to unpause only.
|
||||
final long timeStart = System.nanoTime();
|
||||
private void setQuarzSpeed(int iInterval) { //TODO Quartz
|
||||
switch (iInterval) {
|
||||
//10 {"32 kHz", "100 kHz", "500 kHz", "1 MHz", "2 MHz", "4 MHz", "8 MHz", "12 MHz", "16 MHz", "20 MHz"}
|
||||
case 0: {
|
||||
//32 kHz =>
|
||||
dRTIncrVal = (4 / 0.032);
|
||||
}break;
|
||||
|
||||
//workWithWatchdog(1, 1);
|
||||
//Check if set breakpoint reached or program was stopped or interrupt
|
||||
|
||||
while (getModelState() != 0) {
|
||||
switch (iModelState) {
|
||||
case 1: {
|
||||
//100kHz => 0.000010s
|
||||
dRTIncrVal = (4 / 0.1);
|
||||
}break;
|
||||
|
||||
case 1: { //START
|
||||
step();
|
||||
//
|
||||
//workWithWatchdog(1, 2);
|
||||
final long timeEnd = System.nanoTime();
|
||||
liRuntimeRun += timeEnd - timeStart;
|
||||
oMainFrame.updateWindow();
|
||||
}break;
|
||||
case 2: {
|
||||
//500kHz => 0.0000020s
|
||||
dRTIncrVal = (4 / 0.5);
|
||||
}break;
|
||||
|
||||
case 2: { //PAUSE resume() has to be called to continue
|
||||
while (iModelState == 2) {}
|
||||
}break;
|
||||
}
|
||||
}
|
||||
} else { //Unpause
|
||||
iModelState = 1;
|
||||
case 3: {
|
||||
//1MHz => 0.0000010s
|
||||
dRTIncrVal = (4 / 1);
|
||||
}break;
|
||||
|
||||
case 4: {
|
||||
//2MHz => 0.0000005s
|
||||
dRTIncrVal = (4 / 2);
|
||||
}break;
|
||||
|
||||
case 5: {
|
||||
//4MHz => 0.00000025s 1 mükrosekunde
|
||||
dRTIncrVal = (4 / 4);
|
||||
}break;
|
||||
|
||||
case 6: {
|
||||
//8MHz => 0.000000125s
|
||||
dRTIncrVal = (4 / 8);
|
||||
}break;
|
||||
|
||||
case 7: {
|
||||
//12MHz => 0.00000008333333
|
||||
dRTIncrVal = (4 / 12);
|
||||
}break;
|
||||
|
||||
case 8: {
|
||||
//16MHz => 0.0000000625
|
||||
dRTIncrVal = (4 / 16);
|
||||
}break;
|
||||
|
||||
case 9: {
|
||||
//20MHz => 0.00000005
|
||||
dRTIncrVal = (4 / 20);
|
||||
}break;
|
||||
}
|
||||
}
|
||||
|
||||
public void reset() {
|
||||
if (getModelState() != 1) {
|
||||
oPIC.resetPIC();
|
||||
iModelState = 3; //RESET
|
||||
}
|
||||
}
|
||||
|
||||
public void pause() {
|
||||
iModelState = 2;
|
||||
}
|
||||
|
||||
public void controlBreakpoint(int iBreakpoint) {
|
||||
if (bBreakpoints != null) {
|
||||
bBreakpoints[iBreakpoint] = !bBreakpoints[iBreakpoint];
|
||||
System.out.println("Breakpoint " + iBreakpoint + " was set to " + bBreakpoints[iBreakpoint]);
|
||||
}
|
||||
private void setModel(MyModelData data) {
|
||||
oMyModelData = data;
|
||||
oPIC = oMyModelData.getPIC();
|
||||
abBreakpoints = oMyModelData.getBreakpoints();
|
||||
setQuarzSpeed(oMyModelData.getQuartzInterval());
|
||||
iVisualInterval = oMyModelData.getVisualInterval();
|
||||
}
|
||||
}
|
||||
|
||||
52
src/Model/MyModelData.java
Normal file
52
src/Model/MyModelData.java
Normal file
@@ -0,0 +1,52 @@
|
||||
package Model;
|
||||
|
||||
import Model.Microcontroller.PIC;
|
||||
|
||||
public class MyModelData {
|
||||
private PIC oPIC;
|
||||
private int iQuartzInterval;
|
||||
private int iVisualInterval;
|
||||
private boolean bWDTEnabled = false;
|
||||
|
||||
private boolean[] abBreakpoints;
|
||||
|
||||
public PIC getPIC() {
|
||||
return oPIC;
|
||||
}
|
||||
|
||||
public int getQuartzInterval() {
|
||||
return iQuartzInterval;
|
||||
}
|
||||
|
||||
public int getVisualInterval() {
|
||||
return iVisualInterval;
|
||||
}
|
||||
|
||||
public boolean[] getBreakpoints() {
|
||||
return abBreakpoints;
|
||||
}
|
||||
|
||||
public boolean getWDTEnabled() {
|
||||
return bWDTEnabled;
|
||||
}
|
||||
|
||||
public void setPIC(PIC pic) {
|
||||
this.oPIC = pic;
|
||||
}
|
||||
|
||||
public void setQuartzInterval(int iIndex) {
|
||||
this.iQuartzInterval = iIndex;
|
||||
}
|
||||
|
||||
public void setVisualInterval(int iIndex) {
|
||||
this.iVisualInterval = iIndex;
|
||||
}
|
||||
|
||||
public void setBreakpoints(boolean[] abBreakpoints) {
|
||||
this.abBreakpoints = abBreakpoints;
|
||||
}
|
||||
|
||||
public void setWDTEnabled(boolean bWDTEnabled) {
|
||||
this.bWDTEnabled = bWDTEnabled;
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,10 @@
|
||||
package Model.Runtime;
|
||||
package Model;
|
||||
|
||||
import Model.Microcontroller.PIC;
|
||||
|
||||
/**
|
||||
* Class to store program-state. TODO
|
||||
*/
|
||||
public class ProgramStepInformation {
|
||||
private PIC oPIC;
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package Model.Runtime;
|
||||
|
||||
import Control.MyControlModelPIC;
|
||||
import Control.MyControlModelRuntime;
|
||||
import Control.MyControlView;
|
||||
import Model.MyModel;
|
||||
import View.MyView;
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
MyModel oModel = new MyModel();
|
||||
MyView oView = new MyView(oModel);
|
||||
MyControlView oControlView = new MyControlView(oModel, oView);
|
||||
MyControlModelRuntime oControlModelRuntime = new MyControlModelRuntime(oModel, oView);
|
||||
MyControlModelPIC oControlModelPIC = new MyControlModelPIC(oModel, oView);
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package Model.Runtime;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Testfile {
|
||||
ArrayList<String> lsTestfile;
|
||||
|
||||
}
|
||||
39
src/Runtime/Main.java
Executable file
39
src/Runtime/Main.java
Executable file
@@ -0,0 +1,39 @@
|
||||
package Runtime;
|
||||
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
|
||||
import Control.MyControlModel;
|
||||
import Control.MyControlView;
|
||||
import Model.MyModel;
|
||||
import Model.MyModelData;
|
||||
import Model.Microcontroller.PIC;
|
||||
import View.MyView;
|
||||
|
||||
public class Main {
|
||||
|
||||
public static void main(String[] args) {
|
||||
PIC oPIC = new PIC();
|
||||
|
||||
ConcurrentLinkedQueue<Integer> qCommandsToModel = new ConcurrentLinkedQueue<Integer>();
|
||||
ConcurrentLinkedQueue<PIC> qDataToView = new ConcurrentLinkedQueue<PIC>();
|
||||
ConcurrentLinkedQueue<MyModelData> qDataToModel = new ConcurrentLinkedQueue<MyModelData>();
|
||||
|
||||
MyModel oModel = new MyModel(qCommandsToModel, qDataToView, qDataToModel);
|
||||
oModel.start();
|
||||
|
||||
MyView oView = new MyView();
|
||||
|
||||
MyControlView oControlView = new MyControlView(oPIC, oView);
|
||||
|
||||
new MyControlModel(oView, qCommandsToModel, qDataToModel);
|
||||
|
||||
//Check if model sent a new pic-element through queue and update view.
|
||||
while (qCommandsToModel.peek() > 0) {
|
||||
while (!qDataToView.isEmpty()) {
|
||||
PIC pic = qDataToView.poll();
|
||||
oControlView.setPIC(pic);
|
||||
oControlView.updateView();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package Model.Runtime;
|
||||
package Runtime;
|
||||
|
||||
public class TODO {
|
||||
|
||||
@@ -141,6 +141,7 @@ public class GUIMainFrame extends JFrame {
|
||||
}
|
||||
|
||||
public void updateWindow() {
|
||||
//update tables
|
||||
this.revalidate();
|
||||
this.repaint();
|
||||
}
|
||||
|
||||
@@ -2,32 +2,24 @@ package View;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.JCheckBox;
|
||||
import javax.swing.JFileChooser;
|
||||
import javax.swing.JMenu;
|
||||
import javax.swing.JMenuBar;
|
||||
import javax.swing.JMenuItem;
|
||||
|
||||
import Model.MyModel;
|
||||
import Model.EepromLoader.ReadEepromFile;
|
||||
|
||||
public class GUIMenuBar extends JMenuBar implements ActionListener {
|
||||
public class GUIMenuBar extends JMenuBar {
|
||||
|
||||
MyView oMyView;
|
||||
|
||||
MyModel oMyModel;
|
||||
|
||||
ArrayList<JCheckBox> oBreakpoints;
|
||||
ReadEepromFile oRef;
|
||||
boolean[] bBreakpointSet;
|
||||
int iTestFileLoaded = 0;
|
||||
|
||||
ArrayList<JMenuItem> oMenuItems = new ArrayList<JMenuItem>();
|
||||
//Custom separators because addSeparator(default) looks not nice.
|
||||
@@ -69,16 +61,16 @@ public class GUIMenuBar extends JMenuBar implements ActionListener {
|
||||
JMenuItem oAbout;
|
||||
|
||||
//German language array
|
||||
String[] sGermanLang = {"Datei", "Testdatei laden", "Programmzustand laden", "Programmzustand speichern", "Simulation beenden",
|
||||
String[][] sLanguages = {
|
||||
{"Datei", "Testdatei laden", "Programmzustand laden", "Programmzustand speichern", "Simulation beenden",
|
||||
"Ansicht", "Thema", "Dunkler Modus", "Heller Modus",
|
||||
"Microcontroller", "Programm starten", "Programm pausieren", "Programm zuruecksetzen", "Schritt fuer Schritt", "Bearbeitungsintervall", "Sofort", "1 Sekunde", "2 Sekunden",
|
||||
"Hilfe", "Sprache", "Deutsch", "Englisch", "Anleitung", "Ueber"};
|
||||
|
||||
//English language array
|
||||
String[] sEnglishLang = {"File", "Load Testfile", "Load Programstate", "Save Programstate", "Exit simulation",
|
||||
"View", "Theme", "Dark Theme", "Light Theme",
|
||||
"Microcontroller", "Start program", "Pause program", "Reset program", "Step by Step", "Workinterval", "Instant", "1 second", "2 seconds",
|
||||
"Help", "Language", "German", "English", "Manual", "About"};
|
||||
"Hilfe", "Sprache", "Deutsch", "Englisch", "Anleitung", "Ueber"},
|
||||
|
||||
{"File", "Load Testfile", "Load Programstate", "Save Programstate", "Exit simulation",
|
||||
"View", "Theme", "Dark Theme", "Light Theme",
|
||||
"Microcontroller", "Start program", "Pause program", "Reset program", "Step by Step", "Workinterval", "Instant", "1 second", "2 seconds",
|
||||
"Help", "Language", "German", "English", "Manual", "About"}};
|
||||
|
||||
//Color for separators is always the same.
|
||||
Color oColorSeparators = new Color(47, 47, 47);
|
||||
@@ -87,7 +79,7 @@ public class GUIMenuBar extends JMenuBar implements ActionListener {
|
||||
* Constructor initializes menubar.
|
||||
* @param frame
|
||||
*/
|
||||
public GUIMenuBar(MyModel model, MyView view) { //TODO maybe single components, with methods, of frame to set theme
|
||||
public GUIMenuBar(MyView view) {
|
||||
|
||||
//Custom Separators since default is not able to change background.
|
||||
oSeparator0 = new JMenuItem();
|
||||
@@ -106,77 +98,44 @@ public class GUIMenuBar extends JMenuBar implements ActionListener {
|
||||
//Referrence to change different parts of gui for theme.
|
||||
oMyView = view;
|
||||
|
||||
oMyModel = model;
|
||||
|
||||
//File
|
||||
oFileMenu = new JMenu(sGermanLang[0]);
|
||||
oLoadTestFile = new JMenuItem(sGermanLang[1]);
|
||||
oLoadProgStateItem = new JMenuItem(sGermanLang[2]);
|
||||
oSaveProgStateItem = new JMenuItem(sGermanLang[3]);
|
||||
oExitItem = new JMenuItem(sGermanLang[4]);
|
||||
oFileMenu = new JMenu(sLanguages[0][0]);
|
||||
oLoadTestFile = new JMenuItem(sLanguages[0][1]);
|
||||
oLoadProgStateItem = new JMenuItem(sLanguages[0][2]);
|
||||
oSaveProgStateItem = new JMenuItem(sLanguages[0][3]);
|
||||
oExitItem = new JMenuItem(sLanguages[0][4]);
|
||||
|
||||
//View
|
||||
oViewMenu = new JMenu(sGermanLang[5]);
|
||||
oChangeColors = new JMenu(sGermanLang[6]);
|
||||
oDarkTheme = new JMenuItem(sGermanLang[7]);
|
||||
oLightTheme = new JMenuItem(sGermanLang[8]);
|
||||
oViewMenu = new JMenu(sLanguages[0][5]);
|
||||
oChangeColors = new JMenu(sLanguages[0][6]);
|
||||
oDarkTheme = new JMenuItem(sLanguages[0][7]);
|
||||
oLightTheme = new JMenuItem(sLanguages[0][8]);
|
||||
|
||||
//Microcontroller
|
||||
oMicrocontroller = new JMenu(sGermanLang[9]);
|
||||
oStartProg = new JMenuItem(sGermanLang[10]);
|
||||
oPauseProg = new JMenuItem(sGermanLang[11]);
|
||||
oResetProg = new JMenuItem(sGermanLang[12]);
|
||||
oStepProg = new JMenuItem(sGermanLang[13]);
|
||||
oChangeWorkInterval = new JMenu(sGermanLang[14]);
|
||||
oIntervalASAP = new JMenuItem(sGermanLang[15]);
|
||||
oInterval1Sec = new JMenuItem(sGermanLang[16]);
|
||||
oInterval2Sec = new JMenuItem(sGermanLang[17]);
|
||||
oMicrocontroller = new JMenu(sLanguages[0][9]);
|
||||
oStartProg = new JMenuItem(sLanguages[0][10]);
|
||||
oPauseProg = new JMenuItem(sLanguages[0][11]);
|
||||
oResetProg = new JMenuItem(sLanguages[0][12]);
|
||||
oStepProg = new JMenuItem(sLanguages[0][13]);
|
||||
oChangeWorkInterval = new JMenu(sLanguages[0][14]);
|
||||
oIntervalASAP = new JMenuItem(sLanguages[0][15]);
|
||||
oInterval1Sec = new JMenuItem(sLanguages[0][16]);
|
||||
oInterval2Sec = new JMenuItem(sLanguages[0][17]);
|
||||
|
||||
//Help
|
||||
oHelpMenu = new JMenu(sGermanLang[18]);
|
||||
oChangeLanguageMenu = new JMenu(sGermanLang[19]);
|
||||
oGerLangItem = new JMenuItem(sGermanLang[20]);
|
||||
oEngLangItem = new JMenuItem(sGermanLang[21]);
|
||||
oManual = new JMenuItem(sGermanLang[22]);
|
||||
oAbout = new JMenuItem(sGermanLang[23]);
|
||||
oHelpMenu = new JMenu(sLanguages[0][18]);
|
||||
oChangeLanguageMenu = new JMenu(sLanguages[0][19]);
|
||||
oGerLangItem = new JMenuItem(sLanguages[0][20]);
|
||||
oEngLangItem = new JMenuItem(sLanguages[0][21]);
|
||||
oManual = new JMenuItem(sLanguages[0][22]);
|
||||
oAbout = new JMenuItem(sLanguages[0][23]);
|
||||
|
||||
fillList();
|
||||
setActionListeners();
|
||||
setGerMnemonics();
|
||||
buildMenubar();
|
||||
setTheme(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets ActionListeners to all items.
|
||||
*/
|
||||
private void setActionListeners() {
|
||||
//File
|
||||
oLoadTestFile.addActionListener(this);
|
||||
oLoadProgStateItem.addActionListener(this);
|
||||
oSaveProgStateItem.addActionListener(this);
|
||||
oExitItem.addActionListener(this);
|
||||
|
||||
//View
|
||||
oDarkTheme.addActionListener(this);
|
||||
oLightTheme.addActionListener(this);
|
||||
|
||||
//Microcontroller
|
||||
oStartProg.addActionListener(this);
|
||||
oPauseProg.addActionListener(this);
|
||||
oResetProg.addActionListener(this);
|
||||
oStepProg.addActionListener(this);
|
||||
oIntervalASAP.addActionListener(this);
|
||||
oInterval1Sec.addActionListener(this);
|
||||
oInterval2Sec.addActionListener(this);
|
||||
|
||||
//Help
|
||||
oGerLangItem.addActionListener(this);
|
||||
oEngLangItem.addActionListener(this);
|
||||
oManual.addActionListener(this);
|
||||
oAbout.addActionListener(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets english mnemonics.
|
||||
*/
|
||||
@@ -298,122 +257,47 @@ public class GUIMenuBar extends JMenuBar implements ActionListener {
|
||||
* Change language to overhanded language array.
|
||||
* @param lang = language to change to.
|
||||
*/
|
||||
private void changeLangMenuBar(String[] lang) {
|
||||
public void changeLangMenuBar(int iLang) {
|
||||
switch (iLang) {
|
||||
case 0: {
|
||||
setGerMnemonics();
|
||||
}break;
|
||||
case 1: {
|
||||
setEngMnemonics();
|
||||
}break;
|
||||
}
|
||||
|
||||
//File
|
||||
oFileMenu.setText(lang[0]);
|
||||
oLoadTestFile.setText(lang[1]);
|
||||
oLoadProgStateItem.setText(lang[2]);
|
||||
oSaveProgStateItem.setText(lang[3]);
|
||||
oExitItem.setText(lang[4]);
|
||||
oFileMenu.setText(sLanguages[iLang][0]);
|
||||
oLoadTestFile.setText(sLanguages[iLang][1]);
|
||||
oLoadProgStateItem.setText(sLanguages[iLang][2]);
|
||||
oSaveProgStateItem.setText(sLanguages[iLang][3]);
|
||||
oExitItem.setText(sLanguages[iLang][4]);
|
||||
|
||||
//View
|
||||
oViewMenu.setText(lang[5]);
|
||||
oChangeColors.setText(lang[6]);
|
||||
oDarkTheme.setText(lang[7]);
|
||||
oLightTheme.setText(lang[8]);
|
||||
oViewMenu.setText(sLanguages[iLang][5]);
|
||||
oChangeColors.setText(sLanguages[iLang][6]);
|
||||
oDarkTheme.setText(sLanguages[iLang][7]);
|
||||
oLightTheme.setText(sLanguages[iLang][8]);
|
||||
|
||||
//Microcontroller
|
||||
oMicrocontroller.setText(lang[9]);
|
||||
oStartProg.setText(lang[10]);
|
||||
oPauseProg.setText(lang[11]);
|
||||
oResetProg.setText(lang[12]);
|
||||
oStepProg.setText(lang[13]);
|
||||
oChangeWorkInterval.setText(lang[14]);
|
||||
oIntervalASAP.setText(lang[15]);
|
||||
oInterval1Sec.setText(lang[16]);
|
||||
oInterval2Sec.setText(lang[17]);
|
||||
oMicrocontroller.setText(sLanguages[iLang][9]);
|
||||
oStartProg.setText(sLanguages[iLang][10]);
|
||||
oPauseProg.setText(sLanguages[iLang][11]);
|
||||
oResetProg.setText(sLanguages[iLang][12]);
|
||||
oStepProg.setText(sLanguages[iLang][13]);
|
||||
oChangeWorkInterval.setText(sLanguages[iLang][14]);
|
||||
oIntervalASAP.setText(sLanguages[iLang][15]);
|
||||
oInterval1Sec.setText(sLanguages[iLang][16]);
|
||||
oInterval2Sec.setText(sLanguages[iLang][17]);
|
||||
|
||||
//Help
|
||||
oHelpMenu.setText(lang[18]);
|
||||
oChangeLanguageMenu.setText(lang[19]);
|
||||
oGerLangItem.setText(lang[20]);
|
||||
oEngLangItem.setText(lang[21]);
|
||||
oManual.setText(lang[22]);
|
||||
oAbout.setText(lang[23]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
//File
|
||||
if (e.getSource() == oLoadTestFile) {
|
||||
loadTestFile();
|
||||
}
|
||||
if (e.getSource() == oLoadProgStateItem) {
|
||||
System.out.println("Bro do you even code? load");
|
||||
//TODO
|
||||
}
|
||||
if (e.getSource() == oSaveProgStateItem) {
|
||||
System.out.println("Bro do you even code? save");
|
||||
//TODO
|
||||
System.exit(0);
|
||||
}
|
||||
if (e.getSource() == oExitItem) {
|
||||
System.out.println("Bro do you even code? exit");
|
||||
//TODO
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
//View
|
||||
//Change to dark theme
|
||||
if (e.getSource() == oDarkTheme) {
|
||||
System.out.println("It's gettin dark brooo"); //TODO
|
||||
setTheme(1);
|
||||
oMyView.setTheme(1);
|
||||
}
|
||||
//Change to light theme
|
||||
if (e.getSource() == oLightTheme) {
|
||||
System.out.println("Death to all vampires!"); //TODO
|
||||
setTheme(0);
|
||||
oMyView.setTheme(0);
|
||||
}
|
||||
|
||||
//Microcontroller
|
||||
if (e.getSource() == oStartProg) {
|
||||
System.out.println("Start prog"); //TODO
|
||||
}
|
||||
if (e.getSource() == oPauseProg) {
|
||||
System.out.println("oPauseProg"); //TODO
|
||||
}
|
||||
if (e.getSource() == oResetProg) {
|
||||
System.out.println("oResetProg"); //TODO
|
||||
}
|
||||
if (e.getSource() == oStepProg) {
|
||||
System.out.println("oStepProg"); //TODO
|
||||
}
|
||||
if (e.getSource() == oIntervalASAP) {
|
||||
System.out.println("oIntervalASAP"); //TODO
|
||||
}
|
||||
if (e.getSource() == oInterval1Sec) {
|
||||
System.out.println("oInterval1Sec"); //TODO
|
||||
}
|
||||
if (e.getSource() == oInterval2Sec) {
|
||||
System.out.println("oInterval2Sec"); //TODO
|
||||
}
|
||||
|
||||
//Help
|
||||
//Change language at gui.
|
||||
if (e.getSource() == oGerLangItem) {
|
||||
changeLangMenuBar(sGermanLang);
|
||||
setGerMnemonics();
|
||||
oMyView.setLanguage(0);
|
||||
//TODO rest of gui
|
||||
}
|
||||
if (e.getSource() == oEngLangItem) {
|
||||
changeLangMenuBar(sEnglishLang);
|
||||
setEngMnemonics();
|
||||
oMyView.setLanguage(1);
|
||||
//TODO rest of gui
|
||||
}
|
||||
//Show manual
|
||||
if (e.getSource() == oManual) {
|
||||
//TODO
|
||||
}
|
||||
//Show about
|
||||
if (e.getSource() == oAbout) {
|
||||
//TODO
|
||||
}
|
||||
|
||||
controlBreakpoints(e);
|
||||
oHelpMenu.setText(sLanguages[iLang][18]);
|
||||
oChangeLanguageMenu.setText(sLanguages[iLang][19]);
|
||||
oGerLangItem.setText(sLanguages[iLang][20]);
|
||||
oEngLangItem.setText(sLanguages[iLang][21]);
|
||||
oManual.setText(sLanguages[iLang][22]);
|
||||
oAbout.setText(sLanguages[iLang][23]);
|
||||
}
|
||||
|
||||
private void fillList() {
|
||||
@@ -640,75 +524,11 @@ public class GUIMenuBar extends JMenuBar implements ActionListener {
|
||||
}
|
||||
}
|
||||
|
||||
private void loadTestFile() {
|
||||
File oFile;
|
||||
//select file to open
|
||||
JFileChooser oFileChooser = new JFileChooser();
|
||||
int iResponse = oFileChooser.showOpenDialog(null);
|
||||
if (iResponse == JFileChooser.APPROVE_OPTION) {
|
||||
oFile = new File(oFileChooser.getSelectedFile().getAbsolutePath());
|
||||
//System.out.println(oFile);
|
||||
oRef = new ReadEepromFile();
|
||||
oRef.setData(oFile);
|
||||
oRef.setOPCode(oRef.getData());
|
||||
oMyView.getGUITestFileTable().setData(oRef.getData());
|
||||
|
||||
setBreakpointsActionListeners();
|
||||
|
||||
oRef.readFileAndWriteToEEPROM(oMyModel.getPIC());
|
||||
oMyView.getGUIMainFrame().updateWindow();
|
||||
iTestFileLoaded = 1;
|
||||
}
|
||||
}
|
||||
|
||||
private void setBreakpointsActionListeners() {
|
||||
ArrayList<String> data = oRef.getData();
|
||||
int iDataSize = data.size();
|
||||
ArrayList<String> opcode = oRef.getOPCode();
|
||||
|
||||
int iOPCodeSize = opcode.size();
|
||||
//If testfile was loaded before, reset all checkboxes
|
||||
if (iTestFileLoaded > 0) {
|
||||
oBreakpoints = oMyView.getGUITestFileTable().getCheckboxes();
|
||||
for (int i = 0; i < iDataSize; i++) {
|
||||
oBreakpoints.get(i).setEnabled(false);
|
||||
}
|
||||
}
|
||||
//Enable only checkboxes which belong to real code
|
||||
for (int i = 0; i < iDataSize; i++) {
|
||||
for (int j = 0; j < iOPCodeSize; j++) {
|
||||
if (data.get(i).equals(opcode.get(j))) {
|
||||
oBreakpoints = oMyView.getGUITestFileTable().getCheckboxes();
|
||||
oBreakpoints.get(i).setEnabled(true);
|
||||
oBreakpoints.get(i).addActionListener(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
bBreakpointSet = new boolean[iOPCodeSize];
|
||||
}
|
||||
|
||||
private void controlBreakpoints(ActionEvent e) {
|
||||
if (oRef != null) {
|
||||
int iOPCode = oRef.getOPCode().size();
|
||||
if (iOPCode > 0) {
|
||||
for (int i = 0; i < oBreakpoints.size(); i++) {
|
||||
if (e.getSource() == oBreakpoints.get(i)) {
|
||||
for (int j = 0; j < iOPCode; j++) {
|
||||
if (oRef.getOPCode().get(j).equals(oRef.getData().get(i))) {
|
||||
bBreakpointSet[j] = !bBreakpointSet[j];
|
||||
if (bBreakpointSet[j])
|
||||
System.out.println("Breakpoint " + j + " got set.");
|
||||
else
|
||||
System.out.println("Breakpoint " + j + " got reset.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean[] getBreakpoints() {
|
||||
return bBreakpointSet;
|
||||
}
|
||||
|
||||
public ArrayList<JMenuItem> getMenuItems() {
|
||||
return oMenuItems;
|
||||
}
|
||||
}
|
||||
5
src/View/GUIProgramMemory.java
Normal file
5
src/View/GUIProgramMemory.java
Normal file
@@ -0,0 +1,5 @@
|
||||
package View;
|
||||
|
||||
public class GUIProgramMemory {
|
||||
|
||||
}
|
||||
@@ -194,11 +194,12 @@ public class GUITestFileTable extends JScrollPane {
|
||||
* Mark line at testfiletable.
|
||||
* @param iLineToMark
|
||||
*/
|
||||
public void markLine(int iLineToMark) { //TODO
|
||||
public void markLine(int iLineToMark) {
|
||||
if (iLineToMark > -1) {
|
||||
oLineInformation.get(iLineToMark).setForeground(getThemeColor()[3]);
|
||||
oLineInformation.get(iLineToMark).setBackground(getThemeColor()[4]);
|
||||
oLineInformation.get(iLineToMark).setBorder(BorderFactory.createLineBorder(getThemeColor()[5]));
|
||||
oLineInformation.get(iLineToMark * 2).setForeground(getThemeColor()[3]);
|
||||
oLineInformation.get(iLineToMark * 2).setBorder(BorderFactory.createLineBorder(getThemeColor()[3]));
|
||||
oLineInformation.get(iLineToMark * 2 + 1).setForeground(getThemeColor()[3]);
|
||||
oLineInformation.get(iLineToMark * 2 + 1).setBorder(BorderFactory.createLineBorder(getThemeColor()[3]));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -206,11 +207,12 @@ public class GUITestFileTable extends JScrollPane {
|
||||
* Unmark line at testfiletable.
|
||||
* @param iLineToUnmark
|
||||
*/
|
||||
public void unmarkLine(int iLineToUnmark) { //TODO
|
||||
public void unmarkLine(int iLineToUnmark) {
|
||||
if (iLineToUnmark > -1) {
|
||||
oLineInformation.get(iLineToUnmark).setForeground(getThemeColor()[0]);
|
||||
oLineInformation.get(iLineToUnmark).setBackground(getThemeColor()[1]);
|
||||
oLineInformation.get(iLineToUnmark).setBorder(BorderFactory.createLineBorder(getThemeColor()[2]));
|
||||
oLineInformation.get(iLineToUnmark * 2).setForeground(getThemeColor()[0]);
|
||||
oLineInformation.get(iLineToUnmark * 2).setBorder(BorderFactory.createLineBorder(getThemeColor()[2]));
|
||||
oLineInformation.get(iLineToUnmark * 2 + 1).setForeground(getThemeColor()[0]);
|
||||
oLineInformation.get(iLineToUnmark * 2 + 1).setBorder(BorderFactory.createLineBorder(getThemeColor()[2]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -82,6 +82,14 @@ public class GUITime extends JPanel {
|
||||
}
|
||||
}
|
||||
|
||||
public JComboBox<String> getQuarzComboBox() {
|
||||
return oIntervals;
|
||||
}
|
||||
|
||||
public JCheckBox getWDTEnableCheckbox() {
|
||||
return oEnableWDT;
|
||||
}
|
||||
|
||||
public void setRuntime(int iRuntime) {
|
||||
this.iRuntime = iRuntime;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package View;
|
||||
|
||||
import javax.swing.JPanel;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import Model.MyModel;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JCheckBox;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
public class MyView implements IMyView {
|
||||
|
||||
@@ -19,8 +21,8 @@ public class MyView implements IMyView {
|
||||
|
||||
private JPanel oGUIMainPanel;
|
||||
|
||||
public MyView(MyModel model) {
|
||||
oGUIMenuBar = new GUIMenuBar(model, this);
|
||||
public MyView() {
|
||||
oGUIMenuBar = new GUIMenuBar(this);
|
||||
oGUIMCMenu = new GUIMCMenu();
|
||||
oGUIPorts = new GUIPorts();
|
||||
oGUIRamTable = new GUIRamTable();
|
||||
@@ -48,13 +50,37 @@ public class MyView implements IMyView {
|
||||
}
|
||||
|
||||
public void setLanguage(int iLangNr) {
|
||||
oGUIMenuBar.changeLangMenuBar(iLangNr);
|
||||
oGUIMCMenu.setLanguage(iLangNr);
|
||||
oGUIRegister.setLanguage(iLangNr);
|
||||
oGUITestFileTable.setLanguage(iLangNr);
|
||||
oGUITime.setLanguage(iLangNr);
|
||||
}
|
||||
|
||||
public GUIMainFrame getGUIMainFrame() {
|
||||
|
||||
|
||||
public void test() {
|
||||
this.getGUITime().getQuarzComboBox();
|
||||
this.getGUIMenuBar().getMenuItems();
|
||||
}
|
||||
|
||||
public ArrayList<JButton> getControlButtons() {
|
||||
return this.getGUIMCMenu().getControlButtons();
|
||||
}
|
||||
|
||||
public ArrayList<JCheckBox> getCheckboxes() {
|
||||
return this.getGUITestFileTable().getCheckboxes();
|
||||
}
|
||||
|
||||
public JCheckBox getWDTEnableCheckbox() {
|
||||
return this.getGUITime().getWDTEnableCheckbox();
|
||||
}
|
||||
|
||||
public void updateWindow() {
|
||||
this.getGUIMainFrame().updateWindow();
|
||||
}
|
||||
|
||||
private GUIMainFrame getGUIMainFrame() {
|
||||
return this.oGUIMainFrame;
|
||||
}
|
||||
|
||||
@@ -93,4 +119,8 @@ public class MyView implements IMyView {
|
||||
public JPanel getGUIMainPanel() {
|
||||
return this.oGUIMainPanel;
|
||||
}
|
||||
|
||||
public GUIMenuBar getGUIMenuBar() {
|
||||
return oGUIMenuBar;
|
||||
}
|
||||
}
|
||||
16
src/View/MyViewData.java
Normal file
16
src/View/MyViewData.java
Normal file
@@ -0,0 +1,16 @@
|
||||
package View;
|
||||
|
||||
import Model.Microcontroller.PIC;
|
||||
|
||||
public class MyViewData {
|
||||
private PIC oPIC;
|
||||
|
||||
public PIC getPIC() {
|
||||
return oPIC;
|
||||
}
|
||||
|
||||
public void setPIC(PIC oPIC) {
|
||||
this.oPIC = oPIC;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user