Created folders model, view, controler, moved files to folders

This commit is contained in:
Meruemon
2022-03-21 14:42:36 +01:00
parent ab81461034
commit fcb3176207
55 changed files with 139 additions and 46 deletions

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.

View File

@@ -1,7 +0,0 @@
package Backend.Runtime;
import Backend.Microcontroller.PIC;
public class ProgramStepInformation {
private PIC oPIC;
}

View File

@@ -1,5 +0,0 @@
package Backend.Runtime;
public enum WATCHDOG {
}

View File

@@ -1,6 +1,6 @@
package Backend.BackendCommandProcessing;
package Model.Backend.BackendCommandProcessing;
import Backend.Microcontroller.PIC;
import Model.Backend.Microcontroller.PIC;
public class InformationConnecter {

View File

@@ -1,4 +1,4 @@
package Backend.EepromLoader;
package Model.Backend.EepromLoader;
import java.io.BufferedReader;
import java.io.File;
@@ -6,7 +6,7 @@ import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import Backend.Microcontroller.PIC;
import Model.Backend.Microcontroller.PIC;
public class ReadEepromFile {

View File

@@ -1,4 +1,4 @@
package Backend.InterruptHandling;
package Model.Backend.InterruptHandling;
public class InterruptServiceHandler extends Thread {

View File

@@ -1,4 +1,4 @@
package Backend.InterruptHandling;
package Model.Backend.InterruptHandling;
/**
* Class contains methods which calls a method to an overhanded value.

View File

@@ -1,4 +1,4 @@
package Backend.Microcontroller;
package Model.Backend.Microcontroller;
public class Bitmask {
/**

View File

@@ -1,4 +1,4 @@
package Backend.Microcontroller;
package Model.Backend.Microcontroller;
/**
* @author Aaron Moser
* @date 23.06.2021

View File

@@ -1,4 +1,4 @@
package Backend.Microcontroller;
package Model.Backend.Microcontroller;
/**
* @author Aaron Moser

View File

@@ -1,4 +1,4 @@
package Backend.Microcontroller;
package Model.Backend.Microcontroller;
/**
* @author Aaron Moser

View File

@@ -1,4 +1,4 @@
package Backend.Microcontroller;
package Model.Backend.Microcontroller;
import java.util.EmptyStackException;

View File

@@ -1,4 +1,4 @@
package Backend.Microcontroller;
package Model.Backend.Microcontroller;
/**
* @author Aaron Moser

View File

@@ -4,13 +4,13 @@
* @lastchange 21.02.2022
*/
package Backend.Runtime;
package Model.Backend.Runtime;
import java.util.ArrayList;
import Backend.Microcontroller.PIC;
import Backend.Microcontroller.WATCHDOG;
import Frontend.PIC_SIMULATOR_GUI_JAVA.GUIMainFrame;
import Model.Backend.Microcontroller.PIC;
import Model.Backend.Microcontroller.WATCHDOG;
import View.PIC_SIMULATOR_GUI_JAVA.GUIMainFrame;
public class Environment {

View File

@@ -1,4 +1,4 @@
package Backend.Runtime;
package Model.Backend.Runtime;
public class Main {
public static void main(String[] args) {

View File

@@ -0,0 +1,7 @@
package Model.Backend.Runtime;
import Model.Backend.Microcontroller.PIC;
public class ProgramStepInformation {
private PIC oPIC;
}

View File

@@ -1,4 +1,4 @@
package Backend.Runtime;
package Model.Backend.Runtime;
public class TODO {

View File

@@ -1,4 +1,4 @@
package Backend.Runtime;
package Model.Backend.Runtime;
import java.util.ArrayList;

View File

@@ -0,0 +1,5 @@
package Model.Backend.Runtime;
public enum WATCHDOG {
}

View File

@@ -1,4 +1,4 @@
package Backend.Statistics.ErrorHandling;
package Model.Backend.Statistics.ErrorHandling;
public class BackendErrorCounter {
private int iErrorCounter = 0;

View File

@@ -1,4 +1,4 @@
package Frontend.PIC_SIMULATOR_GUI_JAVA;
package View.PIC_SIMULATOR_GUI_JAVA;
import java.awt.Color;
import java.awt.Dimension;
@@ -14,8 +14,8 @@ import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.Border;
import Backend.EepromLoader.ReadEepromFile;
import Backend.Runtime.Environment;
import Model.Backend.EepromLoader.ReadEepromFile;
import Model.Backend.Runtime.Environment;
public class GUIMainFrame extends JFrame {
@@ -72,16 +72,16 @@ public class GUIMainFrame extends JFrame {
env.getPIC().get_WRegister()};
GUIRegisters oGUIRegisters = new GUIRegisters();
oGUIRegisters.setRegisters(aiRegisters);
GUIRegistersDetailed oGuiRegistersDetailed = new GUIRegistersDetailed();
GUIRegistersDetailed oGUIRegistersDetailed = new GUIRegistersDetailed();
oConstraintsRegisterInformation.anchor = GridBagConstraints.WEST;
oConstraintsRegisterInformation.gridx = 0;
oConstraintsRegisterInformation.gridy = 0;
oPanelRegisterInformation.add(oGUIRegisters, oConstraintsRegisterInformation);
oConstraintsRegisterInformation.gridy = 1;
oConstraintsRegisterInformation.anchor = GridBagConstraints.WEST;
oPanelRegisterInformation.add(oGuiRegistersDetailed, oConstraintsRegisterInformation);
oPanelRegisterInformation.add(oGUIRegistersDetailed, oConstraintsRegisterInformation);
this.setJMenuBar(new GUIMenuBar(env, this, oGUITestFileTable, oGUIRegisters));
this.setJMenuBar(new GUIMenuBar(env, this, oGUITestFileTable, oGUIRegisters, oGUIRegistersDetailed));
this.setVisible(true); //make frame visible
ImageIcon guiLogo = new ImageIcon("./pictures/gui_logo.png"); // create an ImageIcon

View File

@@ -1,4 +1,4 @@
package Frontend.PIC_SIMULATOR_GUI_JAVA;
package View.PIC_SIMULATOR_GUI_JAVA;
import java.awt.Color;
import java.awt.Dimension;
@@ -16,15 +16,16 @@ import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import Backend.EepromLoader.ReadEepromFile;
import Backend.Runtime.Environment;
import Model.Backend.EepromLoader.ReadEepromFile;
import Model.Backend.Runtime.Environment;
public class GUIMenuBar extends JMenuBar implements ActionListener {
Environment oEnv;
GUIMainFrame oGUIMainFrame;
GUITestFileTable oGUITestFileTable;
GUIRegisters oGUIRegisters;
GUIRegistersDetailed oGUIRegistersDetailed;
ArrayList<JCheckBox> oCheckBoxes;
ReadEepromFile oRef;
boolean[] bBreakpointSet;
@@ -96,7 +97,7 @@ public class GUIMenuBar extends JMenuBar implements ActionListener {
* Constructor initializes menubar.
* @param frame
*/
public GUIMenuBar(Environment env, GUIMainFrame mainframe, GUITestFileTable guitft, GUIRegisters guiregs) { //TODO maybe single components, with methods, of frame to set theme
public GUIMenuBar(Environment env, GUIMainFrame mainframe, GUITestFileTable guitft, GUIRegisters guiregs, GUIRegistersDetailed guiregsdet) { //TODO maybe single components, with methods, of frame to set theme
//Custom Separators since default is not able to change background.
oSeparator0 = new JMenuItem();
@@ -117,6 +118,7 @@ public class GUIMenuBar extends JMenuBar implements ActionListener {
oGUIMainFrame = mainframe;
oGUITestFileTable = guitft;
oGUIRegisters = guiregs;
oGUIRegistersDetailed = guiregsdet;
//File
oFileMenu = new JMenu(sGermanLang[0]);
@@ -370,6 +372,7 @@ public class GUIMenuBar extends JMenuBar implements ActionListener {
oGUITestFileTable.setTheme(1);
oGUIRegisters.setTheme(1);
oGUIMainFrame.setTheme(1);
oGUIRegistersDetailed.setTheme(1);
}
//Change to light theme
if (e.getSource() == oLightTheme) {
@@ -378,6 +381,7 @@ public class GUIMenuBar extends JMenuBar implements ActionListener {
oGUITestFileTable.setTheme(0);
oGUIRegisters.setTheme(0);
oGUIMainFrame.setTheme(0);
oGUIRegistersDetailed.setTheme(0);
}
//Microcontroller

View File

@@ -1,4 +1,4 @@
package Frontend.PIC_SIMULATOR_GUI_JAVA;
package View.PIC_SIMULATOR_GUI_JAVA;
import java.awt.GridBagLayout;
import java.util.ArrayList;
@@ -183,6 +183,10 @@ public class GUIRegisters extends JPanel {
this.add(oRightComponentPanel, oConstraints);
}
private void changeWidth() {
}
/**
* Adds panels to panel list and textfields to textfield list
*/

View File

@@ -1,5 +1,6 @@
package Frontend.PIC_SIMULATOR_GUI_JAVA;
package View.PIC_SIMULATOR_GUI_JAVA;
import javax.sound.sampled.AudioSystem;
import javax.swing.BorderFactory;
import javax.swing.JLabel;
import javax.swing.JPanel;
@@ -7,10 +8,29 @@ import javax.swing.JTable;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.util.ArrayList;
import java.awt.Color;
public class GUIRegistersDetailed extends JPanel {
/**
* Color oWhite = new Color(255, 253, 250);
* Color oDarkGray = new Color(76, 78, 82);
* Color oDarkGrayB = new Color(47, 47, 47);
* Color oLightBlue = new Color(173, 216, 230);
* Color oOrangeDM = new Color(255, 170, 0);
* Color oLightBlueDM = new Color(0, 213, 255);
* Color oOrangeDMB = new Color(255, 85, 0);
* First Color == TextColor
* Second Color == BackgroundColor
* Third Color == BorderColor
* Fourth Color == TextColor Marked
* Fifth Color == BackgroundColor Marked
* Sixth Color == BorderColor Marked
*/
Color[] aoDarkTheme = {new Color(255, 253, 250), new Color(76, 78, 82), new Color(47, 47, 47), new Color(0, 213, 255), new Color(255, 170, 0), new Color(255, 85, 0)};
Color[] aoLightTheme = {new Color(76, 78, 82), new Color(255, 253, 250), new Color(173, 216, 230), new Color(0, 213, 255), new Color(255, 170, 0), new Color(255, 85, 0)};
JTable oStatusTable;
JTable oOptionTable = new JTable();
JTable oIntconTable = new JTable();
@@ -23,8 +43,14 @@ public class GUIRegistersDetailed extends JPanel {
JLabel oOptionLabel = new JLabel("OPTION");
JLabel oIntconLabel = new JLabel("INTCON");
ArrayList<JLabel> oLabels = new ArrayList<JLabel>();
ArrayList<JPanel> oPanels = new ArrayList<JPanel>();
ArrayList<JTable> oTables = new ArrayList<JTable>();
public GUIRegistersDetailed() {
buildGUIRegistersDetailed();
addComponentsList();
setTheme(0);
}
private void buildGUIRegistersDetailed() {
@@ -100,4 +126,63 @@ public class GUIRegistersDetailed extends JPanel {
this.setBorder(BorderFactory.createLineBorder(Color.BLACK));
}
public void addComponentsList() {
oLabels.add(oIntconLabel);
oLabels.add(oOptionLabel);
oLabels.add(oStatusLabel);
oPanels.add(oIntconPanel);
oPanels.add(oOptionPanel);
oPanels.add(oStatusPanel);
oTables.add(oIntconTable);
oTables.add(oOptionTable);
oTables.add(oStatusTable);
}
public void setTheme(int iThemeNr) {
switch (iThemeNr) {
case 0: {
for (JLabel oLabel : oLabels) {
oLabel.setForeground(aoLightTheme[0]);
oLabel.setBackground(aoLightTheme[1]);
}
for (JPanel oPanel : oPanels) {
oPanel.setForeground(aoLightTheme[0]);
oPanel.setBackground(aoLightTheme[1]);
oPanel.setBorder(BorderFactory.createLineBorder(aoLightTheme[2]));
}
for (JTable oTable : oTables) {
oTable.setForeground(aoLightTheme[0]);
oTable.setBackground(aoLightTheme[1]);
oTable.setBorder(BorderFactory.createLineBorder(aoLightTheme[2]));
oTable.setGridColor(aoLightTheme[2]);
}
this.setForeground(aoLightTheme[0]);
this.setBackground(aoLightTheme[1]);
this.setBorder(BorderFactory.createLineBorder(aoLightTheme[2]));
}break;
case 1: {
for (JLabel oLabel : oLabels) {
oLabel.setForeground(aoDarkTheme[0]);
oLabel.setBackground(aoDarkTheme[1]);
}
for (JPanel oPanel : oPanels) {
oPanel.setForeground(aoDarkTheme[0]);
oPanel.setBackground(aoDarkTheme[1]);
oPanel.setBorder(BorderFactory.createLineBorder(aoDarkTheme[2]));
}
for (JTable oTable : oTables) {
oTable.setForeground(aoDarkTheme[0]);
oTable.setBackground(aoDarkTheme[1]);
oTable.setBorder(BorderFactory.createLineBorder(aoDarkTheme[2]));
oTable.setGridColor(aoDarkTheme[2]);
}
this.setForeground(aoDarkTheme[0]);
this.setBackground(aoDarkTheme[1]);
this.setBorder(BorderFactory.createLineBorder(aoDarkTheme[2]));
}break;
}
}
}

View File

@@ -1,4 +1,4 @@
package Frontend.PIC_SIMULATOR_GUI_JAVA;
package View.PIC_SIMULATOR_GUI_JAVA;
import java.awt.Dimension;
import java.awt.GridBagConstraints;