public override void execute(DigitalOutCommand command)
 {
     try
     {
     proxy.execute(command);
     }
      catch (DigitalOutCommandException e)
     {
     // todo: allow this to propogate to the caller
     Console.Error.WriteLine("ERROR: Exception while excecuting a command: {0}", e.reason);
     }
 }
Esempio n. 2
0
 public override void execute(DigitalOutCommand command)
 {
     try
     {
         proxy.execute(command);
     }
     catch (DigitalOutCommandException e)
     {
         // todo: allow this to propogate to the caller
         Console.Error.WriteLine("ERROR: Exception while excecuting a command: {0}", e.reason);
     }
 }
        public IEnumerator <ITask> SetDigitalOutHandler(SetDigitalOut update)
        {
            if (trace)
            {
                LogInfo("SetDigitalOut Received");
            }
            if (this.qwerkController != null)
            {
                try
                {
                    TeRK.DigitalOutCommand dcommand = new DigitalOutCommand();

                    dcommand.digitalOutMask   = new bool[8];
                    dcommand.digitalOutValues = new bool[8];

                    for (int i = 0; i < 8; i++)
                    {
                        dcommand.digitalOutMask[i]   = (update.Body.DigitalOutArray[i] != null);
                        dcommand.digitalOutValues[i] = (update.Body.DigitalOutArray[i] == null) ? false : (bool)update.Body.DigitalOutArray[i];
                    }

                    if (detailedTrace)
                    {
                        LogInfo("Calling execute() on DigitalIOService with this DigitalOutCommand");
                        LogInfo("   Mask:          " + ArrayUtils.arrayToString(dcommand.digitalOutMask));
                        LogInfo("   Values:    " + ArrayUtils.arrayToString(dcommand.digitalOutValues));
                    }

                    this.qwerkController.getDigitalIOService().execute(dcommand);
                    update.ResponsePort.Post(DefaultUpdateResponseType.Instance);
                }
                catch (Exception x)
                {
                    update.ResponsePort.Post(generateFault(x.ToString()));
                }
            }
            else
            {
                update.ResponsePort.Post(generateFault("Not connected to Qwerk"));
            }
            yield break;
        }
 /** Execute the given DigitalOutCommand. */
 public abstract void execute(DigitalOutCommand command);
 /** Execute the given DigitalOutCommand. */
 public abstract void execute(DigitalOutCommand command);