示例#1
0
  {
    attributeDefinitionList.setHidden(false);

    openCondition = new ExpressionInput("OpenCondition", "Key Inputs", null);
    openCondition.setEntity(this);
    openCondition.setRequired(true);
    this.addInput(openCondition);

    pendingOpenColour = new ColourInput("PendingOpenColour", "Graphics", ColourInput.YELLOW);
    this.addInput(pendingOpenColour);
    this.addSynonym(pendingOpenColour, "PendingOpenColor");

    pendingClosedColour = new ColourInput("PendingClosedColour", "Graphics", ColourInput.PURPLE);
    this.addInput(pendingClosedColour);
    this.addSynonym(pendingClosedColour, "PendingClosedColor");

    showPendingStates = new BooleanInput("ShowPendingStates", "Graphics", true);
    this.addInput(showPendingStates);
  }
示例#2
0
 private boolean getOpenConditionValue(double simTime) {
   try {
     // Evaluate the condition (0 = false, non-zero = true)
     boolean ret =
         ExpEvaluator.evaluateExpression(openCondition.getValue(), simTime, this).value != 0;
     return ret;
   } catch (ExpError e) {
     error("%s", e.getMessage());
     return false; // never hit, error() will throw
   }
 }