Skip to content
Browse files

fix dfrobot bug

  • Loading branch information...
1 parent 49f2052 commit 0c273cd42f1e228d16c4e5a4191a75a37498550e heqichen committed Jun 1, 2012
View
13 src/main/java/com/ardublock/translator/block/dfrobot/DfrobotAnalogOuptutBlock.java
@@ -0,0 +1,13 @@
+package com.ardublock.translator.block.dfrobot;
+
+import com.ardublock.translator.Translator;
+import com.ardublock.translator.block.PinWriteAnalogBlock;
+
+public class DfrobotAnalogOuptutBlock extends PinWriteAnalogBlock
+{
+ public DfrobotAnalogOuptutBlock(Long blockId, Translator translator, String codePrefix, String codeSuffix, String label)
+ {
+ super(blockId, translator, codePrefix, codeSuffix, label);
+ }
+
+}
View
20 src/main/java/com/ardublock/translator/block/dfrobot/DfrobotPushButtonBlock.java
@@ -0,0 +1,20 @@
+package com.ardublock.translator.block.dfrobot;
+
+import com.ardublock.translator.Translator;
+import com.ardublock.translator.block.exception.SocketNullException;
+
+public class DfrobotPushButtonBlock extends DfrobotDigitalInoutBlock
+{
+ public DfrobotPushButtonBlock(Long blockId, Translator translator, String codePrefix, String codeSuffix, String label)
+ {
+ super(blockId, translator, codePrefix, codeSuffix, label);
+ }
+
+ @Override
+ public String toCode() throws SocketNullException
+ {
+ String code = super.toCode();
+ code = "!(" + code + ")";
+ return code;
+ }
+}
View
2 src/main/java/com/ardublock/ui/listener/GenerateCodeButtonListener.java
@@ -118,7 +118,7 @@ public void actionPerformed(ActionEvent e)
if (success)
{
- System.out.println(code);
+// System.out.println(code);
context.didGenerate(code);
//for test by HE Qichen

0 comments on commit 0c273cd

Please sign in to comment.
Something went wrong with that request. Please try again.