Example #1
0
        public string WriteMsg()
        {
            /*UserData = "";
             * UserData += SerialNumber.ToString("X").PadLeft(4, '0');
             * UserData += SendTime.ToString("yyMMddHHmmss").PadLeft(12, '0');
             *
             * UserData += YellowLevel.ToString("X").PadLeft(4, '0');
             * UserData += OrangeLevel.ToString("X").PadLeft(4, '0');
             * UserData += RedLevel.ToString("X").PadLeft(4, '0');
             *
             * UserDataBytes = HexStringUtility.HexStringToByteArray(UserData);
             * return WriteMsgBase();*/
            UserDataAll += SerialNumber.ToString("X").PadLeft(4, '0');
            UserDataAll += SendTime.ToString("yyMMddHHmmss").PadLeft(12, '0');
            UserDataAll += YellowLevel.ToString("X").PadLeft(4, '0');
            UserDataAll += OrangeLevel.ToString("X").PadLeft(4, '0');
            UserDataAll += RedLevel.ToString("X").PadLeft(4, '0');
            byte[]             UserDataBytesAllTmp;
            WaterBaseMessage[] MsgListTmp;
            string             msg = WaterBaseMessageService.GetMsgList_WriteMsg(this, UserDataAll, out UserDataBytesAllTmp, out MsgListTmp);

            if (msg == "")
            {
                UserDataBytesAll = UserDataBytesAllTmp;
                MsgList          = MsgListTmp;
            }
            else
            {
                if (ShowLog)
                {
                    logHelper.Error(msg);
                }
            }
            return(msg);
        }
Example #2
0
        public string WriteMsg()
        {
            UserData  = "";
            UserData += SerialNumber.ToString("X").PadLeft(4, '0');
            UserData += SendTime.ToString("yyMMddHHmmss").PadLeft(12, '0');

            UserData += YellowLevel.ToString("X").PadLeft(4, '0');
            UserData += OrangeLevel.ToString("X").PadLeft(4, '0');
            UserData += RedLevel.ToString("X").PadLeft(4, '0');

            UserDataBytes = HexStringUtility.HexStringToByteArray(UserData);
            return(WriteMsgBase());
        }