Skip to content
Snippets Groups Projects
Commit 19b10cb3 authored by buehlera's avatar buehlera
Browse files

add changes in GlueBlock, SubroutineRefBlock and OBFrame

parent 07eb94e2
Branches
No related tags found
No related merge requests found
...@@ -9,11 +9,4 @@ target/ ...@@ -9,11 +9,4 @@ target/
openblocks.iml openblocks.iml
bin/ bin/
.settings/ .settings/
*~
src/main/resources/com/ardublock/block/ardublock.zip src/main/resources/com/ardublock/block/ardublock.zip
deploy.sh
<<<<<<< HEAD
=======
test-output
src/main/resources/com/ardublock/block/littlebits/files
>>>>>>> upstream/master
...@@ -35,6 +35,11 @@ public class GlueBlock extends TranslatorBlock ...@@ -35,6 +35,11 @@ public class GlueBlock extends TranslatorBlock
public SimCode toSim() throws BlockException, SocketNullException { public SimCode toSim() throws BlockException, SocketNullException {
TranslatorBlock tB2 = this.getTranslatorBlockAtSocket(1); TranslatorBlock tB2 = this.getTranslatorBlockAtSocket(1);
TranslatorBlock tB1 = this.getTranslatorBlockAtSocket(0); TranslatorBlock tB1 = this.getTranslatorBlockAtSocket(0);
if(tB1 != null) {
return new CodeConnectString(tB1.toSim(),tB2.toSim()); return new CodeConnectString(tB1.toSim(),tB2.toSim());
} }
return new CodeConnectString(null,tB2.toSim());
}
} }
...@@ -27,6 +27,7 @@ public class SubroutineRefBlock extends TranslatorBlock ...@@ -27,6 +27,7 @@ public class SubroutineRefBlock extends TranslatorBlock
return "\t"+subroutineName + "();\n"; return "\t"+subroutineName + "();\n";
} }
@Override
public SimCode toSim() { public SimCode toSim() {
return new CodeExecuteFunction(label.trim()); return new CodeExecuteFunction(label.trim());
} }
......
...@@ -346,6 +346,8 @@ public class OpenblocksFrame extends JFrame ...@@ -346,6 +346,8 @@ public class OpenblocksFrame extends JFrame
workspaceController.loadProject(getArduBlockString(), null , "default"); workspaceController.loadProject(getArduBlockString(), null , "default");
generateButton.setVisible(true); generateButton.setVisible(true);
simulateButton.setVisible(false); simulateButton.setVisible(false);
serialMonitorButton.setVisible(true);
serialPlotterButton.setVisible(true);
appPrefix = uiMessageBundle.getString("ardublock.ui.appprefix.standard"); appPrefix = uiMessageBundle.getString("ardublock.ui.appprefix.standard");
setTitle(makeFrameTitle()); setTitle(makeFrameTitle());
...@@ -375,6 +377,8 @@ public class OpenblocksFrame extends JFrame ...@@ -375,6 +377,8 @@ public class OpenblocksFrame extends JFrame
workspaceController.loadProject(getArduBlockString(), null , "custom"); workspaceController.loadProject(getArduBlockString(), null , "custom");
generateButton.setVisible(true); generateButton.setVisible(true);
simulateButton.setVisible(false); simulateButton.setVisible(false);
serialMonitorButton.setVisible(true);
serialPlotterButton.setVisible(true);
appPrefix = uiMessageBundle.getString("ardublock.ui.appprefix.pro"); appPrefix = uiMessageBundle.getString("ardublock.ui.appprefix.pro");
setTitle(makeFrameTitle()); setTitle(makeFrameTitle());
...@@ -405,6 +409,8 @@ public class OpenblocksFrame extends JFrame ...@@ -405,6 +409,8 @@ public class OpenblocksFrame extends JFrame
workspaceController.loadProject(getArduBlockString(), null , "default"); workspaceController.loadProject(getArduBlockString(), null , "default");
generateButton.setVisible(false); generateButton.setVisible(false);
simulateButton.setVisible(true); simulateButton.setVisible(true);
serialMonitorButton.setVisible(false);
serialPlotterButton.setVisible(false);
//TODO get up running... //TODO get up running...
appPrefix = uiMessageBundle.getString("ardublock.ui.appprefix.sim"); appPrefix = uiMessageBundle.getString("ardublock.ui.appprefix.sim");
setTitle(makeFrameTitle()); setTitle(makeFrameTitle());
...@@ -462,24 +468,26 @@ public class OpenblocksFrame extends JFrame ...@@ -462,24 +468,26 @@ public class OpenblocksFrame extends JFrame
websiteButton.setToolTipText(uiMessageBundle.getString("ardublock.ui.website.tooltip")); websiteButton.setToolTipText(uiMessageBundle.getString("ardublock.ui.website.tooltip"));
//***************************************** //*****************************************
bottomPanel.add(websiteButton);
//bottomPanel.add(blockreferenceButton); //bottomPanel.add(blockreferenceButton);
bottomPanel.add(Box.createRigidArea(new Dimension(15, 0))); //std value 30,0 bottomPanel.add(Box.createRigidArea(new Dimension(10, 0))); //std value 30,0
bottomPanel.add(saveImageButton); bottomPanel.add(saveImageButton);
bottomPanel.add(Box.createRigidArea(new Dimension(15, 0))); //std value 30,0 bottomPanel.add(Box.createRigidArea(new Dimension(10, 0))); //std value 30,0
bottomPanel.add(zoomSlider); bottomPanel.add(zoomSlider);
//bottomPanel.add(zoomInButton); //bottomPanel.add(zoomInButton);
//bottomPanel.add(zoomResetButton); //bottomPanel.add(zoomResetButton);
//bottomPanel.add(zoomOutButton); //bottomPanel.add(zoomOutButton);
bottomPanel.add(Box.createRigidArea(new Dimension(15, 0))); //std value 30,0 bottomPanel.add(Box.createRigidArea(new Dimension(10, 0)));//std value 30,0
bottomPanel.add(versionLabel);
bottomPanel.add(Box.createRigidArea(new Dimension(15, 0))); //std value 30,0
bottomPanel.add(copyButton); bottomPanel.add(copyButton);
bottomPanel.add(pasteButton); bottomPanel.add(pasteButton);
bottomPanel.add(Box.createRigidArea(new Dimension(15, 0))); //std value 30,0 bottomPanel.add(Box.createRigidArea(new Dimension(10, 0))); //std value 30,0
bottomPanel.add(modeBasicButton); bottomPanel.add(modeBasicButton);
bottomPanel.add(modeProButton); bottomPanel.add(modeProButton);
bottomPanel.add(modeSimButton); bottomPanel.add(modeSimButton);
bottomPanel.add(Box.createRigidArea(new Dimension(10, 0))); //std value 30,0
bottomPanel.add(versionLabel);
bottomPanel.add(Box.createRigidArea(new Dimension(10, 0))); //std value 30,0
bottomPanel.add(websiteButton);
//bottomPanel.add(lmssiteButton); //bottomPanel.add(lmssiteButton);
this.add(topPanel, BorderLayout.NORTH); this.add(topPanel, BorderLayout.NORTH);
......
...@@ -47,7 +47,7 @@ ardublock.ui.undo=Undo ...@@ -47,7 +47,7 @@ ardublock.ui.undo=Undo
ardublock.ui.undo.tooltip=Undo Ctrl-Z ardublock.ui.undo.tooltip=Undo Ctrl-Z
ardublock.ui.redo=Redo ardublock.ui.redo=Redo
ardublock.ui.redo.tooltip=redo Ctrl-Y ardublock.ui.redo.tooltip=redo Ctrl-Y
ardublock.ui.saveImage=Save as image... ardublock.ui.saveImage=Save as image
ardublock.ui.saveImage.tooltip=save current program as image... Ctrl-P ardublock.ui.saveImage.tooltip=save current program as image... Ctrl-P
ardublock.ui.zoomIn=+ ardublock.ui.zoomIn=+
ardublock.ui.zoomIn.tooltip=zoom in Ctrl-Plus ardublock.ui.zoomIn.tooltip=zoom in Ctrl-Plus
...@@ -62,7 +62,7 @@ ardublock.ui.paste.tooltip=paste program from clipboard Ctrl-V ...@@ -62,7 +62,7 @@ ardublock.ui.paste.tooltip=paste program from clipboard Ctrl-V
ardublock.ui.simulation=simulate ardublock.ui.simulation=simulate
ardublock.ui.simulation.tooltip=start simulation with basic block-set and letsgoING modules ardublock.ui.simulation.tooltip=start simulation with basic block-set and letsgoING modules
ardublock.ui.version=Version 2.13 Simulator ardublock.ui.version=v2.2 beta
ardublock.ui.appprefix.standard= ardublock.ui.appprefix.standard=
ardublock.ui.appprefix.pro=Pro ardublock.ui.appprefix.pro=Pro
......
...@@ -49,7 +49,7 @@ ardublock.ui.undo=Undo ...@@ -49,7 +49,7 @@ ardublock.ui.undo=Undo
ardublock.ui.undo.tooltip=Rckgngig Ctrl-Z ardublock.ui.undo.tooltip=Rckgngig Ctrl-Z
ardublock.ui.redo=Redo ardublock.ui.redo=Redo
ardublock.ui.redo.tooltip=Wiederherstellen Ctrl-Y ardublock.ui.redo.tooltip=Wiederherstellen Ctrl-Y
ardublock.ui.saveImage=Bild speichern... ardublock.ui.saveImage=Bild speichern
ardublock.ui.saveImage.tooltip=Speichert ein Bild des aktuellen Programms Strg-P ardublock.ui.saveImage.tooltip=Speichert ein Bild des aktuellen Programms Strg-P
ardublock.ui.zoomIn=+ ardublock.ui.zoomIn=+
ardublock.ui.zoomIn.tooltip=vergrere Programm Strg-Plus ardublock.ui.zoomIn.tooltip=vergrere Programm Strg-Plus
...@@ -64,7 +64,7 @@ ardublock.ui.paste.tooltip=f ...@@ -64,7 +64,7 @@ ardublock.ui.paste.tooltip=f
ardublock.ui.simulation=Hochladen auf den Simulator ardublock.ui.simulation=Hochladen auf den Simulator
ardublock.ui.simulation.tooltip=Starte den Simulator fuer die letsgoING-GrundlagenModule ardublock.ui.simulation.tooltip=Starte den Simulator fuer die letsgoING-GrundlagenModule
ardublock.ui.version=Version 2.13 Simulator ardublock.ui.version=v2.2 beta
ardublock.ui.appprefix.standard= ardublock.ui.appprefix.standard=
ardublock.ui.appprefix.pro=Pro ardublock.ui.appprefix.pro=Pro
...@@ -185,8 +185,7 @@ bg.repeat.description=Wiederhole die Befehle x-mal. Die Wiederholungen werden in ...@@ -185,8 +185,7 @@ bg.repeat.description=Wiederhole die Befehle x-mal. Die Wiederholungen werden in
bg.repeat_control.description= bg.repeat_control.description=
bg.break.description=Beende die aktuelle Schleife\nACHTUNG: Nicht in der Hauptschleife verwenden! bg.break.description=Beende die aktuelle Schleife\nACHTUNG: Nicht in der Hauptschleife verwenden!
bg.delay_microseconds.description=Warte Mikrosekunden. Solange tut das Programm nichts bg.delay_microseconds.description=Warte Mikrosekunden. Solange tut das Programm nichts
bg.wait.description=Befehle ausserhalb von mache werden nur alle x-Millisekunden ausgefhrt\nDie Startzeit jedes Durchgangs wird in der Variable gespeichert bg.wait.description=Die Bloecke innerhalb dieses Blocks werden ausgefhrt x Millisekunden ausgefhrt.
bc.head= bc.head=
bc.setup=Setup bc.setup=Setup
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment