Ejemplo n.º 1
0
        static void SendToScreen3()
        {
            for (int i = 0; i < list.Count; i++)
            {
                Led led = list[i];

                if ((led.IP == "") || (led.IP == "0.0.0.0") || (!led.IsConnected) || (led.state == 0))
                {
                    continue;
                }

                switch (led.state)
                {
                case 10:
                    Close3(i);
                    continue;

                case 11:
                    Open3(i);
                    break;
                }


                try
                {
                    LedDll.LedSend((byte)(i + 1), led.bmp);
                }

                catch (Exception e)
                {
                    FUNC.Sleep(100);
                    Close3(i);

                    FUNC.Sleep(100);
                    Open3(i);

                    throw new Exception("SendToScreen(" + i.ToString() + ") Error:" + e.Message);
                }

                FUNC.Sleep(20);
            }
        }
Ejemplo n.º 2
0
        static void Open3(int id)
        {
            Led led = list[id];

            if ((led.IP == "") || (led.IP == "0.0.0.0") || (led.state == 1))
            {
                return;
            }

            try
            {
                if (LedDll.LedOpen((byte)(id + 1), led.IP, "6666", led.Addr, 5000))
                {
                    led.state = 1;
                }
            }
            catch (Exception e)
            {
                throw new Exception("LedOpen(" + id.ToString() + ") Error:" + e.Message);
            }
        }