Package com.ardublock.translator.block.exception

Examples of com.ardublock.translator.block.exception.BlockException


  public String toCode() throws SocketNullException, SubroutineNotDeclaredException
  {

    TranslatorBlock tb = this.getRequiredTranslatorBlockAtSocket(0);
    if (!(tb instanceof VariableNumberBlock || tb instanceof VariableNumberUnsignedLongBlock || tb instanceof VariableNumberDoubleBlock)) {
      throw new BlockException(blockId, uiMessageBundle.getString("ardublock.error_msg.number_var_slot"));
    }

    String varName = tb.toCode();
   
    tb = this.getRequiredTranslatorBlockAtSocket(1);
View Full Code Here


  @Override
  public String toCode() throws SocketNullException, SubroutineNotDeclaredException
  {
    TranslatorBlock tb = this.getRequiredTranslatorBlockAtSocket(0);
    if (!(tb instanceof VariableDigitalBlock)) {
      throw new BlockException(blockId, uiMessageBundle.getString("ardublock.error_msg.digital_var_slot"));
    }
   
    String ret = tb.toCode();
    tb = this.getRequiredTranslatorBlockAtSocket(1);
    ret = ret + " = " + tb.toCode() + " ;\n";
View Full Code Here

  @Override
  public String toCode() throws SocketNullException, SubroutineNotDeclaredException
  {
    TranslatorBlock name = this.getRequiredTranslatorBlockAtSocket(0);
    if (!(name instanceof VariableFakeBlock)) {
          throw new BlockException(blockId, uiMessageBundle.getString("ardublock.error_msg.array_var_slot"));
        }
    TranslatorBlock position = this.getRequiredTranslatorBlockAtSocket(1);
    TranslatorBlock value = this.getRequiredTranslatorBlockAtSocket(2);
    String ret = name.toCode()+"["+position.toCode()+" - 1]";
    ret = ret + " = " + value.toCode() + " ;\n";
View Full Code Here

        ret = ret + ")";
        return codePrefix + ret + codeSuffix;
      }
      else
      {
        throw new BlockException(blockId, "analog pin# must be a number");
      }
    }
  }
View Full Code Here

    String servoSpecs = ",530,2600";

    if (!( tb instanceof NumberBlock ) )
    {
      throw new BlockException(this.blockId, "the Pin# of Servo must be a number");
    }

    String pinNumber = tb.toCode();
    String servoName = "servo_pin_" + pinNumber;
View Full Code Here

  public String toCode() throws SocketNullException, SubroutineNotDeclaredException
  {
    TranslatorBlock translatorBlock = this.getRequiredTranslatorBlockAtSocket(0);
    if (!(translatorBlock instanceof NumberBlock))
    {
      throw new BlockException(this.blockId, "the Pin# of dht11 must a number");
    }
   
   
    NumberBlock pinNumberBlock = (NumberBlock)translatorBlock;
    String pinNumber = pinNumberBlock.toCode();
View Full Code Here

    String servoSpecs = "";

    if (!( tb instanceof NumberBlock ) )
    {
      throw new BlockException(this.blockId, "the Pin# of Servo must be a number");
    }
   
    String pinNumber = tb.toCode();
    String servoName = "servo_pin_" + pinNumber;
View Full Code Here

  public String toCode() throws SocketNullException, SubroutineNotDeclaredException
  {
    TranslatorBlock translatorBlock = this.getRequiredTranslatorBlockAtSocket(0);
    if (!(translatorBlock instanceof NumberBlock))
    {
      throw new BlockException(this.blockId, "the Pin# of dht11 must a number");
    }
   
   
    NumberBlock pinNumberBlock = (NumberBlock)translatorBlock;
    String pinNumber = pinNumberBlock.toCode();
View Full Code Here

  @Override
  public String toCode() throws SocketNullException, SubroutineNotDeclaredException
  {
    TranslatorBlock tb = this.getRequiredTranslatorBlockAtSocket(0);
    if (!(tb instanceof VariableNumberUnsignedLongBlock)) {
      throw new BlockException(blockId, uiMessageBundle.getString("ardublock.error_msg.long_number_var_slot"));
    }
   
    String ret = tb.toCode();
    tb = this.getRequiredTranslatorBlockAtSocket(1);
    ret = ret + " = " + tb.toCode() + " ;\n";
View Full Code Here

  @Override
  public String toCode() throws SocketNullException, SubroutineNotDeclaredException
  {
    TranslatorBlock tb = this.getRequiredTranslatorBlockAtSocket(0);
    if (!(tb instanceof VariableNumberBlock)) {
      throw new BlockException(blockId, uiMessageBundle.getString("ardublock.error_msg.number_var_slot"));
    }
   
    String ret = tb.toCode();
    tb = this.getRequiredTranslatorBlockAtSocket(1);
    ret = ret + " = " + tb.toCode() + " ;\n";
View Full Code Here

TOP

Related Classes of com.ardublock.translator.block.exception.BlockException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.