Skip to content

Commit

Permalink
add guino pause
Browse files Browse the repository at this point in the history
add block guino pause in communication
  • Loading branch information
karlTH committed Dec 12, 2014
1 parent d07dea8 commit fc95a35
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.ardublock.translator.block.Duinoedu;

import com.ardublock.translator.Translator;
import com.ardublock.translator.block.TranslatorBlock;
import com.ardublock.translator.block.exception.SocketNullException;
import com.ardublock.translator.block.exception.SubroutineNotDeclaredException;

public class Guino_Pause extends TranslatorBlock {

public Guino_Pause (Long blockId, Translator translator, String codePrefix, String codeSuffix, String label)
{
super(blockId, translator, codePrefix, codeSuffix, label);
}

//@Override
public String toCode() throws SocketNullException, SubroutineNotDeclaredException
{
translator.addHeaderFile("EasyTransfer.h");
translator.addHeaderFile("EEPROM.h");
translator.addHeaderFile("Guino.h");
translator.addDefinitionCommand("int GuinoInterrupteurvirtuel = 0 ;");
translator.addDefinitionCommand("//libraries at http://duinoedu.com/dl/lib/dupont/EDU_Guino/");
translator.addSetupCommand("GUINO_BRANCHER();");
translator.addGuinoCommand(" GUINO_AFFICHER_PAUSE(GuinoInterrupteurvirtuel);");

return "GUINO_GERER_PAUSE(GuinoInterrupteurvirtuel);" ;

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public void actionPerformed(ActionEvent e)
translator.setGuinoProgram(true);

}
if ((block.getGenusName().equals("DuinoEDU_Guino_Title")) || (block.getGenusName().equals("DuinoEDU_Guino_Slider")) || (block.getGenusName().equals("DuinoEDU_Guino_column")) || (block.getGenusName().equals("DuinoEDU_Guino_switch")) )
if ((block.getGenusName().equals("DuinoEDU_Guino_Title")) || (block.getGenusName().equals("DuinoEDU_Guino_Slider")) || (block.getGenusName().equals("DuinoEDU_Guino_column")) || (block.getGenusName().equals("DuinoEDU_Guino_switch"))|| (block.getGenusName().equals("DuinoEDU_Guino_pause")) )
{
translator.setGuinoProgram(true);

Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/com/ardublock/block/ardublock.properties
Original file line number Diff line number Diff line change
Expand Up @@ -939,6 +939,8 @@ bg.DuinoEDU_Guino_column=Guino add column
bg.DuinoEDU_Guino_column.description=add a column in Guino
bg.DuinoEDU_Guino_switch=Guino Switch
bg.DuinoEDU_Guino_switch.description=add a Switch in Guino
bg.DuinoEDU_Guino_pause=
bg.DuinoEDU_Guino_pause.description=Pause

bc.DuinoEDU_Brightness=Brightness
bc.DuinoEDU_Display=Display
Expand Down
11 changes: 11 additions & 0 deletions src/main/resources/com/ardublock/block/ardublock.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5648,6 +5648,16 @@
</description>

</BlockGenus>
<BlockGenus name="DuinoEDU_Guino_pause" kind="command" color="0 255 0" initlabel="bg.DuinoEDU_Guino_pause">
<description>
<text>Guino column</text>
</description>
<Images>
<Image>
<FileLocation>com/ardublock/block/seeedstudio/Guino_Pause.png</FileLocation>
</Image>
</Images>
</BlockGenus>
<BlockGenus name="DuinoEDU_Guino_Read" kind="command" color="0 255 0" initlabel="bg.DuinoEDU_Guino_Read">
<description>
<text>Guino Read</text>
Expand Down Expand Up @@ -8942,6 +8952,7 @@
<BlockGenusMember>DuinoEDU_Guino_Read</BlockGenusMember>
<BlockGenusMember>DuinoEDU_Guino_Slider</BlockGenusMember>
<BlockGenusMember>DuinoEDU_Guino_switch</BlockGenusMember>
<BlockGenusMember>DuinoEDU_Guino_pause</BlockGenusMember>
<BlockGenusMember>DuinoEDU_Guino_Title</BlockGenusMember>
<BlockGenusMember>DuinoEDU_Guino_column</BlockGenusMember>
</BlockDrawer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,7 @@ DuinoEDU_Guino_Title=com.ardublock.translator.block.Duinoedu.Guino_Title
DuinoEDU_Guino_Slider=com.ardublock.translator.block.Duinoedu.Guino_Slider
DuinoEDU_Guino_column=com.ardublock.translator.block.Duinoedu.Guino_Column
DuinoEDU_Guino_switch=com.ardublock.translator.block.Duinoedu.Guino_Switch
DuinoEDU_Guino_pause=com.ardublock.translator.block.Duinoedu.Guino_Pause
#Panda
panda_i0=com.ardublock.translator.block.panda.PandaInputPortBlock
panda_i1=com.ardublock.translator.block.panda.PandaInputPortBlock
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit fc95a35

Please sign in to comment.