Пример #1
0
        public static RecvMessage 設定状態確認NG電文(int channel, NG理由 reason)
        {
            RecvMessage message = new RecvMessage();

            message.SetChannel(channel);
            message.body = new char[] { 'N' }.Concat(reason.ToCharArray()).ToArray();
            message.CalcChecksum();
            return(message);
        }
Пример #2
0
        public static RecvMessage 調光データ設定電文(int channel, bool isOK, NG理由 reason)
        {
            RecvMessage message = new RecvMessage();

            message.SetChannel(channel);
            message.body = isOK
                ? new char[] { 'O' }
                : new char[] { 'N' }.Concat(reason.ToCharArray()).ToArray();
            message.CalcChecksum();
            return(message);
        }
Пример #3
0
        public static RecvMessage 状態確認OK電文(int channel, bool isState)
        {
            RecvMessage message = new RecvMessage();

            message.SetChannel(channel);
            char[] state;
            if (isState)
            {
                state = new char[] { '0', '0' };
            }
            else
            {
                state = new char[] { '1', '1' };
            }
            message.body = new char[] { 'O' }.Concat(state).ToArray();
            message.CalcChecksum();
            return(message);
        }
Пример #4
0
        public static RecvMessage 設定状態確認OK電文(int channel, byte 調光データ, ストロボ val, bool isActive)
        {
            RecvMessage message = new RecvMessage();

            message.SetChannel(channel);
            StringBuilder sb = new StringBuilder();

            sb.Append('O')
            .Append('F')
            .Append(String.Format("{0:D3}", 調光データ))
            .Append(".S")
            .Append(String.Format("{0:D2}", val))
            .Append(".L")
            .Append(isActive ? '1' : '0')
            ;
            message.body = sb.ToString().ToCharArray();
            message.CalcChecksum();
            return(message);
        }