Added methods to check/uncheck TRISA and B, added author comment at beginning

This commit is contained in:
WickedJack99
2022-05-08 11:48:07 +02:00
parent 415fbdb720
commit 99c7f4d4c6
64 changed files with 138 additions and 13 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.

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.

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,3 +1,6 @@
/**
* @author Aaron Moser
*/
package Control;
import Model.MyModelData;

View File

@@ -1,6 +1,8 @@
/**
* @author Aaron Moser
*/
package Control;
import java.util.ArrayList;
import java.util.concurrent.ConcurrentLinkedQueue;
import javax.swing.JFrame;
@@ -149,6 +151,15 @@ public class MyControlView {
abSelected[3] = oPIC.getRam().get_RA3();
abSelected[4] = oPIC.getRam().get_RA4_T0CKI();
boolean[] abTrisSelected = new boolean[5];
abTrisSelected[0] = oPIC.getRam().get_TRISA0();
abTrisSelected[1] = oPIC.getRam().get_TRISA1();
abTrisSelected[2] = oPIC.getRam().get_TRISA2();
abTrisSelected[3] = oPIC.getRam().get_TRISA3();
abTrisSelected[4] = oPIC.getRam().get_TRISA4();
oMyView.getGUIPorts().checkTrisA(abTrisSelected);
oMyView.getGUIPorts().checkPortsA(abSelected);
oMyView.getGUIPorts().enableCheckboxesA(abEnabled);
}
@@ -189,6 +200,18 @@ public class MyControlView {
abSelected[6] = oPIC.getRam().get_RB6();
abSelected[7] = oPIC.getRam().get_RB7();
boolean[] abTrisSelected = new boolean[8];
abTrisSelected[0] = oPIC.getRam().get_TRISB0();
abTrisSelected[1] = oPIC.getRam().get_TRISB1();
abTrisSelected[2] = oPIC.getRam().get_TRISB2();
abTrisSelected[3] = oPIC.getRam().get_TRISB3();
abTrisSelected[4] = oPIC.getRam().get_TRISB4();
abTrisSelected[5] = oPIC.getRam().get_TRISB5();
abTrisSelected[6] = oPIC.getRam().get_TRISB6();
abTrisSelected[7] = oPIC.getRam().get_TRISB7();
oMyView.getGUIPorts().checkTrisB(abTrisSelected);
oMyView.getGUIPorts().checkPortsB(abSelected);
oMyView.getGUIPorts().enableCheckboxesB(abEnabled);
}

View File

@@ -1,3 +1,6 @@
/**
* @author Aaron Moser
*/
package Model.Microcontroller;
public class Alu {

View File

@@ -1,3 +1,6 @@
/**
* @author Aaron Moser
*/
package Model.Microcontroller;
import java.io.BufferedReader;

View File

@@ -1,3 +1,6 @@
/**
* @author Aaron Moser
*/
package Model.Microcontroller;
public class EepromThread extends Thread {

View File

@@ -1,3 +1,6 @@
/**
* @author Aaron Moser
*/
package Model.Microcontroller;
public class InstructionDecoder {

View File

@@ -1,9 +1,8 @@
package Model.Microcontroller;
/**
* @author Aaron Moser
* @date 23.06.2021
*/
package Model.Microcontroller;
/**
* Microcontrollerclass that contains all other partclasses
@@ -31,6 +30,11 @@ public class Pic {
WRegister = 0;
ArithmeticLogicUnit = new Alu();
oEeprom = new Eeprom();
Ram.set_OPTION(0b11111111);
Ram.set_TRISA(0b11111);
Ram.set_TRISB(0b11111111);
Ram.set_STATUS(0b00011000);
}
public synchronized void resetPIC() {
@@ -38,6 +42,11 @@ public class Pic {
Stack = new Stack();
Runtimer = new Time(Ram);
WRegister = 0;
Ram.set_OPTION(0b11111111);
Ram.set_TRISA(0b11111);
Ram.set_TRISB(0b11111111);
Ram.set_STATUS(0b00011000);
}
//Bitmasks to set or get bits (use OR for set and AND for get).

View File

@@ -1,8 +1,8 @@
package Model.Microcontroller;
/**
* @author Aaron Moser
* @date 23.06.2021
*/
package Model.Microcontroller;
/**
* ProgramMemory of the PIC (Programmspeicher)

View File

@@ -1,9 +1,8 @@
package Model.Microcontroller;
/**
* @author Aaron Moser
* @date 23.06.2021
*/
package Model.Microcontroller;
/**
* Random Access Memory of the PIC (Datenspeicher)

View File

@@ -1,11 +1,10 @@
package Model.Microcontroller;
import java.util.EmptyStackException;
/**
* @author Aaron Moser
* @date 31.03.2021
*/
package Model.Microcontroller;
import java.util.EmptyStackException;
/**
* Datasheet Page 18

View File

@@ -1,3 +1,6 @@
/**
* @author Aaron Moser
*/
package Model.Microcontroller;
public class Time {

View File

@@ -1,3 +1,6 @@
/**
* @author Aaron Moser
*/
package Model;
import java.util.concurrent.ConcurrentLinkedQueue;

View File

@@ -1,3 +1,6 @@
/**
* @author Aaron Moser
*/
package Model;
import Model.Microcontroller.Pic;

View File

@@ -1,3 +1,6 @@
/**
* @author Aaron Moser
*/
package Model.ProgramLoader;
import java.io.BufferedReader;

View File

@@ -1,3 +1,6 @@
/**
* @author Aaron Moser
*/
package Model;
import Model.Microcontroller.Pic;

View File

@@ -1,4 +1,5 @@
/**@author Aaron Moser
/**
* @author Aaron Moser
*/
package Runtime;

View File

@@ -1,3 +1,6 @@
/**
* @author Aaron Moser
*/
package View;
import java.awt.Dimension;

View File

@@ -1,3 +1,6 @@
/**
* @author Aaron Moser
*/
package View;
import java.awt.Dimension;

View File

@@ -1,3 +1,6 @@
/**
* @author Aaron Moser
*/
package View;
import java.util.ArrayList;

View File

@@ -1,3 +1,6 @@
/**
* @author Aaron Moser
*/
package View;
import java.awt.Color;

View File

@@ -1,3 +1,6 @@
/**
* @author Aaron Moser
*/
package View;
import java.awt.Color;

View File

@@ -1,3 +1,6 @@
/**
* @author Aaron Moser
*/
package View;
import java.util.ArrayList;
@@ -233,6 +236,22 @@ public class GUIPorts extends JPanel {
}
}
public void checkTrisA(boolean[] bChecked) {
int j = 0;
for (int i = 5; i < 10; i++) {
oCheckboxes.get(i).setSelected(bChecked[j]);
j++;
}
}
public void checkTrisB(boolean[] bChecked) {
int j = 0;
for (int i = 18; i < 26; i++) {
oCheckboxes.get(i).setSelected(bChecked[j]);
j++;
}
}
public void enableCheckboxesA(boolean[] abEnabled) {
for (int i = 0; i < 10; i++) {
oCheckboxes.get(i).setEnabled(abEnabled[i]);

View File

@@ -1,3 +1,6 @@
/**
* @author Aaron Moser
*/
package View;
public class GUIProgramMemory {

View File

@@ -1,3 +1,6 @@
/**
* @author Aaron Moser
*/
package View;
import java.awt.Color;

View File

@@ -1,3 +1,6 @@
/**
* @author Aaron Moser
*/
package View;
import java.util.ArrayList;

View File

@@ -1,3 +1,6 @@
/**
* @author Aaron Moser
*/
package View;
import javax.swing.BorderFactory;

View File

@@ -1,3 +1,6 @@
/**
* @author Aaron Moser
*/
package View;
import java.awt.GridBagLayout;

View File

@@ -1,3 +1,6 @@
/**
* @author Aaron Moser
*/
package View;
import java.awt.Dimension;
@@ -195,7 +198,7 @@ public class GUITestFileTable extends JScrollPane {
* @param iLineToMark
*/
public void markLine(int iLineToMark) {
if (oLineInformation.size() > iLineToMark) {
if (oLineInformation.size() > (iLineToMark * 2 + 1)) {
if (iLineToMark > -1) {
oLineInformation.get(iLineToMark * 2).setForeground(getThemeColor()[3]);
oLineInformation.get(iLineToMark * 2).setBorder(BorderFactory.createLineBorder(getThemeColor()[3]));
@@ -210,7 +213,7 @@ public class GUITestFileTable extends JScrollPane {
* @param iLineToUnmark
*/
public void unmarkLine(int iLineToUnmark) {
if (oLineInformation.size() > iLineToUnmark) {
if (oLineInformation.size() > (iLineToUnmark * 2 + 1)) {
if (iLineToUnmark > -1) {
oLineInformation.get(iLineToUnmark * 2).setForeground(getThemeColor()[0]);
oLineInformation.get(iLineToUnmark * 2).setBorder(BorderFactory.createLineBorder(getThemeColor()[2]));

View File

@@ -1,3 +1,6 @@
/**
* @author Aaron Moser
*/
package View;
import java.awt.Color;

View File

@@ -1,3 +1,6 @@
/**
* @author Aaron Moser
*/
package View;
public interface IMyView {

View File

@@ -1,3 +1,6 @@
/**
* @author Aaron Moser
*/
package View;
import java.awt.Color;

View File

@@ -1,3 +1,6 @@
/**
* @author Aaron Moser
*/
package View;
import java.util.ArrayList;