示例#1
0
        private void SetColorTemp()
        {
            byte[] data = ColorTempHelper.GetData(colorTempData);;
            foreach (var item in DevIP)
            {
                int result = 0;

                result = _TLWCommand.tlw_WriteColorTempData(item.Value, 0, Id, data);
                if (result != 0)
                {
                    MessageBox.Show(this, $"IP:{item.Key} 写入寄存器参数失败");
                }
                else
                {
                    MessageBox.Show(this, $"IP:{item.Key} 写入寄存器参数成功");
                }
            }
        }
示例#2
0
 private bool ReadColorTemp()
 {
     foreach (var item in DevIP)
     {
         int result = 0;
         result = _TLWCommand.tlw_ReadColorTempData(item.Value, MBAddr, Id, out byte[] data);
         if (result != 0)
         {
             MessageBox.Show(this, "读取寄存器参数失败");
             return(false);
         }
         else
         {
             colorTempData = ColorTempHelper.GetColorTempData(data);
         }
         break;
     }
     return(true);
 }