Esempio n. 1
0
 public KnyttTrigger(KnyttPoint trigger_pos, SwitchID id)
 {
     Pos            = trigger_pos;
     ID             = id;
     AbsoluteTarget = true;
     prefix         = "Trig";
 }
 public SwitchStatusEvent(LcDataPacket packet) : base(packet)
 {
     if (null != packet)
     {
         _sw     = (SwitchID)packet.Data[0];
         _status = SerialMessage.PackWord(packet.Data, 1);
     }
 }
Esempio n. 3
0
 public KnyttShift(KnyttPoint area_pos, KnyttPoint shift_pos, SwitchID id)
 {
     AreaPos        = area_pos;
     Pos            = shift_pos;
     ID             = id;
     AbsoluteTarget = false; // Relative by default
     AsOne          = true;
     Repeat         = true;
     prefix         = "Shift";
 }
    void ChangeSwitchActivation(Lights switchColor, SwitchID switchID, bool activationState)
    {
        if (switchColor != ColorToSwitch)
        {
            return;
        }

        if (activationState && (ActiveSwitches.IndexOf(switchID) < 0))
        {
            ActiveSwitches.Add(switchID);

            if (SwitchIDKeys.Count == ActiveSwitches.Count)
            {
                OnAllSwitchesActivated?.Invoke(ColorToSwitch);
            }
        }

        if (!activationState && (ActiveSwitches.IndexOf(switchID) >= 0))
        {
            ActiveSwitches.Remove(switchID);
            OnSwitchDiactivated?.Invoke(ColorToSwitch);
        }
    }
Esempio n. 5
0
 public KnyttTrigger(KnyttArea area, KnyttPoint shift_pos, SwitchID id) : this(shift_pos, id, area.ExtraData)
 {
 }
Esempio n. 6
0
 public KnyttTrigger(KnyttPoint trigger_pos, SwitchID id, KeyDataCollection data) : this(trigger_pos, id)
 {
     loadFromINI(data);
 }
Esempio n. 7
0
 public KnyttShift(KnyttArea area, KnyttPoint shift_pos, SwitchID id) : this(area.Position, shift_pos, id, area.ExtraData)
 {
 }
Esempio n. 8
0
 public KnyttShift(KnyttPoint area_pos, KnyttPoint shift_pos, SwitchID id, KeyDataCollection data) : this(area_pos, shift_pos, id)
 {
     loadFromINI(data);
 }
Esempio n. 9
0
 public bool IsSwitchState(SwitchID switchID)
 {
     return(switchTable[(int)switchID].IsOn);
 }
Esempio n. 10
0
 public void SwitchOff(SwitchID switchID)
 {
     switchTable[(int)switchID].IsOn = false;
 }
Esempio n. 11
0
 public void SwitchON(SwitchID switchID)
 {
     switchTable[(int)switchID].IsOn = true;
 }