コード例 #1
0
        public void SwitchLight(PD3Channel channel, bool lightSwitch)
        {
            if (!this.IsInitialized)
            {
                return;
            }
            string cmdContent = string.Format("{0:X}L{1}", channel, lightSwitch ? 1 : 0);

            sendCommand(getCombineCommand(cmdContent));
            if (channel == PD3Channel.All)
            {
                foreach (var item in this.LightInfoCollection)
                {
                    item.Value.Switch = lightSwitch;
                }
            }
            else
            {
                this.LightInfoCollection[LightChannelTranslate(channel)].Switch = lightSwitch;
            }
        }
コード例 #2
0
        public void SetLightValue(PD3Channel channel, int lightValue)
        {
            if (!this.IsInitialized)
            {
                return;
            }
            string cmdContent = string.Format("{0:X}F{1:D3}", channel, lightValue);

            sendCommand(getCombineCommand(cmdContent));
            if (channel == PD3Channel.All)
            {
                foreach (var item in this.LightInfoCollection)
                {
                    item.Value.ActionValue = lightValue;
                }
            }
            else
            {
                this.LightInfoCollection[LightChannelTranslate(channel)].ActionValue = lightValue;
            }
            //OnLightValueChanged(channel, lightValue);
        }
コード例 #3
0
        public void CheckStatus(PD3Channel channel)
        {
            string cmdContent = string.Format("{0:X}M00", channel);

            sendCommand(getCombineCommand(cmdContent));
        }
コード例 #4
0
 public int GetLightValue(PD3Channel channel)
 {
     return(this.LightInfoCollection[LightChannelTranslate(channel)].ActionValue);
 }
コード例 #5
0
 private LightChannel LightChannelTranslate(PD3Channel channel)
 {
     return((LightChannel)channel);
 }