Skip to content
Snippets Groups Projects
Commit 8f2619bb authored by Lucas Stratmann's avatar Lucas Stratmann
Browse files

Wiring, Resetbutton, Potilabel

parent 71e38c8f
No related branches found
No related tags found
No related merge requests found
Showing
with 35 additions and 15 deletions
No preview for this file type
......@@ -27,12 +27,16 @@ import tec.letsgoing.ardublock.simulator.simcode.vars.CodeMillis;
import tec.letsgoing.ardublock.simulator.view.GUI;
/**
* @author Lucas
* Diese Klasse verwaltet alle Elemente des Simulators. Sie ist geschrieben als Singelton.
*
*
* Pinmapping:
* RGB: 9,10,11
* Poti: A5
* Button: 3,4,5
* @author Lucas
*
*
*/
public class Simulator implements Runnable, ActionListener {
......@@ -43,10 +47,8 @@ public class Simulator implements Runnable, ActionListener {
private Thread simuThread;
private Vector<SimCodeFunction> functionsCode = new Vector<SimCodeFunction>();
//changed to public by Anian
//private Simulator() {
public Simulator() {
private Simulator() {
createSubClasses();
}
......
......@@ -11,7 +11,10 @@ import tec.letsgoing.ardublock.simulator.simcode.functions.SimCodeFunction;
import tec.letsgoing.ardublock.simulator.view.GUI;
/**
* Diese Klasse hält die Daten eines "virtuellen" Arduinos und verwaltet die Hardware
* @author Lucas
*
*
*
*/
public class Arduino {
......
......@@ -7,7 +7,10 @@ import java.util.Observable;
import java.util.Observer;
/**
* Diese Klasse ist für einen Pin auf dem Arduino
* @author Lucas
*
*
*
*/
public class Pin extends Observable {
......
......@@ -6,7 +6,10 @@ package tec.letsgoing.ardublock.simulator.arduino;
import tec.letsgoing.ardublock.simulator.simcode.SimCode;
/**
* Diese Klasse speichert eine Variable und stellt diese über Operationen zur Verfügung
* @author Lucas
*
*
*
*/
public class Variable {
......
......@@ -8,6 +8,9 @@ import tec.letsgoing.ardublock.simulator.simcode.functions.SimCodeFunction;
/**
* @author Lucas
*
* Jedes Codeelement erbt von dieser dieser Klasse.
* Durch die run()-Methode kann jedes Code-Objekt ausgeführt werden.
*
*/
public abstract class SimCode {
......
......@@ -10,6 +10,8 @@ import tec.letsgoing.ardublock.simulator.simcode.functions.SimCodeFunction;
/**
* @author Lucas
*
* Verbinde einen beliebigen Block mit einer Zeichenkette
*
*/
public class CodeConnectString extends SimCode {
......
......@@ -11,6 +11,7 @@ import tec.letsgoing.ardublock.simulator.simcode.functions.SimCodeFunction;
/**
* @author Lucas
* Sende Nachricht via Serial
*
*/
public class CodeSerialPrint extends SimCode {
......
......@@ -10,7 +10,7 @@ import tec.letsgoing.ardublock.simulator.simcode.functions.SimCodeFunction;
/**
* @author Lucas
*
* Warte Millisekunden.
*/
public class CodeDelay extends SimCode {
SimTypeInt codeBlock;
......
......@@ -11,7 +11,7 @@ import tec.letsgoing.ardublock.simulator.simcode.functions.SimCodeFunction;
/**
* @author Lucas
*
* Führe Befehle aus, falls "falls"-Block FALSCH (und evtl. "sonst falls"-Block) sind.
*/
public class CodeElse extends CodeTypeIf {
private Vector<SimCode> codeBlocks;
......
......@@ -12,7 +12,7 @@ import tec.letsgoing.ardublock.simulator.simcode.functions.SimCodeFunction;
/**
* @author Lucas
*
* Führe die Befehle aus wenn falls-Block FALSCH ist und Bedingung WAHR ist.
*/
public class CodeElseIf extends CodeTypeIf {
private CodeTypeIf follow;
......
......@@ -12,7 +12,7 @@ import tec.letsgoing.ardublock.simulator.simcode.functions.SimCodeFunction;
/**
* @author Lucas
*
* Wiederhole die Befehle x-mal.
*/
public class CodeFor extends SimCode {
SimTypeInt count;
......
......@@ -13,7 +13,7 @@ import tec.letsgoing.ardublock.simulator.simcode.functions.SimCodeFunction;
/**
* @author Lucas
*
* Wiederhole die Befehle x-mal. Die Wiederholungen werden in der Variable gespeichert.
*/
public class CodeForCount extends SimCode {
private SimTypeInt count;
......
......@@ -13,6 +13,7 @@ import tec.letsgoing.ardublock.simulator.simcode.functions.SimCodeFunction;
/**
* @author Lucas
*
* Führe Befehle aus, wenn die Bedingung WAHR ist.
*/
public class CodeIf extends CodeTypeIf {
private CodeTypeIf follow;
......
......@@ -9,6 +9,8 @@ import tec.letsgoing.ardublock.simulator.simcode.functions.SimCodeFunction;
/**
* @author Lucas
*
* Unterklasse für die If-Codeblöcke
*
*/
public abstract class CodeTypeIf extends SimCode {
......
......@@ -12,7 +12,7 @@ import tec.letsgoing.ardublock.simulator.simcode.functions.SimCodeFunction;
/**
* @author Lucas
*
* Führe Befehle aus, solange die Bedingung WAHR ist.
*/
public class CodeWhile extends SimCode {
SimTypeBool condition;
......
......@@ -13,7 +13,7 @@ import tec.letsgoing.ardublock.simulator.simcode.functions.SimCodeFunction;
/**
* @author Lucas
*
* Befehle ausserhalb von mache werden nur alle x-Millisekunden ausgeführt\nDie Startzeit jedes Durchgangs wird in der Variable gespeichert
*/
public class CodeWhileMillis extends SimCode {
private SimTypeInt duration;
......
......@@ -9,7 +9,7 @@ import tec.letsgoing.ardublock.simulator.simcode.functions.SimCodeFunction;
/**
* @author Lucas
*
* Klasse für einen BooldatenTyp
*/
public class SimTypeBool extends SimCode {
boolean value = false;
......
......@@ -9,7 +9,7 @@ import tec.letsgoing.ardublock.simulator.simcode.functions.SimCodeFunction;
/**
* @author Lucas
*
* Klasse für einen Int-Datentyp
*/
public class SimTypeInt extends SimCode {
private int value = 0;
......
......@@ -9,7 +9,7 @@ import tec.letsgoing.ardublock.simulator.simcode.functions.SimCodeFunction;
/**
* @author Lucas
*
* Klasse für einen Zeichenketten Datentyp
*/
public class SimTypeString extends SimCode {
private String content;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment