Ejemplo n.º 1
0
        static void Open1(int id)
        {
            Led led = list[id];

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

            try
            {
                LedCommon.DEVICEPARAM param = new LedCommon.DEVICEPARAM();

                param.devType = (uint)LedCommon.eDevType.DEV_UDP;
                param.locPort = (uint)(LocPort + id);
                param.rmtPort = (uint)6666;

                led.dev   = LedCommon.DLL_LED_Open(ref param, LedCommon.NOTIFY_EVENT, 0, 0);
                led.state = 1;
            }
            catch (Exception e)
            {
                throw new Exception("LedOpen(" + id.ToString() + ") Error:" + e.Message);
            }
        }
Ejemplo n.º 2
0
        static void SendToScreen1()
        {
            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:
                    Close1(i);
                    continue;

                case 11:
                    Open1(i);
                    break;
                }

                LedCommon.DLL_MakeRoot((int)LedCommon.eRootType.ROOT_PLAY, (int)LedCommon.eScreenType.SCREEN_COLOR);
                LedCommon.DLL_AddLeaf(1000);

                LedCommon.RECT r;
                r.left   = 0;
                r.top    = 0;
                r.right  = 256;
                r.bottom = 256;

                int dc = led.mdc.ToInt32();

                LedCommon.DLL_AddWindow(dc, 256, 256, ref r, 1, 8, 1);

                try
                {
                    LedCommon.DLL_LED_SendToScreen(led.dev, led.Addr, led.IP, (ushort)6666);
                }
                catch (Exception e)
                {
                    FUNC.Sleep(100);
                    Close1(i);

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

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

                FUNC.Sleep(20);
            }
        }
Ejemplo n.º 3
0
        static void Close1(int id)
        {
            if (list[id].state == 0)
            {
                return;
            }

            try
            {
                LedCommon.DLL_LED_Close(list[id].dev);
                list[id].state = 0;
            }
            catch (Exception e)
            {
                throw new Exception("LedClose(" + id.ToString() + ") Error:" + e.Message);
            }
        }