/// <summary>
 /// Default ctor
 /// </summary>
 public Clock4StageOutputItem(IClock4StageOutput entity, IClock4StageOutputState state, ItemContext context, bool interactive)
     : base(entity, false, context)
 {
     this.state = state;
     if (interactive)
     {
         MouseHandler = new EntityClickHandler(null, state);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Send the pattern of a 4-stage clock output.
        /// </summary>
        protected override void OnSendClock4StageOutput(IClock4StageOutputState output)
        {
            Log.Trace("OnSendClock4StageOutput: {0}", output.Address);
            var period  = output.Period.Requested;
            var pattern = output.Pattern.Requested;

            foreach (var address in output.Addresses)
            {
                // Send 1 address bit
                var bit = ((pattern & 0x01) != 0) ? SwitchDirection.Straight : SwitchDirection.Off;
                SendSwitchRequest(address, bit, false);
                pattern >>= 1;
            }
            output.Pattern.Actual = pattern;
            output.Period.Actual  = period;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Send the pattern of a 4-stage clock output.
        /// </summary>
        protected override void OnSendClock4StageOutput(IClock4StageOutputState output)
        {
            Log.Trace("OnSendClock4StageOutput: {0}", output);

            var msg = new ClockMessage()
            {
                Sender = sender,
                Mode   = MessageBase.ModeActual,
                Period = output.Period.Requested.ToString().ToLower()
            };

            publishMessage(msg.Topic, msg, (e) =>
            {
                if (e.IsPublished)
                {
                    output.Period.Actual = output.Period.Actual;
                }
            });
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Send the pattern of a 4-stage clock output.
 /// </summary>
 protected override void OnSendClock4StageOutput(IClock4StageOutputState output)
 {
     Log.Trace("OnSendClock4StageOutput: {0}", output);
     output.Pattern.Actual = output.Pattern.Requested;
     output.Period.Actual  = output.Period.Requested;
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Send the pattern of a 4-stage clock output.
 /// </summary>
 protected virtual void OnSendClock4StageOutput(IClock4StageOutputState output)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Send the pattern of a 4-stage clock output.
 /// </summary>
 public void SendClock4StageOutput(IClock4StageOutputState output)
 {
     PostWorkerAction(() => OnSendClock4StageOutput(output));
 }