Skip to content
Snippets Groups Projects
Commit f7480c7f authored by Leon Dieter's avatar Leon Dieter
Browse files

minor changes

parent b5073127
No related branches found
No related tags found
No related merge requests found
......@@ -46,8 +46,8 @@ public class Simulator implements Runnable, ActionListener{
private Thread guiThread;
private Thread simuThread;
private Vector<SimCodeFunction> functionsCode = new Vector<SimCodeFunction>();
private final int xscale = 700;
private final int yscale = 700;
private final int xscale = 800;
private final int yscale = 800;
/**
* Privater Konstruktor der Klasse Simulator<br>
* Die Klasse ist als Singelton geschrieben, daher sollte diese Konstruktor nie
......@@ -179,14 +179,13 @@ public class Simulator implements Runnable, ActionListener{
int WidthWindow = ((int)((gui.getWidth() * 1.0975) - 13.307));
int HeightWindow = ((int)((gui.getHeight() * 1.2709) - 174.77));
// int WidthWindow = gui.getWidth();
// int HeightWindow = gui.getHeight();
System.out.println(WidthWindow + " " + HeightWindow);
gui.stopThread();
gui.dispose();
createSubClasses(WidthWindow, HeightWindow);
createSubClasses(WidthWindow, HeightWindow);
gui.setLocation(locationWindow);
......
......
......@@ -471,25 +471,7 @@ public class GUI extends JFrame implements Runnable, ActionListener {
}
public int getxscale() {
return xscale;
}
public int getyscale() {
return yscale;
}
public void setxscale(int _xscale) {
xscale = _xscale;
}
public void setyscale(int _yscale) {
yscale = _yscale;
}
......
......
......@@ -112,7 +112,7 @@ public class ArduinoUno extends Modul {
// Offset für den Arduino um diesen mehr mittig zu platzieren.
int locx = ((int)(0.0516*xscale));
int locy = ((int)(0.0517*yscale));
calculatePinPos(locx, locy);
layerpane.setPreferredSize(new Dimension(((int)(0.606*xscale)) + locx, ((int)(0.432*yscale)) + locy));
chipIcon_temp.setImage(chipIcon.getImage().getScaledInstance(((int)(0.606*xscale)), ((int)(0.432*yscale)), Image.SCALE_SMOOTH));
......@@ -139,7 +139,7 @@ public class ArduinoUno extends Modul {
labelButton.setSize(((int)(0.062*xscale)), ((int)(0.0527*yscale)));
labelButton.setLocation(((int)(0.06612*xscale))+locx, ((int)(0.00103*yscale))+locy);
calculatePinPos(locx, locy);
}
......@@ -163,17 +163,19 @@ public class ArduinoUno extends Modul {
return true;
}
private void calculatePinPos(int locx, int locy) {
private void calculatePinPos(int _locx, int _locy) {
Vector<Point> pins = new Vector<Point>();
int offset = 0;
for (int i = 15; i > 1; i--) {
if (i < 8)
if (i < 8) {
offset = -((int)(0.012*xscale));
pins.add(new Point(i * ((int)(0.02066*xscale)) + locx + ((int)(0.2541*xscale)) + offset, locy + ((int)(0.01965*yscale))));
}
pins.add(new Point(i * ((int)(0.02066*xscale)) + _locx + ((int)(0.2541*xscale)) + offset, _locy + ((int)(0.01965*yscale))));
}
for (int i = 0; i < 6; i++) {
pins.add(new Point(i * ((int)(0.02066*xscale)) + locx + ((int)(0.46178*xscale)), locy + ((int)(0.41054*yscale))));
pins.add(new Point(i * ((int)(0.02066*xscale)) + _locx + ((int)(0.46178*xscale)), _locy + ((int)(0.41054*yscale))));
}
// Dieser Code malt kleine Rechtecke an die PinPositionen um sie besser zu
// überprüfen.
......@@ -188,6 +190,7 @@ public class ArduinoUno extends Modul {
* label.setLocation(pin.x,pin.y); label.setSize(10, 10); layerpane.add(label,
* 0); }
*/
System.out.println(pins.get(19).getX());
this.setPinPos(pins);
}
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment