From 01d956b75ac69264c79117daf732c49f2d084080 Mon Sep 17 00:00:00 2001 From: Meruemon Date: Mon, 14 Mar 2022 17:14:27 +0100 Subject: [PATCH] Finally it looks right --- .vscode/settings.json | 3 +- .../InterruptServiceHandler.class | Bin 0 -> 409 bytes .../InterruptServiceHandlingTable.class | Bin 0 -> 744 bytes bin/Backend/Microcontroller/PIC.class | Bin 11476 -> 11476 bytes bin/Backend/Microcontroller/RAM.class | Bin 18881 -> 18881 bytes .../PIC_SIMULATOR_GUI_JAVA/GUIMainFrame.class | Bin 2313 -> 2106 bytes .../GUITestFileTable.class | Bin 2730 -> 3318 bytes .../InterruptServiceHandler.java | 12 + .../InterruptServiceHandlingTable.java | 19 + src/Backend/Microcontroller/PIC.java | 18 +- src/Backend/Microcontroller/RAM.java | 436 +++++++----------- .../PIC_SIMULATOR_GUI_JAVA/GUIMainFrame.java | 23 +- .../GUITestFileTable.java | 100 ++-- 13 files changed, 279 insertions(+), 332 deletions(-) create mode 100644 bin/Backend/InterruptHandling/InterruptServiceHandler.class create mode 100644 bin/Backend/InterruptHandling/InterruptServiceHandlingTable.class create mode 100644 src/Backend/InterruptHandling/InterruptServiceHandler.java create mode 100644 src/Backend/InterruptHandling/InterruptServiceHandlingTable.java diff --git a/.vscode/settings.json b/.vscode/settings.json index e112a70..a386092 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,5 +3,6 @@ "java.project.outputPath": "bin", "java.project.referencedLibraries": [ "lib/**/*.jar" - ] + ], + "java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx4G -Xms100m" } diff --git a/bin/Backend/InterruptHandling/InterruptServiceHandler.class b/bin/Backend/InterruptHandling/InterruptServiceHandler.class new file mode 100644 index 0000000000000000000000000000000000000000..0f8db3428fc742366fb3abec7131e6604b68168e GIT binary patch literal 409 zcmb79yH3ME5S(?Km>7qI)HHNFBrKGYM*$K7$)ZV={$j7lfjOhY&VNxMQSbrzsDwQe zg+Rv@vpcgpx4ZMj$LDg13+x8)2&Y#nePWZvccx@(tC#XtnJm}l;YS&=o#~Y80^0yS zq4%g}D$bR(ji#1WMrfUDqsvP|i@UM%ELp0Ei&_s*SO|;?r>UqL;q$W8N`bm+h ze5|Z?d?otjRKF4i$-fsnlhL*^gm73?Hsu@bhU~2m`+dfVy8!zT6WsG8lRX6kVX;J# t*gSg2)>~Z;1zlN0Yzs!KJVHkpVP|bVuDNJ`jqMF1$p_!YuC#mTeF0d#TH*iz literal 0 HcmV?d00001 diff --git a/bin/Backend/InterruptHandling/InterruptServiceHandlingTable.class b/bin/Backend/InterruptHandling/InterruptServiceHandlingTable.class new file mode 100644 index 0000000000000000000000000000000000000000..004adbaba80ff880a7598a51528264ba507331ac GIT binary patch literal 744 zcmbV}OK;Oa6ot>^<^sOIH zqA-5{w=z`8c^Ifa7p^~!l!2OndFr40JCV=k!T3}Kslc*5bUgRS+4Tmao^#kAoCpY8 zVBugIpQV1Bj{In*ssMz5VIRAm)7{m`S*lL=iI&w|KGl*YtUlASp36Ng8}#Y*-Z_IK z@6Eou@0~cd+tU|@K;vZ?hv{oJZ*@ijwS(zIwNS-%i7U9;guqRSIvQH7N;C^~M`FHE zYZ42E+K^Z()P0HNLOqbUr0tjbVXTg4pT;W5;}B@~r-2`h{3O)z{4Ung58;`>^ZtLP z{6e5LoX(O!9fpw-STA4cUvILlp95=LEYAXMy(h_FG8N2`xoycUGIuUnlDT=wi)8L! zvPotNCAZ1UqU6g|LTAkL8XZ%53jQtYD^{#ph8tEr!!4_k;kIRDxNFU2Shq~_JL$NMwCFXD6-cad$_-XJyzj6}7A~;xkRR8OML;Huxr=Lh<7+@Sz|#MY$;84VX9(5iJF!iqoK@Rq;06bkwP>7c6V5 z9*vi!)9G|>n5uKwwbP{C=0-=PI=eNsv9(QG?Kaz)&7`JFw(GTdGgDrkkKrrfVHyfq=+XeW+x@=VjTM! z&krf(IA!!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-jcWN5#<1OuWw#s8J{RGDE9Yrf%?Ve-X;;SuSMUEB{!c+8 zac;g$T1b{_BJ7$ea`!UMwGwg5nC?1c(hBZ#ojz3fTwntM*GHOr^!Dq%Uf7YpL!3S# zr@IKc?~~|ulkE19?e>%J`YCo#QR|+TU;CxVPel1snRJ45_W~jJA_eZ0Ogl}PdyNYB c3u@disdI0z!2Oz5cY)PzKz^ysey}L&zabEg761SM diff --git a/bin/Backend/Microcontroller/RAM.class b/bin/Backend/Microcontroller/RAM.class index feca46ab52fcd1d53f570332aeec3f14b66102d9..473dd15c1f2aaf3f052f15ccf170f4592306f588 100644 GIT binary patch delta 2223 zcmYk6dr*{B7{<>Bokaw6cX4<5mIZdfSXe>1gNVQa3#f^JCdwoTS~*RcG-}Q?j*}O( zF(o>prIS%pHs)kr8!gLQW=@%!W;xX$RyI~%=rZO7?Rj558UK0b?DL-A^FHT%XZDcN z4k>N>oiNR#dc(R(`5GFFxN*Xkh;_N@cG^^!Jr|ow?N?CK9Yv@u zjw;lHw0r&m1^-|V1=```EJ|4<4jIt@8(+j26 zIUcpsNeR20Rp_>2zfA?Aldx_;5Qkb3osIPh*3Yuu#Jb%@`bySkxM=^2s@-c-i(^96 zd#*Y7y;?P8+EiLhF4k*|-h8avSPzdS{pEh9Id%?GoQ|cFx#L!&Zi}l%y%)C{`#RM2 zIEUKoCT5+|+%c-xO*7WBzT89ltE~U%A^kPhXU3Dh0lHJ|jca$EM85BeCAidQ&p#dsx55`iFcM#Xh>DkJ#sgk9wFefHjKXHe%`ZX7(JBkVKn_yR+gs_b%3W-r%81_r3Jqa@}%ZeN`RM*WYpW6O1;C} z^AD%qk^bKL;ne$#d+rg`JKEn{FoJrYbMGGajv2iLNOLT$7Tx2VJ0c@Q<)za%Ie~O` zbs#+l>#vO-o%JN^8#73s-OpUlp!d+2Sq1epdmqiD8~cW5PRyb_XIOtbi}bUsXJnK9 zE$d6ONk7NBC5QCySZ~fD{d?B0vwog+e=cR;n@ib$;2d}JLR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Pda{N)DzP2EBf#oeg7oMe`8REF{E^66G~?SY6_H+B;{z~AH%HVFHF<#0UoYO>phVc;*UihGFH`~L#BppIJr diff --git a/src/Backend/InterruptHandling/InterruptServiceHandler.java b/src/Backend/InterruptHandling/InterruptServiceHandler.java new file mode 100644 index 0000000..852cab4 --- /dev/null +++ b/src/Backend/InterruptHandling/InterruptServiceHandler.java @@ -0,0 +1,12 @@ +package Backend.InterruptHandling; + +public class InterruptServiceHandler extends Thread { + + public InterruptServiceHandler() {} + + public void run() { + + } + + +} diff --git a/src/Backend/InterruptHandling/InterruptServiceHandlingTable.java b/src/Backend/InterruptHandling/InterruptServiceHandlingTable.java new file mode 100644 index 0000000..a9b6ef7 --- /dev/null +++ b/src/Backend/InterruptHandling/InterruptServiceHandlingTable.java @@ -0,0 +1,19 @@ +package Backend.InterruptHandling; + +/** + * Class contains methods which calls a method to an overhanded value. + */ +public class InterruptServiceHandlingTable { + + private final int ISR_TMR0_OVERFLOW = 1; //tmr0 overflow interrupt + private final int INT_RB0 = 2; //External interrupt over int/rb0-pin + private final int RB4 = 3; //PortB change interrupts + private final int RB5 = 4; //PortB change interrupts + private final int RB6 = 5; //PortB change interrupts + private final int RB7 = 6; //PortB change interrupts + private final int EEPROM_DATA_WRITE = 7; + + public InterruptServiceHandlingTable() {} + + +} diff --git a/src/Backend/Microcontroller/PIC.java b/src/Backend/Microcontroller/PIC.java index 3bbae2f..dece17e 100755 --- a/src/Backend/Microcontroller/PIC.java +++ b/src/Backend/Microcontroller/PIC.java @@ -8,8 +8,7 @@ package Backend.Microcontroller; /** * Microcontrollerclass that contains all other partclasses */ -public class PIC -{ +public class PIC { /** * Parts of PIC. * Objects are written with a large starting letter. @@ -19,8 +18,7 @@ public class PIC private STACK Stack; private int WRegister; - public PIC() - { + public PIC() { //Initialising objects of PIC. Eeprom = new EEPROM(); Ram = new RAM(); @@ -28,7 +26,7 @@ public class PIC WRegister = 0; } - public void resetPIC() + public synchronized void resetPIC() { Ram = new RAM(); Stack = new STACK(); @@ -61,25 +59,25 @@ public class PIC int bitMaskClearBitArray[] = { bitMaskClearBit0, bitMaskClearBit1, bitMaskClearBit2, bitMaskClearBit3, bitMaskClearBit4, bitMaskClearBit5, bitMaskClearBit6, bitMaskClearBit7}; - public void setWRegister(int value) + public synchronized void setWRegister(int value) { WRegister = value; } - public int get_WRegister() + public synchronized int get_WRegister() { return WRegister; } - public RAM getRam() { + public synchronized RAM getRam() { return Ram; } - public EEPROM getEeprom() { + public synchronized EEPROM getEeprom() { return Eeprom; } - public STACK getStack() { + public synchronized STACK getStack() { return Stack; } diff --git a/src/Backend/Microcontroller/RAM.java b/src/Backend/Microcontroller/RAM.java index 45031d3..923aff9 100755 --- a/src/Backend/Microcontroller/RAM.java +++ b/src/Backend/Microcontroller/RAM.java @@ -44,7 +44,7 @@ public class RAM { * @return the value of the element at the adress of the bank. * @throws Exception */ - public int get_Value_Of_Bank_RP0_Bit_Of_Element_At_Adress(boolean rP0Bit, int adress) { + public synchronized int get_Value_Of_Bank_RP0_Bit_Of_Element_At_Adress(boolean rP0Bit, int adress) { int valueOfBankRP0BitOfElementAtAdress = 0; if (rP0Bit == false) { @@ -72,7 +72,7 @@ public class RAM { * @param x shows if bank 0 or 1 will be set. * @param array an array which will represent bank x. */ - public void set_Bank_X(boolean rp0Bit, int[] array) { + public synchronized void set_Bank_X(boolean rp0Bit, int[] array) { if (rp0Bit == false) { bank0 = array; } @@ -87,7 +87,7 @@ public class RAM { * @param bank where the value will be changed. * @param value that will be written into the element. */ - public void set_Element_X_Of_Bank_Y_To_Z(int element, boolean rp0Bit, int value) { + public synchronized void set_Element_X_Of_Bank_Y_To_Z(int element, boolean rp0Bit, int value) { if (element < 0 || element > 127) { System.out.println("Wrong input, value from 0 to 127 expected!"); } else { @@ -230,13 +230,13 @@ public class RAM { } //Bank0 Registers - public void set_TMR0(int value) + public synchronized void set_TMR0(int value) { value &= 255; bank0[1] = value; } - public void increment_TMR0() + public synchronized void increment_TMR0() { Timer0Prescaled++; @@ -257,45 +257,45 @@ public class RAM { } } - public int get_TMR0() + public synchronized int get_TMR0() { return bank0[1]; } - public void set_PCL(int value) + public synchronized void set_PCL(int value) { bank0[2] = value; bank1[2] = value; } - public int get_PCL() + public synchronized int get_PCL() { return bank0[2]; } - public void set_STATUS(int value) + public synchronized void set_STATUS(int value) { bank0[3] = value; bank1[3] = value; } - public int get_STATUS() + public synchronized int get_STATUS() { return bank0[3]; } - public void set_FSR(int value) + public synchronized void set_FSR(int value) { bank0[4] = value; bank1[4] = value; } - public int get_FSR() + public synchronized int get_FSR() { return bank0[4]; } - public void set_PORTA(int value) + public synchronized void set_PORTA(int value) { if (((value & 0b00010000) == 0b00010000) && get_T0CS()) { @@ -320,7 +320,7 @@ public class RAM { bank0[5] = value; } - public void set_PORTA_Bit_X_To_Y(int x, int y) + public synchronized void set_PORTA_Bit_X_To_Y(int x, int y) { if ((x == 4)) { @@ -370,17 +370,17 @@ public class RAM { } } - public int get_PORTA() + public synchronized int get_PORTA() { return bank0[5]; } - public void set_PORTB(int value) + public synchronized void set_PORTB(int value) { bank0[6] = value; } - public void set_PORTB_Bit_X_To_Y(int x, int y) + public synchronized void set_PORTB_Bit_X_To_Y(int x, int y) { if (y == 0) { @@ -404,106 +404,106 @@ public class RAM { } } - public int get_PORTB() + public synchronized int get_PORTB() { return bank0[6]; } - public void set_EEDATA(int value) + public synchronized void set_EEDATA(int value) { bank0[8] = value; } - public int get_EEDATA() + public synchronized int get_EEDATA() { return bank0[8]; } - public void set_EEADR(int value) + public synchronized void set_EEADR(int value) { bank0[9] = value; } - public int get_EEADR() + public synchronized int get_EEADR() { return bank0[9]; } - public void set_PCLATH(int value) + public synchronized void set_PCLATH(int value) { bank0[10] = value; bank1[10] = value; } - public int get_PCLATH() + public synchronized int get_PCLATH() { return bank0[10]; } - public void set_INTCON(int value) + public synchronized void set_INTCON(int value) { bank0[11] = value; bank1[11] = value; } - public int get_INTCON() + public synchronized int get_INTCON() { return bank0[11]; } //Bank1 Registers - public void set_OPTION(int value) + public synchronized void set_OPTION(int value) { bank1[1] = value; } - public int get_OPTION() + public synchronized int get_OPTION() { return bank1[1]; } - public void set_TRISA(int value) + public synchronized void set_TRISA(int value) { bank1[5] = value; } - public int get_TRISA() + public synchronized int get_TRISA() { return bank1[5]; } - public void set_TRISB(int value) + public synchronized void set_TRISB(int value) { bank1[6] = value; } - public int get_TRISB() + public synchronized int get_TRISB() { return bank1[6]; } - public void set_EECON1(int value) + public synchronized void set_EECON1(int value) { bank1[7] = value; } - public int get_EECON1() + public synchronized int get_EECON1() { return bank1[7]; } - public void set_EECON2(int value) + public synchronized void set_EECON2(int value) { bank1[8] = value; } - public int get_EECON2() + public synchronized int get_EECON2() { return bank1[8]; } //Bank0 & Bank1 Statusflags - public void set_Carryflag(boolean value) + public synchronized void set_Carryflag(boolean value) { int status = get_STATUS(); if (value) @@ -519,12 +519,12 @@ public class RAM { set_STATUS(status); } - public boolean get_Carryflag() + public synchronized boolean get_Carryflag() { return (get_STATUS() & 0b00000001) == 1; } - public void set_Digitcarryflag(boolean value) + public synchronized void set_Digitcarryflag(boolean value) { int status = get_STATUS(); if (value) @@ -540,12 +540,12 @@ public class RAM { set_STATUS(status); } - public boolean get_Digitcarryflag() + public synchronized boolean get_Digitcarryflag() { return (get_STATUS() & 0b00000010) == 2; } - public void set_Zeroflag(boolean value) + public synchronized void set_Zeroflag(boolean value) { int status = get_STATUS(); if (value) @@ -561,12 +561,12 @@ public class RAM { set_STATUS(status); } - public boolean get_Zeroflag() + public synchronized boolean get_Zeroflag() { return (get_STATUS() & 0b00000100) == 4; } - public void set_TimeOutFlag(boolean value) + public synchronized void set_TimeOutFlag(boolean value) { int status = get_STATUS(); if (value) @@ -582,12 +582,12 @@ public class RAM { set_STATUS(status); } - public boolean get_TimeOutFlag() + public synchronized boolean get_TimeOutFlag() { return (get_STATUS() & 0b00001000) == 8; } - public void set_PowerDownFlag(boolean value) + public synchronized void set_PowerDownFlag(boolean value) { int status = get_STATUS(); if (value) @@ -603,12 +603,12 @@ public class RAM { set_STATUS(status); } - public boolean get_PowerDownFlag() + public synchronized boolean get_PowerDownFlag() { return (get_STATUS() & 0b00010000) == 16; } - public void set_RP0Bit(boolean value) + public synchronized void set_RP0Bit(boolean value) { int status = get_STATUS(); if (value) @@ -624,12 +624,12 @@ public class RAM { set_STATUS(status); } - public boolean get_RP0Bit() + public synchronized boolean get_RP0Bit() { return (get_STATUS() & 0b00100000) == 32; } - public void set_RP1Bit(boolean value) + public synchronized void set_RP1Bit(boolean value) { int status = get_STATUS(); if (value) @@ -645,12 +645,12 @@ public class RAM { set_STATUS(status); } - public boolean get_RP1Bit() + public synchronized boolean get_RP1Bit() { return (get_STATUS() & 0b01000000) == 64; } - public void set_Interruptflag(boolean value) + public synchronized void set_Interruptflag(boolean value) { int status = get_STATUS(); if (value) @@ -666,23 +666,23 @@ public class RAM { set_STATUS(status); } - public boolean get_Interruptflag() + public synchronized boolean get_Interruptflag() { return (get_STATUS() & 0b10000000) == 128; } //Bank0 PCL - public int get_Programcounter() + public synchronized int get_Programcounter() { return (bank0[2]); } - public int get_LastProgramcounter() + public synchronized int get_LastProgramcounter() { return lastProgramcounter; } - public void inkrement_Programcounter(int value, int kindOfCall) //0 at Fetchzycle, 1 at Jumpcommand, 2 at ... + public synchronized void inkrement_Programcounter(int value, int kindOfCall) //0 at Fetchzycle, 1 at Jumpcommand, 2 at ... { if (bank0[2] >= 0 && bank0[2] <= 255) { @@ -704,7 +704,7 @@ public class RAM { } } - public void dekrement_Programcounter(int value) + public synchronized void dekrement_Programcounter(int value) { if (bank0[2] > 0 && bank0[2] <= 255) { @@ -718,7 +718,7 @@ public class RAM { } } - public boolean set_Programcounter(int value) + public synchronized boolean set_Programcounter(int value) { boolean setWorked = false; @@ -738,7 +738,7 @@ public class RAM { } //Bank0 PORTA - public void set_RA0(boolean value) + public synchronized void set_RA0(boolean value) { int portA = get_PORTA(); if (value) @@ -754,14 +754,14 @@ public class RAM { set_PORTA(portA); } - public boolean get_RA0() + public synchronized boolean get_RA0() { { return (get_PORTA() & 0b00000001) == 1; } } - public void set_RA1(boolean value) + public synchronized void set_RA1(boolean value) { int portA = get_PORTA(); if (value) @@ -777,14 +777,14 @@ public class RAM { set_PORTA(portA); } - public boolean get_RA1() + public synchronized boolean get_RA1() { { return (get_PORTA() & 0b00000010) == 2; } } - public void set_RA2(boolean value) + public synchronized void set_RA2(boolean value) { int portA = get_PORTA(); if (value) @@ -800,14 +800,14 @@ public class RAM { set_PORTA(portA); } - public boolean get_RA2() + public synchronized boolean get_RA2() { { return (get_PORTA() & 0b00000100) == 4; } } - public void set_RA3(boolean value) + public synchronized void set_RA3(boolean value) { int portA = get_PORTA(); if (value) @@ -823,7 +823,7 @@ public class RAM { set_PORTA(portA); } - public boolean get_RA3() + public synchronized boolean get_RA3() { { return (get_PORTA() & 0b00001000) == 8; @@ -831,7 +831,7 @@ public class RAM { } //External Clockimpulse for Timer0 - public void set_RA4_T0CKI(boolean value) + public synchronized void set_RA4_T0CKI(boolean value) { int portA = get_PORTA(); if (value) @@ -847,7 +847,7 @@ public class RAM { set_PORTA(portA); } - public boolean get_RA4_T0CKI() + public synchronized boolean get_RA4_T0CKI() { { return (get_PORTA() & 0b00010000) == 16; @@ -855,7 +855,7 @@ public class RAM { } //Bank0 PortB - public void set_RB0_INT(boolean value) + public synchronized void set_RB0_INT(boolean value) { int portB = get_PORTB(); if (value) @@ -871,14 +871,14 @@ public class RAM { set_PORTB(portB); } - public boolean get_RB0_INT() + public synchronized boolean get_RB0_INT() { { return (get_PORTB() & 0b00000001) == 1; } } - public void set_RB1(boolean value) + public synchronized void set_RB1(boolean value) { int portB = get_PORTB(); if (value) @@ -894,14 +894,14 @@ public class RAM { set_PORTB(portB); } - public boolean get_RB1() + public synchronized boolean get_RB1() { { return (get_PORTB() & 0b00000010) == 2; } } - public void set_RB2(boolean value) + public synchronized void set_RB2(boolean value) { int portB = get_PORTB(); if (value) @@ -917,12 +917,12 @@ public class RAM { set_PORTB(portB); } - public boolean get_RB2() + public synchronized boolean get_RB2() { return (get_PORTB() & 0b00000100) == 4; } - public void set_RB3(boolean value) + public synchronized void set_RB3(boolean value) { int portB = get_PORTB(); if (value) @@ -938,14 +938,14 @@ public class RAM { set_PORTB(portB); } - public boolean get_RB3() + public synchronized boolean get_RB3() { { return (get_PORTB() & 0b00001000) == 8; } } - public void set_RB4(boolean value) + public synchronized void set_RB4(boolean value) { int portB = get_PORTB(); if (value) @@ -961,14 +961,14 @@ public class RAM { set_PORTB(portB); } - public boolean get_RB4() + public synchronized boolean get_RB4() { { return (get_PORTB() & 0b00010000) == 16; } } - public void set_RB5(boolean value) + public synchronized void set_RB5(boolean value) { int portB = get_PORTB(); if (value) @@ -984,14 +984,14 @@ public class RAM { set_PORTB(portB); } - public boolean get_RB5() + public synchronized boolean get_RB5() { { return (get_PORTB() & 0b00100000) == 32; } } - public void set_RB6(boolean value) + public synchronized void set_RB6(boolean value) { int portB = get_PORTB(); if (value) @@ -1007,14 +1007,14 @@ public class RAM { set_PORTB(portB); } - public boolean get_RB6() + public synchronized boolean get_RB6() { { return (get_PORTB() & 0b01000000) == 64; } } - public void set_RB7(boolean value) + public synchronized void set_RB7(boolean value) { int portB = get_PORTB(); if (value) @@ -1030,7 +1030,7 @@ public class RAM { set_PORTB(portB); } - public boolean get_RB7() + public synchronized boolean get_RB7() { { return (get_PORTB() & 0b10000000) == 128; @@ -1038,7 +1038,7 @@ public class RAM { } //Bank0 INTCON - public void set_RBIF(boolean value) + public synchronized void set_RBIF(boolean value) { int intcon = get_INTCON(); if (value) @@ -1054,14 +1054,14 @@ public class RAM { set_INTCON(intcon); } - public boolean get_RBIF() + public synchronized boolean get_RBIF() { { return (get_INTCON() & 0b00000001) == 1; } } - public void set_INTF(boolean value) + public synchronized void set_INTF(boolean value) { int intcon = get_INTCON(); if (value) @@ -1077,14 +1077,14 @@ public class RAM { set_INTCON(intcon); } - public boolean get_INTF() + public synchronized boolean get_INTF() { { return (get_INTCON() & 0b00000010) == 2; } } - public void set_T0IF(boolean value) + public synchronized void set_T0IF(boolean value) { int intcon = get_INTCON(); if (value) @@ -1100,14 +1100,14 @@ public class RAM { set_INTCON(intcon); } - public boolean get_T0IF() + public synchronized boolean get_T0IF() { { return (get_INTCON() & 0b00000100) == 4; } } - public void set_RBIE(boolean value) + public synchronized void set_RBIE(boolean value) { int intcon = get_INTCON(); if (value) @@ -1123,14 +1123,14 @@ public class RAM { set_INTCON(intcon); } - public boolean get_RBIE() + public synchronized boolean get_RBIE() { { return (get_INTCON() & 0b00001000) == 8; } } - public void set_INTE(boolean value) + public synchronized void set_INTE(boolean value) { int intcon = get_INTCON(); if (value) @@ -1146,14 +1146,14 @@ public class RAM { set_INTCON(intcon); } - public boolean get_INTE() + public synchronized boolean get_INTE() { { return (get_INTCON() & 0b00010000) == 16; } } - public void set_T0IE(boolean value) + public synchronized void set_T0IE(boolean value) { int intcon = get_INTCON(); if (value) @@ -1169,14 +1169,14 @@ public class RAM { set_INTCON(intcon); } - public boolean get_T0IE() + public synchronized boolean get_T0IE() { { return (get_INTCON() & 0b00100000) == 32; } } - public void set_EEIE(boolean value) + public synchronized void set_EEIE(boolean value) { int intcon = get_INTCON(); if (value) @@ -1192,14 +1192,14 @@ public class RAM { set_INTCON(intcon); } - public boolean get_EEIE() + public synchronized boolean get_EEIE() { { return (get_INTCON() & 0b01000000) == 64; } } - public void set_GIE(boolean value) + public synchronized void set_GIE(boolean value) { int intcon = get_INTCON(); if (value) @@ -1215,7 +1215,7 @@ public class RAM { set_INTCON(intcon); } - public boolean get_GIE() + public synchronized boolean get_GIE() { { return (get_INTCON() & 0b10000000) == 128; @@ -1223,7 +1223,7 @@ public class RAM { } //Bank1 OPTION_REG - public void set_PS0(boolean value) + public synchronized void set_PS0(boolean value) { int option = get_OPTION(); if (value) @@ -1239,14 +1239,14 @@ public class RAM { set_OPTION(option); } - public boolean get_PS0() + public synchronized boolean get_PS0() { { return (get_OPTION() & 0b00000001) == 1; } } - public void set_PS1(boolean value) + public synchronized void set_PS1(boolean value) { int option = get_OPTION(); if (value) @@ -1262,14 +1262,14 @@ public class RAM { set_OPTION(option); } - public boolean get_PS1() + public synchronized boolean get_PS1() { { return (get_OPTION() & 0b00000010) == 2; } } - public void set_PS2(boolean value) + public synchronized void set_PS2(boolean value) { int option = get_OPTION(); if (value) @@ -1285,48 +1285,32 @@ public class RAM { set_OPTION(option); } - public boolean get_PS2() + public synchronized boolean get_PS2() { { return (get_OPTION() & 0b00000100) == 4; } } - public int get_TMR0_PrescalerRate() - { + public synchronized int get_TMR0_PrescalerRate() { int returnValue = 0; - - if (get_PSA()) - { + if (get_PSA()) { returnValue = 1; - } - - else - { - switch (get_OPTION() & 0b00000111) - { - case 0: - { + } else { + switch (get_OPTION() & 0b00000111) { + case 0: { returnValue = 2; }break; - - case 1: - { + case 1: { returnValue = 4; }break; - - case 2: - { + case 2: { returnValue = 8; }break; - - case 3: - { + case 3: { returnValue = 16; }break; - - case 4: - { + case 4: { returnValue = 32; }break; @@ -1349,7 +1333,7 @@ public class RAM { return returnValue; } - public int get_WDT_PrescalerRate() + public synchronized int get_WDT_PrescalerRate() { int returnValue = 0; @@ -1399,7 +1383,7 @@ public class RAM { return returnValue; } - public void set_PSA(boolean value) + public synchronized void set_PSA(boolean value) { int option = get_OPTION(); if (value) @@ -1415,14 +1399,14 @@ public class RAM { set_OPTION(option); } - public boolean get_PSA() + public synchronized boolean get_PSA() { { return (get_OPTION() & 0b00001000) == 8; } } - public void set_T0SE(boolean value) + public synchronized void set_T0SE(boolean value) { int option = get_OPTION(); if (value) @@ -1438,14 +1422,14 @@ public class RAM { set_OPTION(option); } - public boolean get_T0SE() + public synchronized boolean get_T0SE() { { return (get_OPTION() & 0b00010000) == 16; } } - public void set_T0CS(boolean value) + public synchronized void set_T0CS(boolean value) { int option = get_OPTION(); if (value) @@ -1461,14 +1445,14 @@ public class RAM { set_OPTION(option); } - public boolean get_T0CS() + public synchronized boolean get_T0CS() { { return (get_OPTION() & 0b00100000) == 32; } } - public void set_INTEDG(boolean value) + public synchronized void set_INTEDG(boolean value) { int option = get_OPTION(); if (value) @@ -1484,14 +1468,14 @@ public class RAM { set_OPTION(option); } - public boolean get_INTEDG() + public synchronized boolean get_INTEDG() { { return (get_OPTION() & 0b01000000) == 64; } } - public void set_RBPU(boolean value) + public synchronized void set_RBPU(boolean value) { int option = get_OPTION(); if (value) @@ -1507,7 +1491,7 @@ public class RAM { set_OPTION(option); } - public boolean get_RBPU() + public synchronized boolean get_RBPU() { { return (get_OPTION() & 0b10000000) == 128; @@ -1515,224 +1499,144 @@ public class RAM { } //Bank1 EECON1 - public void set_RD(boolean value) - { + public synchronized void set_RD(boolean value) { int eecon = get_EECON1(); - if (value) - { + if (value) { eecon |= 0b00000001; - } - - else - { + } else { eecon &= 0b11111110; } - set_EECON1(eecon); } - public boolean get_RD() - { - { - return (get_EECON1() & 0b00000001) == 1; - } + public synchronized boolean get_RD() { + return (get_EECON1() & 0b00000001) == 1; } - public void set_WR(boolean value) - { + public synchronized void set_WR(boolean value) { int eecon = get_EECON1(); - if (value) - { + if (value) { eecon |= 0b00000010; - } - - else - { + } else { eecon &= 0b11111101; } - set_EECON1(eecon); } - public boolean get_WR() - { - { - return (get_EECON1() & 0b00000010) == 2; - } + public synchronized boolean get_WR() { + return (get_EECON1() & 0b00000010) == 2; } - public void set_WREN(boolean value) - { + public synchronized void set_WREN(boolean value) { int eecon = get_EECON1(); - if (value) - { + if (value) { eecon |= 0b00000100; - } - - else - { + } else { eecon &= 0b11111011; } - set_EECON1(eecon); } - public boolean get_WREN() - { - { - return (get_EECON1() & 0b00000100) == 4; - } + public synchronized boolean get_WREN() { + return (get_EECON1() & 0b00000100) == 4; } - public void set_WRERR(boolean value) - { + public synchronized void set_WRERR(boolean value) { int eecon = get_EECON1(); - if (value) - { + if (value) { eecon |= 0b00001000; - } - - else - { + } else { eecon &= 0b11110111; } - set_EECON1(eecon); } - public boolean get_WRERR() - { - { - return (get_EECON1() & 0b00001000) == 8; - } + public synchronized boolean get_WRERR() { + return (get_EECON1() & 0b00001000) == 8; } - public void set_EEIF(boolean value) - { + public synchronized void set_EEIF(boolean value) { int eecon = get_EECON1(); - if (value) - { + if (value) { eecon |= 0b00010000; - } - - else - { + } else { eecon &= 0b11101111; } - set_EECON1(eecon); } - public boolean get_EEIF() - { - { - return (get_EECON1() & 0b00010000) == 16; - } + public synchronized boolean get_EEIF() { + return (get_EECON1() & 0b00010000) == 16; } //Bank1 TRISA - public void set_TRISA0(boolean value) - { + public synchronized void set_TRISA0(boolean value) { int trisA = get_TRISA(); - if (value) - { + if (value) { trisA |= 0b00000001; - } - - else - { + } else { trisA &= 0b11111110; } - set_TRISA(trisA); } - public boolean get_TRISA0() - { + public synchronized boolean get_TRISA0() { return (get_TRISA() & 0b00000001) == 1; } - public void set_TRISA1(boolean value) - { + public synchronized void set_TRISA1(boolean value) { int trisA = get_TRISA(); - if (value) - { + if (value) { trisA |= 0b00000010; - } - - else - { + } else { trisA &= 0b11111101; } - set_TRISA(trisA); } - public boolean get_TRISA1() - { + public synchronized boolean get_TRISA1() { return (get_TRISA() & 0b00000010) == 2; } - public void set_TRISA2(boolean value) - { + public synchronized void set_TRISA2(boolean value) { int trisA = get_TRISA(); - if (value) - { + if (value) { trisA |= 0b00000100; - } - - else - { + } else { trisA &= 0b11111011; } - set_TRISA(trisA); } - public boolean get_TRISA2() - { + public synchronized boolean get_TRISA2() { return (get_TRISA() & 0b00000100) == 4; } - public void set_TRISA3(boolean value) - { + public synchronized void set_TRISA3(boolean value) { int trisA = get_TRISA(); - if (value) - { + if (value) { trisA |= 0b00001000; - } - - else - { + } else { trisA &= 0b11110111; } - set_TRISA(trisA); } - public boolean get_TRISA3() - { + public synchronized boolean get_TRISA3() { return (get_TRISA() & 0b00001000) == 8; } - public void set_TRISA4(boolean value) - { + public synchronized void set_TRISA4(boolean value) { int trisA = get_TRISA(); - if (value) - { + if (value) { trisA |= 0b00010000; - } - - else - { + } else { trisA &= 0b11101111; } - set_TRISA(trisA); } - public boolean get_TRISA4() - { + public synchronized boolean get_TRISA4() { return (get_TRISA() & 0b00010000) == 16; } } \ No newline at end of file diff --git a/src/Frontend/PIC_SIMULATOR_GUI_JAVA/GUIMainFrame.java b/src/Frontend/PIC_SIMULATOR_GUI_JAVA/GUIMainFrame.java index 9a7230f..59c2cb7 100755 --- a/src/Frontend/PIC_SIMULATOR_GUI_JAVA/GUIMainFrame.java +++ b/src/Frontend/PIC_SIMULATOR_GUI_JAVA/GUIMainFrame.java @@ -1,11 +1,14 @@ package Frontend.PIC_SIMULATOR_GUI_JAVA; import java.awt.Color; +import java.awt.Dimension; +import java.awt.Insets; import java.awt.GridBagLayout; import java.awt.GridBagConstraints; import javax.swing.BorderFactory; import javax.swing.ImageIcon; +import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.border.Border; @@ -24,13 +27,11 @@ public class GUIMainFrame extends JFrame { this.setTitle("PIC-Simulator GUI"); // sets title of frame this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // if x is pressed, exit application (HIDE_ON_CLOSE-hides application, DO_NOTHING_ON_CLOSE-prevents user from closing application) //this.setResizable(false); // prevent frame from beeing resized - this.setSize(1200, 840); //sets x and y dimension of frame + this.setSize(1400, 800); //sets x and y dimension of frame + //this.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT); this.setLayout(new GridBagLayout()); - oGUITestFileTable = new GUITestFileTable(); - this.setJMenuBar(new GUIMenuBar(env, this, oGUITestFileTable)); - this.setVisible(true); //make frame visible this.setBackground(new Color(76, 78, 82)); ImageIcon guiLogo = new ImageIcon("./images/gui_logo.png"); // create an ImageIcon @@ -50,7 +51,7 @@ public class GUIMainFrame extends JFrame { //text.setBackground(Color.BLUE); // set background color //text.setOpaque(true); // display background color - Border border = BorderFactory.createLineBorder(Color.green, 3); // creates border for label, color and size of border + //Border border = BorderFactory.createLineBorder(Color.green, 3); // creates border for label, color and size of border //text.setBorder(border); // sets border of label to "border" //text.setVerticalAlignment(JLabel.TOP); // vertically alligns label "text" (JLabel.TOP, JLabel.CENTER, JLabel.BOTTOM) @@ -60,13 +61,11 @@ public class GUIMainFrame extends JFrame { //getContentPane().setLayout(new BorderLayout()); //this.add(new GUITestFileTable("./testfiles/TPicSim1.LST")); - GridBagConstraints oGridBagConstraints = new GridBagConstraints(); - oGridBagConstraints.gridx = 10; - oGridBagConstraints.gridy = 10; - oGridBagConstraints.gridheight = 10; - oGridBagConstraints.gridwidth = 500; - oGridBagConstraints.anchor = GridBagConstraints.PAGE_START; - this.add(oGUITestFileTable, oGridBagConstraints); + GridBagConstraints c = new GridBagConstraints(); + c.gridx = 0; //next added element will be in column 1 + c.gridy = 0; //next added element will be in row 1 + c.insets = new Insets(1,1,1,1); + this.add(oGUITestFileTable, c); updateWindow(); } diff --git a/src/Frontend/PIC_SIMULATOR_GUI_JAVA/GUITestFileTable.java b/src/Frontend/PIC_SIMULATOR_GUI_JAVA/GUITestFileTable.java index f447009..bbcc79f 100644 --- a/src/Frontend/PIC_SIMULATOR_GUI_JAVA/GUITestFileTable.java +++ b/src/Frontend/PIC_SIMULATOR_GUI_JAVA/GUITestFileTable.java @@ -4,7 +4,7 @@ import java.awt.Dimension; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.GridLayout; - +import java.awt.Insets; import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; @@ -15,6 +15,7 @@ import java.util.ArrayList; import javax.swing.JCheckBox; import javax.swing.JPanel; +import javax.swing.JScrollBar; import javax.swing.JTextField; public class GUITestFileTable extends JPanel { @@ -22,64 +23,77 @@ public class GUITestFileTable extends JPanel { ArrayList oCheckboxes = new ArrayList(); public GUITestFileTable() { - this.setLayout(new GridBagLayout()); - GridBagConstraints oGridBagConstraints = new GridBagConstraints(); - oGridBagConstraints.gridx = 0; - oGridBagConstraints.gridy = 0; - oGridBagConstraints.gridheight = 20; - oGridBagConstraints.gridwidth = 20; //500, 10, 10, 480 JTextField oFill = new JTextField("19"); oFill.setEditable(false); - this.add(oFill, oGridBagConstraints); - oGridBagConstraints.gridx = 20; - this.add(new JCheckBox(), oGridBagConstraints); - oGridBagConstraints.gridx = 40; - oGridBagConstraints.gridwidth = 460; + this.setLayout(new GridLayout(1, 3)); + this.add(oFill); + this.add(new JCheckBox()); oFill = new JTextField("Test"); oFill.setEditable(false); - this.add(oFill, oGridBagConstraints); + this.add(oFill); } public void setData(ArrayList data) { this.removeAll(); - + JScrollBar oScrollBar = new JScrollBar(JScrollBar.VERTICAL, 30, 1, 0, 100); int iNumberOfLines = data.size() + 1; + JPanel oLines = new JPanel(); + oLines.add(oScrollBar);//TODO + oLines.setLayout(new GridBagLayout()); + int iHorizontalCount = 0; + int iVerticalCount = 0; + System.out.println(1); + GridBagConstraints l = new GridBagConstraints(); + l.gridx = iHorizontalCount; - this.setLayout(new GridBagLayout()); - - JPanel oLineNumbers = new JPanel(); - oLineNumbers.setLayout(new GridLayout(iNumberOfLines, 1)); - GridBagConstraints oGridBagConstraints = new GridBagConstraints(); - oGridBagConstraints.gridx = 0; - oGridBagConstraints.gridy = 0; - oGridBagConstraints.gridwidth = 500; - oGridBagConstraints.gridheight = 600; - - JPanel oBreakpoints = new JPanel(); - oBreakpoints.setLayout(new GridLayout(iNumberOfLines, 1)); - - JPanel oFileLines = new JPanel(); - oFileLines.setLayout(new GridLayout(iNumberOfLines, 1)); + int iMaxLength = getMaxLen(data); for (int i = 1; i < iNumberOfLines; i++) { - JTextField oTestLine = new JTextField(data.get(i - 1)); - oTestLine.setEditable(false); - oFileLines.add(oTestLine); - JCheckBox oCheckbox = new JCheckBox(); - oCheckbox.setEnabled(false); - oCheckboxes.add(oCheckbox); - oBreakpoints.add(oCheckbox); - JTextField oNumber = new JTextField(i + ""); - oNumber.setEditable(false); - oLineNumbers.add(oNumber); - } + JPanel oPanel = new JPanel(); + oPanel.setLayout(new GridBagLayout()); - this.add(oLineNumbers, oGridBagConstraints); - this.add(oBreakpoints); - this.add(oFileLines); + GridBagConstraints c = new GridBagConstraints(); + c.gridx = 0; + c.gridy = 0; + + JTextField oNumber = new JTextField(i + "", 3); + oNumber.setEditable(false); + oPanel.add(oNumber, c); + + c.gridx = 1; + + JCheckBox oCheckbox = new JCheckBox(); + oCheckbox.setEnabled(false); + oCheckboxes.add(oCheckbox); + oPanel.add(oCheckbox, c); + + c.gridx = 2; + + JTextField oTestLine = new JTextField(data.get(i - 1), iMaxLength); + oTestLine.setEditable(false); + oPanel.add(oTestLine, c); + + l.gridy = iVerticalCount; + l.anchor = GridBagConstraints.WEST; + oLines.add(oPanel, l); + iVerticalCount++; + } + System.out.println(iMaxLength); + this.add(oLines); } public ArrayList getCheckboxes() { return oCheckboxes; } + + private int getMaxLen(ArrayList data) { + int iSize = data.size(); + int iMaxLength = 0; + for (int i = 0; i < iSize; i++) { + if (data.get(i).length() > iMaxLength) { + iMaxLength = data.get(i).length(); + } + } + return iMaxLength; + } }