mvc architecture started, started implementation of PORT A and B
This commit is contained in:
BIN
bin/Control/Control.class
Normal file
BIN
bin/Control/Control.class
Normal file
Binary file not shown.
BIN
bin/Control/IActions.class
Normal file
BIN
bin/Control/IActions.class
Normal file
Binary file not shown.
BIN
bin/Model/Backend/MyModel.class
Normal file
BIN
bin/Model/Backend/MyModel.class
Normal file
Binary file not shown.
Binary file not shown.
BIN
bin/View/GUIMainFrame.class
Normal file
BIN
bin/View/GUIMainFrame.class
Normal file
Binary file not shown.
Binary file not shown.
BIN
bin/View/GUIPorts.class
Normal file
BIN
bin/View/GUIPorts.class
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
bin/View/IMyView.class
Normal file
BIN
bin/View/IMyView.class
Normal file
Binary file not shown.
BIN
bin/View/MyView.class
Normal file
BIN
bin/View/MyView.class
Normal file
Binary file not shown.
Binary file not shown.
118
src/Control/Control.java
Normal file
118
src/Control/Control.java
Normal file
@@ -0,0 +1,118 @@
|
||||
package Control;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import Model.Backend.MyModel;
|
||||
import View.MyView;
|
||||
|
||||
public class Control implements IActions {
|
||||
|
||||
MyModel oModel;
|
||||
MyView oView;
|
||||
//put Objects to manipulate here
|
||||
|
||||
public Control(MyModel model, MyView view) {
|
||||
oModel = model;
|
||||
oView = view;
|
||||
}
|
||||
|
||||
public void getWRegister(int iValue) {
|
||||
|
||||
}
|
||||
|
||||
public void getPCintern(int iValue) {
|
||||
|
||||
}
|
||||
|
||||
public void getPCLATH(int iValue) {
|
||||
|
||||
}
|
||||
|
||||
public void getPCL(int iValue) {
|
||||
|
||||
}
|
||||
|
||||
public void getFSR(int iValue) {
|
||||
|
||||
}
|
||||
|
||||
public void getStatus(int iValue) {
|
||||
|
||||
}
|
||||
|
||||
public void getOption(int iValue) {
|
||||
|
||||
}
|
||||
|
||||
public void getPrescaler(int iValue) {
|
||||
|
||||
}
|
||||
|
||||
public void getTMR0(int iValue) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setPortAPinXToY(int iPort, boolean bEnabled) {
|
||||
|
||||
}
|
||||
|
||||
public void setPortBPinXToY(int iPort, boolean bEnabled) {
|
||||
|
||||
}
|
||||
|
||||
public void setPortATrisXToY(int iPort, boolean bEnabled) {
|
||||
|
||||
}
|
||||
|
||||
public void setPortBTrisXToY(int iPort, boolean bEnabled) {
|
||||
|
||||
}
|
||||
|
||||
public void getRam(int[][] aiiRam) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void startProgram() {
|
||||
|
||||
}
|
||||
|
||||
public void stepProgram() {
|
||||
|
||||
}
|
||||
|
||||
public void pauseProgram() {
|
||||
|
||||
}
|
||||
|
||||
public void resetProgram() {
|
||||
|
||||
}
|
||||
|
||||
public void controlWDT(boolean bEnabled) {
|
||||
|
||||
}
|
||||
|
||||
public void setQuarz(int iElement) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void loadFileToEEPROM(ArrayList<String> oData) {
|
||||
|
||||
}
|
||||
|
||||
public void saveSimulatorState() {
|
||||
|
||||
}
|
||||
|
||||
public void loadSimulatorState() {
|
||||
|
||||
}
|
||||
|
||||
public void exitSimulator() {
|
||||
|
||||
}
|
||||
}
|
||||
58
src/Control/IActions.java
Normal file
58
src/Control/IActions.java
Normal file
@@ -0,0 +1,58 @@
|
||||
package Control;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public interface IActions {
|
||||
|
||||
public void getWRegister(int iValue);
|
||||
|
||||
public void getPCintern(int iValue);
|
||||
|
||||
public void getPCLATH(int iValue);
|
||||
|
||||
public void getPCL(int iValue);
|
||||
|
||||
public void getFSR(int iValue);
|
||||
|
||||
public void getStatus(int iValue);
|
||||
|
||||
public void getOption(int iValue);
|
||||
|
||||
public void getPrescaler(int iValue);
|
||||
|
||||
public void getTMR0(int iValue);
|
||||
|
||||
|
||||
|
||||
public void setPortAPinXToY(int iPort, boolean bEnabled);
|
||||
|
||||
public void setPortBPinXToY(int iPort, boolean bEnabled);
|
||||
|
||||
public void setPortATrisXToY(int iPort, boolean bEnabled);
|
||||
|
||||
public void setPortBTrisXToY(int iPort, boolean bEnabled);
|
||||
|
||||
public void getRam(int[][] aiiRam);
|
||||
|
||||
|
||||
public void startProgram();
|
||||
|
||||
public void stepProgram();
|
||||
|
||||
public void pauseProgram();
|
||||
|
||||
public void resetProgram();
|
||||
|
||||
public void controlWDT(boolean bEnabled);
|
||||
|
||||
public void setQuarz(int iElement);
|
||||
|
||||
|
||||
public void loadFileToEEPROM(ArrayList<String> oData);
|
||||
|
||||
public void saveSimulatorState();
|
||||
|
||||
public void loadSimulatorState();
|
||||
|
||||
public void exitSimulator();
|
||||
}
|
||||
15
src/Model/Backend/MyModel.java
Normal file
15
src/Model/Backend/MyModel.java
Normal file
@@ -0,0 +1,15 @@
|
||||
package Model.Backend;
|
||||
|
||||
import Model.Backend.Microcontroller.PIC;
|
||||
|
||||
public class MyModel {
|
||||
PIC oPIC;
|
||||
|
||||
public MyModel(PIC pic) {
|
||||
oPIC = pic;
|
||||
}
|
||||
|
||||
public PIC getPIC() {
|
||||
return this.oPIC;
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,7 @@ import java.util.ArrayList;
|
||||
|
||||
import Model.Backend.Microcontroller.PIC;
|
||||
import Model.Backend.Microcontroller.WATCHDOG;
|
||||
import View.PIC_SIMULATOR_GUI_JAVA.GUIMainFrame;
|
||||
import View.GUIMainFrame;
|
||||
|
||||
public class Environment {
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package View.PIC_SIMULATOR_GUI_JAVA;
|
||||
package View;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Insets;
|
||||
@@ -117,6 +117,7 @@ public class GUIMainFrame extends JFrame {
|
||||
oMainPanel.add(oPanelRegisterInformation, c);
|
||||
oPanels.add(oPanelRegisterInformation);
|
||||
oPanels.add(oMainPanel);
|
||||
oMainPanel.add(new GUIPorts());
|
||||
this.add(oMainPanel);
|
||||
updateWindow();
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package View.PIC_SIMULATOR_GUI_JAVA;
|
||||
package View;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
132
src/View/GUIPorts.java
Normal file
132
src/View/GUIPorts.java
Normal file
@@ -0,0 +1,132 @@
|
||||
package View;
|
||||
|
||||
import java.awt.GridBagLayout;
|
||||
import java.awt.GridBagConstraints;
|
||||
|
||||
import javax.swing.JCheckBox;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
public class GUIPorts extends JPanel {
|
||||
|
||||
JPanel oPanelPortA = new JPanel();
|
||||
JPanel oPanelPortB = new JPanel();
|
||||
|
||||
JPanel oPanelPortAPins = new JPanel();
|
||||
JPanel oPanelPortATris = new JPanel();
|
||||
JPanel oPanelPortBPins = new JPanel();
|
||||
JPanel oPanelPortBTris = new JPanel();
|
||||
|
||||
JLabel oPortA = new JLabel("Port A");
|
||||
JLabel oPortB = new JLabel("Port B");
|
||||
JLabel oTrisA = new JLabel("Tris");
|
||||
JLabel oTrisB = new JLabel("Tris");
|
||||
JLabel oPinA = new JLabel("Pin");
|
||||
JLabel oPinB = new JLabel("Pin");
|
||||
|
||||
JCheckBox oRA4 = new JCheckBox("RA4");
|
||||
JCheckBox oRA3 = new JCheckBox("RA3");
|
||||
JCheckBox oRA2 = new JCheckBox("RA2");
|
||||
JCheckBox oRA1 = new JCheckBox("RA1");
|
||||
JCheckBox oRA0 = new JCheckBox("RA0");
|
||||
|
||||
JCheckBox oTRISA4 = new JCheckBox("TRISA4");
|
||||
JCheckBox oTRISA3 = new JCheckBox("TRISA3");
|
||||
JCheckBox oTRISA2 = new JCheckBox("TRISA2");
|
||||
JCheckBox oTRISA1 = new JCheckBox("TRISA1");
|
||||
JCheckBox oTRISA0 = new JCheckBox("TRISA0");
|
||||
|
||||
JCheckBox oRB7 = new JCheckBox("RB7");
|
||||
JCheckBox oRB6 = new JCheckBox("RB6");
|
||||
JCheckBox oRB5 = new JCheckBox("RB5");
|
||||
JCheckBox oRB4 = new JCheckBox("RB4");
|
||||
JCheckBox oRB3 = new JCheckBox("RB3");
|
||||
JCheckBox oRB2 = new JCheckBox("RB2");
|
||||
JCheckBox oRB1 = new JCheckBox("RB1");
|
||||
JCheckBox oRB0 = new JCheckBox("RB0");
|
||||
|
||||
JCheckBox oTRISB7 = new JCheckBox("TRISB7");
|
||||
JCheckBox oTRISB6 = new JCheckBox("TRISB6");
|
||||
JCheckBox oTRISB5 = new JCheckBox("TRISB5");
|
||||
JCheckBox oTRISB4 = new JCheckBox("TRISB4");
|
||||
JCheckBox oTRISB3 = new JCheckBox("TRISB3");
|
||||
JCheckBox oTRISB2 = new JCheckBox("TRISB2");
|
||||
JCheckBox oTRISB1 = new JCheckBox("TRISB1");
|
||||
JCheckBox oTRISB0 = new JCheckBox("TRISB0");
|
||||
|
||||
public GUIPorts() {
|
||||
buildGUIPorts();
|
||||
}
|
||||
|
||||
private void buildGUIPorts() {
|
||||
oPanelPortAPins.add(oRA4);
|
||||
oPanelPortAPins.add(oRA3);
|
||||
oPanelPortAPins.add(oRA2);
|
||||
oPanelPortAPins.add(oRA1);
|
||||
oPanelPortAPins.add(oRA0);
|
||||
|
||||
oPanelPortATris.add(oTRISA4);
|
||||
oPanelPortATris.add(oTRISA3);
|
||||
oPanelPortATris.add(oTRISA2);
|
||||
oPanelPortATris.add(oTRISA1);
|
||||
oPanelPortATris.add(oTRISA0);
|
||||
|
||||
oPanelPortBPins.add(oRB7);
|
||||
oPanelPortBPins.add(oRB6);
|
||||
oPanelPortBPins.add(oRB5);
|
||||
oPanelPortBPins.add(oRB4);
|
||||
oPanelPortBPins.add(oRB3);
|
||||
oPanelPortBPins.add(oRB2);
|
||||
oPanelPortBPins.add(oRB1);
|
||||
oPanelPortBPins.add(oRB0);
|
||||
|
||||
oPanelPortBTris.add(oTRISB7);
|
||||
oPanelPortBTris.add(oTRISB6);
|
||||
oPanelPortBTris.add(oTRISB5);
|
||||
oPanelPortBTris.add(oTRISB4);
|
||||
oPanelPortBTris.add(oTRISB3);
|
||||
oPanelPortBTris.add(oTRISB2);
|
||||
oPanelPortBTris.add(oTRISB1);
|
||||
oPanelPortBTris.add(oTRISB0);
|
||||
|
||||
oPanelPortA.setLayout(new GridBagLayout());
|
||||
oPanelPortB.setLayout(new GridBagLayout());
|
||||
|
||||
GridBagConstraints oConstraints = new GridBagConstraints();
|
||||
oConstraints.anchor = GridBagConstraints.WEST;
|
||||
|
||||
oConstraints.gridx = 0;
|
||||
oConstraints.gridy = 0;
|
||||
oPanelPortA.add(oPortA, oConstraints);
|
||||
oConstraints.gridy = 1;
|
||||
oPanelPortA.add(oPinA, oConstraints);
|
||||
oConstraints.gridx = 1;
|
||||
oPanelPortA.add(oPanelPortAPins, oConstraints);
|
||||
oConstraints.gridx = 0;
|
||||
oConstraints.gridy = 2;
|
||||
oPanelPortA.add(oTrisA);
|
||||
oConstraints.gridx = 1;
|
||||
oPanelPortA.add(oPanelPortATris, oConstraints);
|
||||
|
||||
oConstraints.gridx = 0;
|
||||
oConstraints.gridy = 0;
|
||||
oPanelPortB.add(oPortB, oConstraints);
|
||||
oConstraints.gridy = 1;
|
||||
oPanelPortB.add(oPinB, oConstraints);
|
||||
oConstraints.gridx = 1;
|
||||
oPanelPortB.add(oPanelPortBPins, oConstraints);
|
||||
oConstraints.gridx = 0;
|
||||
oConstraints.gridy = 2;
|
||||
oPanelPortB.add(oTrisB);
|
||||
oConstraints.gridx = 1;
|
||||
oPanelPortB.add(oPanelPortBTris, oConstraints);
|
||||
|
||||
this.setLayout(new GridBagLayout());
|
||||
|
||||
oConstraints.gridx = 0;
|
||||
oConstraints.gridy = 0;
|
||||
this.add(oPanelPortA, oConstraints);
|
||||
oConstraints.gridy = 1;
|
||||
this.add(oPanelPortB, oConstraints);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package View.PIC_SIMULATOR_GUI_JAVA;
|
||||
package View;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package View.PIC_SIMULATOR_GUI_JAVA;
|
||||
package View;
|
||||
|
||||
import javax.sound.sampled.AudioSystem;
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
@@ -1,4 +1,4 @@
|
||||
package View.PIC_SIMULATOR_GUI_JAVA;
|
||||
package View;
|
||||
|
||||
import java.awt.Dimension;
|
||||
import java.awt.GridBagConstraints;
|
||||
5
src/View/IMyView.java
Normal file
5
src/View/IMyView.java
Normal file
@@ -0,0 +1,5 @@
|
||||
package View;
|
||||
|
||||
public interface IMyView {
|
||||
|
||||
}
|
||||
19
src/View/MyView.java
Normal file
19
src/View/MyView.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package View;
|
||||
|
||||
import javax.swing.JPanel;
|
||||
|
||||
public class MyView {
|
||||
|
||||
GUIMainFrame oGUIMainFrame;
|
||||
GUIMenuBar oGUIMenuBar;
|
||||
GUIPorts oGUIPorts;
|
||||
GUIRegister oGUIRegister;
|
||||
GUIRegistersDetailed oGUIRegistersDetailed;
|
||||
GUITestFileTable oGUITestFileTable;
|
||||
|
||||
JPanel oGUIMainPanel;
|
||||
|
||||
public MyView() {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user