Exemple #1
0
        internal bool Add(int CardNum)
        {
            try
            {
                int key = CardNum;

                if (!Leds.ContainsKey(key))
                {
                    if (LED2008.User_OpenScreen(CardNum))
                    {
                        Leds.Add(key, "OPEN");
                    }
                }
                else
                {
                    if (Leds[key] != "OPEN")
                    {
                        if (LED2008.User_OpenScreen(CardNum))
                        {
                            Leds[key] = "OPEN";
                        }
                    }
                }


                return(Leds.ContainsKey(key) ? Leds[key] == "OPEN" : false);
            }
            catch (Exception ex)
            {
            }
            return(false);
        }
Exemple #2
0
        public void AddSingleTextToProgram(int CardNum, int iX, int iY, int iHeight, int iWidth, string strContent, int colorFont, bool isMove)
        {
            AddProgram(CardNum);

            User_SingleText SingleText = new User_SingleText();

            SingleText.BkColor                  = 0;
            SingleText.chContent                = strContent;
            SingleText.PartInfo.iFrameMode      = 0;
            SingleText.PartInfo.iHeight         = iHeight;
            SingleText.PartInfo.iWidth          = iWidth;
            SingleText.PartInfo.iX              = iX;
            SingleText.PartInfo.iY              = iY;
            SingleText.FontInfo.bFontBold       = false;
            SingleText.FontInfo.bFontItaic      = false;
            SingleText.FontInfo.bFontUnderline  = false;
            SingleText.FontInfo.colorFont       = colorFont;
            SingleText.FontInfo.iFontSize       = 12;
            SingleText.PartInfo.FrameColor      = colorFont;
            SingleText.FontInfo.strFontName     = "宋体";
            SingleText.MoveSet.bClear           = false;
            SingleText.MoveSet.iActionSpeed     = 0;
            SingleText.MoveSet.iActionType      = 1;
            SingleText.MoveSet.iHoldTime        = 50;
            SingleText.MoveSet.iClearActionType = 1;
            SingleText.MoveSet.iClearSpeed      = 0;
            SingleText.MoveSet.iFrameTime       = 30;

            if (Programs.ContainsKey(CardNum))
            {
                int m_iProgramIndex = (int)Programs[CardNum];
                LED2008.User_AddSingleText(CardNum, ref SingleText, m_iProgramIndex);
            }
        }
Exemple #3
0
 public void DelProgram(int CardNum)
 {
     if (Programs.ContainsKey(CardNum))
     {
         Programs.Remove(CardNum);
         LED2008.User_DelAllProgram(CardNum);
     }
 }
Exemple #4
0
 private void AddProgram(int CardNum)
 {
     if (Add(CardNum))
     {
         if (!Programs.ContainsKey(CardNum))
         {
             int programIndex = LED2008.User_AddProgram(CardNum, false, 10);
             Programs.Add(CardNum, programIndex);
         }
     }
 }
Exemple #5
0
 public void Release()
 {
     foreach (int CardNum in Leds.Keys)
     {
         if (Leds[CardNum] == "OPEN")
         {
             LED2008.User_CloseScreen(CardNum);
         }
     }
     Leds.Clear();
 }
Exemple #6
0
 public void DelAllProgram()
 {
     foreach (int CardNum in Leds.Keys)
     {
         if (Programs.ContainsKey(CardNum))
         {
             Programs.Remove(CardNum);
             LED2008.User_DelAllProgram(CardNum);
         }
     }
 }
Exemple #7
0
 public void SendToScreen()
 {
     foreach (int CardNum in Leds.Keys)
     {
         if (Programs.ContainsKey(CardNum) && Leds.ContainsKey(CardNum) ? Leds[CardNum] == "OPEN" : false)
         {
             if (!LED2008.User_SendToScreen(CardNum))
             {
                 System.Threading.Thread.Sleep(500);
                 LED2008.User_SendToScreen(CardNum);
             }
         }
     }
 }
Exemple #8
0
 public void SendToScreen(int CardNum)
 {
     try
     {
         if (Programs.ContainsKey(CardNum) && Leds.ContainsKey(CardNum) ? Leds[CardNum] == "OPEN" : false)
         {
             if (!LED2008.User_SendToScreen(CardNum))
             {
                 System.Threading.Thread.Sleep(500);
                 LED2008.User_SendToScreen(CardNum);
             }
         }
     }
     catch (Exception ex)
     {
     }
 }
Exemple #9
0
        public void AddTextToProgram(int CardNum, int iX, int iY, int iHeight, int iWidth, string strContent, int colorFont, bool isMove)
        {
            AddProgram(CardNum);

            User_Text Text = new User_Text();

            Text.BkColor   = 0;
            Text.chContent = strContent;

            Text.PartInfo.FrameColor = 0xFF00; // 0;
            Text.PartInfo.iFrameMode = 1;      // 0;
            Text.PartInfo.iHeight    = iHeight;
            Text.PartInfo.iWidth     = iWidth;
            Text.PartInfo.iX         = iX;
            Text.PartInfo.iY         = iY;

            Text.FontInfo.bFontBold      = false;
            Text.FontInfo.bFontItaic     = false;
            Text.FontInfo.bFontUnderline = false;
            Text.FontInfo.colorFont      = colorFont;
            Text.FontInfo.iFontSize      = 12;
            Text.FontInfo.strFontName    = "宋体";
            Text.FontInfo.iAlignStyle    = 0;
            Text.FontInfo.iVAlignerStyle = 0;
            Text.FontInfo.iRowSpace      = 0;

            Text.MoveSet.bClear       = false;
            Text.MoveSet.iActionSpeed = 5; // 0;
            Text.MoveSet.iActionType  = 0; // 20;
            Text.MoveSet.iHoldTime    = 50;

            Text.MoveSet.iClearActionType = 0;
            Text.MoveSet.iClearSpeed      = 4;
            Text.MoveSet.iFrameTime       = 20;

            if (!isMove)
            {
                Text.MoveSet.iHoldTime = -1;
            }

            if (Programs.ContainsKey(CardNum))
            {
                int m_iProgramIndex = (int)Programs[CardNum];
                LED2008.User_AddText(CardNum, ref Text, m_iProgramIndex);
            }
        }
Exemple #10
0
        internal bool Remove(int CardNum)
        {
            int key = CardNum;

            if (Leds.ContainsKey(key))
            {
                if (Leds[key] == "OPEN")
                {
                    if (LED2008.User_CloseScreen(CardNum))
                    {
                        Leds[key] = "CLOSE";
                    }
                }
                return(Leds[key] == "CLOSE");
            }
            else
            {
                return(true);
            }
        }
Exemple #11
0
        public void AddImageToProgram(int CardNum, int iX, int iY, int iHeight, int iWidth, Bitmap bitmap)
        {
            if (Add(CardNum))
            {
                AddProgram(CardNum);
                int m_iProgramIndex = -1;
                int BmpZoneIndex    = -1;

                //准备新的图片区
                User_PartInfo partinfo = new User_PartInfo();
                partinfo.iX         = iX;
                partinfo.iY         = iY;
                partinfo.iHeight    = iHeight;
                partinfo.iWidth     = iWidth;
                partinfo.iFrameMode = 0;

                User_Bmp bmp = new User_Bmp();
                bmp.PartInfo = partinfo;

                //准备移动方式
                User_MoveSet moveset = new User_MoveSet();
                moveset.iActionType      = 20;
                moveset.iActionSpeed     = 30;
                moveset.bClear           = false;
                moveset.iHoldTime        = 30;
                moveset.iClearSpeed      = 10;
                moveset.iClearActionType = 20;

                //添加新图片
                if (Programs.ContainsKey(CardNum))
                {
                    m_iProgramIndex = (int)Programs[CardNum];
                    BmpZoneIndex    = LED2008.User_AddBmpZone(CardNum, ref bmp, m_iProgramIndex);

                    HandleRef hr      = new HandleRef(bitmap, bitmap.GetHicon());
                    IntPtr    hBitmap = bitmap.GetHbitmap();
                    LED2008.User_AddBmp(CardNum, BmpZoneIndex, hBitmap, ref moveset, m_iProgramIndex);
                }
            }
        }