Пример #1
0
        public static void updata_tests(int id, int x, int y, int w, int h, string text)
        {
            int    err          = 0;
            byte   uAreaId      = (byte)id;
            byte   RunMode      = 0;
            ushort Timeout      = 10;
            byte   RelateAllPro = 1;
            ushort RelateProNum = 0;

            ushort[] RelateProSerial = null;
            byte     ImmePlay        = 1;
            ushort   uAreaX          = (ushort)x;
            ushort   uAreaY          = (ushort)y;
            ushort   uWidth          = (ushort)w;
            ushort   uHeight         = (ushort)h;

            bxdualsdk.EQareaframeHeader oFrame;
            oFrame.AreaFFlag      = 0;
            oFrame.AreaFDispStyle = 0;
            oFrame.AreaFDispSpeed = 0;
            oFrame.AreaFMoveStep  = 0;
            oFrame.AreaFWidth     = 0;
            oFrame.AreaFBackup    = 0;
            bxdualsdk.DynamicAreaBaseInfo_5G pheader = new bxdualsdk.DynamicAreaBaseInfo_5G();
            pheader.nType            = 0x01;
            pheader.DisplayMode      = 4;
            pheader.ClearMode        = 0x00;
            pheader.Speed            = 10;
            pheader.StayTime         = 100;
            pheader.RepeatTime       = 0;
            pheader.oFont.arrMode    = bxdualsdk.E_arrMode.eMULTILINE;
            pheader.oFont.fontSize   = 10;
            pheader.oFont.color      = 1;
            pheader.oFont.fontBold   = 0;
            pheader.oFont.fontItalic = 0;
            pheader.oFont.tdirection = bxdualsdk.E_txtDirection.pNORMAL;
            pheader.oFont.txtSpace   = 0;
            pheader.oFont.Halign     = 1;
            pheader.oFont.Valign     = 2;
            byte[] Font = Encoding.GetEncoding("GBK").GetBytes("宋体");
            pheader.fontName = Class1.BytesToIntptr(Font);
            byte[] str = Encoding.GetEncoding("GBK").GetBytes($"{text}\0");
            pheader.strAreaTxtContent = Class1.BytesToIntptr(str);
            //byte[] img = Encoding.GetEncoding("GBK").GetBytes("123.png\0");
            //pheader.filePath = Class1.BytesToIntptr(img);
            List <bxdualsdk.DynamicAreaBaseInfo_5G> Params = new List <bxdualsdk.DynamicAreaBaseInfo_5G>();

            Params.Add(pheader);
            bxdualsdk.DynamicAreaBaseInfo_5G[] Pas = new bxdualsdk.DynamicAreaBaseInfo_5G[1];
            Pas[0] = pheader;

            bxdualsdk.bxDual_dynamicArea_SetDualPixel(bxdualsdk.E_DoubleColorPixel_G56.eDOUBLE_COLOR_PIXTYPE_2);
            err = bxdualsdk.bxDual_dynamicArea_AddAreaInfos_5G_Point(Program.ip, Program.port, bxdualsdk.E_ScreenColor_G56.eSCREEN_COLOR_DOUBLE, uAreaId, 0, 10, 1, 0, RelateProSerial,
                                                                     0, uAreaX, uAreaY, uWidth, uHeight, oFrame, 1, Pas);

            Console.WriteLine("bxDual_dynamicArea_AddAreaInfos_5G_Point = " + err);
        }
Пример #2
0
        /// <summary>
        /// 一次向一个动态区发送/更新多条信息(文字或图片)及语音
        /// </summary>
        public static void dynamicArea_pages_1()
        {
            int    err         = 0;
            byte   DisplayMode = 2;
            byte   Speed       = 1;
            ushort StayTime    = 100;
            byte   RepeatTime  = 0;

            bxdualsdk.E_arrMode arrMode = 0;
            ushort fontSize             = 10;
            uint   color      = 1;
            byte   fontBold   = 0;
            byte   fontItalic = 0;

            bxdualsdk.E_txtDirection tdirection = 0;
            ushort txtSpace = 0;
            byte   Valign   = 1;
            byte   Halign   = 1;

            bxdualsdk.EQSound_6G stSoundData = new bxdualsdk.EQSound_6G();
            stSoundData.SoundFlag            = 0;
            stSoundData.SoundPerson          = 0;
            stSoundData.SoundVolum           = 0;
            stSoundData.SoundSpeed           = 0;
            stSoundData.SoundDataMode        = 0;
            stSoundData.SoundReplayTimes     = 0;
            stSoundData.SoundReplayDelay     = 0;
            stSoundData.SoundReservedParaLen = 0;
            stSoundData.Soundnumdeal         = 0;
            stSoundData.Soundlanguages       = 0;
            stSoundData.Soundwordstyle       = 0;
            stSoundData.SoundDataLen         = 0;
            stSoundData.SoundData            = IntPtr.Zero;

            bxdualsdk.BxAreaFrmae_Dynamic_G6 Frame;
            bxdualsdk.EQscreenframeHeader_G6 oFrame;                              //暂时不支持
            Frame.AreaFFlag           = 0;
            oFrame.FrameDispStype     = 0x03;                                     //边框显示方式0x00 –闪烁 0x01 –顺时针转动 0x02 –逆时针转动 0x03 –闪烁加顺时针转动 0x04 –闪烁加逆时针转动 0x05 –红绿交替闪烁 0x06 –红绿交替转动 0x07 –静止打出
            oFrame.FrameDispSpeed     = 0x10;                                     //边框显示速度
            oFrame.FrameMoveStep      = 0x01;                                     //边框移动步长,单位为点,此参 数范围为 1~16
            oFrame.FrameUnitLength    = 2;                                        //边框组元长度
            oFrame.FrameUnitWidth     = 2;                                        //边框组元宽度
            oFrame.FrameDirectDispBit = 0;                                        //上下左右边框显示标志位,目前只支持6QX-M卡
            Frame.oAreaFrame          = oFrame;
            Frame.pStrFramePathFile   = Encoding.Default.GetBytes("F:\\黄10.png"); //Class1.BytesToIntptr(Encoding.Default.GetBytes("F:\\黄10.png"));

            bxdualsdk.DynamicAreaBaseInfo_5G pheader = new bxdualsdk.DynamicAreaBaseInfo_5G();
            pheader.nType            = 0x01;
            pheader.DisplayMode      = DisplayMode;
            pheader.ClearMode        = 0x01;
            pheader.Speed            = Speed;
            pheader.StayTime         = StayTime;
            pheader.RepeatTime       = RepeatTime;
            pheader.oFont.arrMode    = arrMode;
            pheader.oFont.fontSize   = fontSize;
            pheader.oFont.color      = color;
            pheader.oFont.fontBold   = fontBold;
            pheader.oFont.fontItalic = fontItalic;
            pheader.oFont.tdirection = tdirection;
            pheader.oFont.txtSpace   = txtSpace;
            pheader.oFont.Valign     = Valign;
            pheader.oFont.Halign     = Halign;
            byte[] Font = Encoding.GetEncoding("GBK").GetBytes("宋体");
            pheader.fontName = Marshal.AllocHGlobal(Font.Length);
            Marshal.Copy(Font, 0, pheader.fontName, Font.Length);
            byte[] str = Encoding.GetEncoding("GBK").GetBytes("111111\0");
            pheader.strAreaTxtContent = Marshal.AllocHGlobal(str.Length);
            Marshal.Copy(str, 0, pheader.strAreaTxtContent, str.Length);
            byte[] img = Encoding.GetEncoding("GBK").GetBytes("123.png\0");
            pheader.filePath = Marshal.AllocHGlobal(img.Length);
            Marshal.Copy(img, 0, pheader.filePath, img.Length);
            bxdualsdk.DynamicAreaBaseInfo_5G pheader1 = new bxdualsdk.DynamicAreaBaseInfo_5G();
            pheader1.nType            = 0x02;
            pheader1.DisplayMode      = DisplayMode;
            pheader1.ClearMode        = 0x01;
            pheader1.Speed            = Speed;
            pheader1.StayTime         = StayTime;
            pheader1.RepeatTime       = RepeatTime;
            pheader1.oFont.arrMode    = arrMode;
            pheader1.oFont.fontSize   = fontSize;
            pheader1.oFont.color      = color;
            pheader1.oFont.fontBold   = fontBold;
            pheader1.oFont.fontItalic = fontItalic;
            pheader1.oFont.tdirection = tdirection;
            pheader1.oFont.txtSpace   = txtSpace;
            pheader1.oFont.Valign     = Valign;
            pheader1.oFont.Halign     = Halign;
            pheader.fontName          = Marshal.AllocHGlobal(Font.Length);
            Marshal.Copy(Font, 0, pheader.fontName, Font.Length);
            byte[] str1 = Encoding.GetEncoding("GBK").GetBytes("111111\0");
            pheader.strAreaTxtContent = Marshal.AllocHGlobal(str1.Length);
            Marshal.Copy(str1, 0, pheader.strAreaTxtContent, str1.Length);
            byte[] img1 = Encoding.GetEncoding("GBK").GetBytes("123.png\0");
            pheader.filePath = Marshal.AllocHGlobal(img1.Length);
            Marshal.Copy(img1, 0, pheader.filePath, img1.Length);
            bxdualsdk.DynamicAreaBaseInfo_5G[] Params = new bxdualsdk.DynamicAreaBaseInfo_5G[2];
            Params[0] = pheader;
            Params[1] = pheader1;
            //网口
            if (true)
            {
                err = bxdualsdk.bxDual_dynamicArea_AddAreaInfos_6G_V2(Program.ip, Program.port, bxdualsdk.E_ScreenColor_G56.eSCREEN_COLOR_THREE, AreaId, RunMode, Timeout, RelateAllPro,
                                                                      RelateProNum, RelateProSerial, ImmePlay, AreaX, AreaY, Width, Height, Frame, 1, Params, ref stSoundData);//(byte)Params.Length
            }
            //串口
            if (false)
            {
                bxdualsdk.EQareaframeHeader Frame1 = new bxdualsdk.EQareaframeHeader();
                Frame1.AreaFFlag      = 0;
                Frame1.AreaFDispStyle = 0x03;
                Frame1.AreaFDispSpeed = 0x10;
                Frame1.AreaFMoveStep  = 0x01;
                Frame1.AreaFWidth     = 2;
                Frame1.AreaFBackup    = 0;
                err = bxdualsdk.bxDual_dynamicArea_AddAreaInfos_6G_V2_Serial(Program.com, Program.baudRate, bxdualsdk.E_ScreenColor_G56.eSCREEN_COLOR_DOUBLE, AreaId, RunMode, Timeout, RelateAllPro,
                                                                             RelateProNum, RelateProSerial, ImmePlay, AreaX, AreaY, Width, Height, Frame1, (byte)Params.Length, Params);
            }
            Console.WriteLine("bxDual_dynamicArea_AddAreaInfos_6G_V2 = " + err);
        }
Пример #3
0
        /// <summary>
        /// 一次向一个动态区发送/更新多条信息(文字或图片)及语音
        /// 该接口有问题,不建议使用
        /// </summary>
        public static void dynamicArea_pages()
        {
            int    err              = 0;
            byte   DisplayMode      = 2;
            byte   Speed            = 1;
            ushort StayTime         = 100;
            byte   RepeatTime       = 0;
            ushort ValidLen         = 0;
            byte   CartoonFrameRate = 0;

            bxdualsdk.E_arrMode arrMode = 0;
            ushort fontSize             = 10;
            uint   color      = 1;
            byte   fontBold   = 0;
            byte   fontItalic = 0;

            bxdualsdk.E_txtDirection tdirection = 0;
            ushort txtSpace = 0;
            byte   Valign   = 2;
            byte   Halign   = 2;

            bxdualsdk.EQSound_6G stSoundData = new bxdualsdk.EQSound_6G();
            stSoundData.SoundFlag            = 0;
            stSoundData.SoundPerson          = 0;
            stSoundData.SoundVolum           = 0;
            stSoundData.SoundSpeed           = 0;
            stSoundData.SoundDataMode        = 0;
            stSoundData.SoundReplayTimes     = 0;
            stSoundData.SoundReplayDelay     = 0;
            stSoundData.SoundReservedParaLen = 0;
            stSoundData.Soundnumdeal         = 0;
            stSoundData.Soundlanguages       = 0;
            stSoundData.Soundwordstyle       = 0;
            stSoundData.SoundDataLen         = 0;
            stSoundData.SoundData            = IntPtr.Zero;

            bxdualsdk.EQareaframeHeader Frame = new bxdualsdk.EQareaframeHeader();
            Frame.AreaFFlag      = 0;
            Frame.AreaFDispStyle = 0x03;
            Frame.AreaFDispSpeed = 0x10;
            Frame.AreaFMoveStep  = 0x01;
            Frame.AreaFWidth     = 2;
            Frame.AreaFBackup    = 0;
            //Frame.pStrFramePathFile = Encoding.Default.GetBytes("F:\\黄10.png");// Class1.BytesToIntptr(Encoding.Default.GetBytes("F:\\黄10.png"));

            bxdualsdk.DynamicAreaBaseInfo_5G pheader = new bxdualsdk.DynamicAreaBaseInfo_5G();
            pheader.nType            = 0x01;
            pheader.DisplayMode      = DisplayMode;
            pheader.ClearMode        = 0x01;
            pheader.Speed            = Speed;
            pheader.StayTime         = StayTime;
            pheader.RepeatTime       = RepeatTime;
            pheader.oFont.arrMode    = arrMode;
            pheader.oFont.fontSize   = fontSize;
            pheader.oFont.color      = color;
            pheader.oFont.fontBold   = fontBold;
            pheader.oFont.fontItalic = fontItalic;
            pheader.oFont.tdirection = tdirection;
            pheader.oFont.txtSpace   = txtSpace;
            pheader.oFont.Valign     = Valign;
            pheader.oFont.Halign     = Halign;
            byte[] Font = Encoding.GetEncoding("GBK").GetBytes("宋体");
            pheader.fontName = Marshal.AllocHGlobal(Font.Length);
            Marshal.Copy(Font, 0, pheader.fontName, Font.Length);
            byte[] str = Encoding.GetEncoding("GBK").GetBytes("111111\0");
            pheader.strAreaTxtContent = Marshal.AllocHGlobal(str.Length);
            Marshal.Copy(str, 0, pheader.strAreaTxtContent, str.Length);
            byte[] img = Encoding.GetEncoding("GBK").GetBytes("123.png\0");
            pheader.filePath = Marshal.AllocHGlobal(img.Length);
            Marshal.Copy(img, 0, pheader.filePath, img.Length);
            bxdualsdk.DynamicAreaBaseInfo_5G[] Params = new bxdualsdk.DynamicAreaBaseInfo_5G[1];
            Params[0] = pheader;
            //网口
            if (true)
            {
                //动态区优先播放,节目停止播放
                err = bxdualsdk.bxDual_dynamicArea_AddAreaInfos_6G(Program.ip, Program.port, bxdualsdk.E_ScreenColor_G56.eSCREEN_COLOR_DOUBLE, AreaId, RunMode, Timeout, RelateAllPro,
                                                                   RelateProNum, RelateProSerial, ImmePlay, AreaX, AreaY, Width, Height, Frame, (byte)Params.Length, ref Params);
            }
            //串口
            if (false)
            {
                //动态区优先播放,节目停止播放
                err = bxdualsdk.bxDual_dynamicArea_AddAreaInfos_G6_Serial(Program.com, Program.baudRate, bxdualsdk.E_ScreenColor_G56.eSCREEN_COLOR_DOUBLE, AreaId, RunMode, Timeout, RelateAllPro,
                                                                          RelateProNum, RelateProSerial, ImmePlay, AreaX, AreaY, Width, Height, Frame, (byte)Params.Length, ref Params);
            }
            Console.WriteLine("bxDual_dynamicArea_AddAreaInfos_6G_V2 = " + err);
        }
Пример #4
0
        public static void updata_dynamic_pages(string nnn)
        {
            int    err          = 0;
            byte   uAreaId      = 0;
            byte   RunMode      = 0;
            ushort Timeout      = 10;
            byte   RelateAllPro = 1;
            ushort RelateProNum = 0;

            ushort[] RelateProSerial = null;
            byte     ImmePlay        = 1;
            ushort   uAreaX          = 16;
            ushort   uAreaY          = 0;
            ushort   uWidth          = 64;
            ushort   uHeight         = 32;

            bxdualsdk.EQareaframeHeader oFrame;
            oFrame.AreaFFlag      = 0;
            oFrame.AreaFDispStyle = 0;
            oFrame.AreaFDispSpeed = 0;
            oFrame.AreaFMoveStep  = 0;
            oFrame.AreaFWidth     = 0;
            oFrame.AreaFBackup    = 0;
            bxdualsdk.DynamicAreaBaseInfo_5G pheader = new bxdualsdk.DynamicAreaBaseInfo_5G();
            pheader.nType            = 0x01;
            pheader.DisplayMode      = 2;
            pheader.ClearMode        = 0x01;
            pheader.Speed            = 100;
            pheader.StayTime         = 100;
            pheader.RepeatTime       = 0;
            pheader.oFont.arrMode    = bxdualsdk.E_arrMode.eMULTILINE;
            pheader.oFont.fontSize   = 10;
            pheader.oFont.color      = 1;
            pheader.oFont.fontBold   = 0;
            pheader.oFont.fontItalic = 0;
            pheader.oFont.tdirection = bxdualsdk.E_txtDirection.pNORMAL;
            pheader.oFont.txtSpace   = 0;
            pheader.oFont.Halign     = 1;
            pheader.oFont.Valign     = 2;
            byte[] Font = Encoding.GetEncoding("GBK").GetBytes("宋体");
            pheader.fontName = Class1.BytesToIntptr(Font);
            byte[] str = Encoding.GetEncoding("GBK").GetBytes($"{nnn}\0");
            pheader.strAreaTxtContent = Class1.BytesToIntptr(str);
            bxdualsdk.DynamicAreaBaseInfo_5G[] Params = new bxdualsdk.DynamicAreaBaseInfo_5G[1];
            Params[0] = pheader;

            //网口
            if (true)
            {
                //该接口调用报错
                //err = bxdualsdk.bxDual_dynamicArea_AddAreaInfos_5G(Program.ip, Program.port, bxdualsdk.E_ScreenColor_G56.eSCREEN_COLOR_DOUBLE, uAreaId, RunMode, Timeout, RelateAllPro, RelateProNum, RelateProSerial,
                //                    ImmePlay, uAreaX, uAreaY, uWidth, uHeight, oFrame, (byte)Params.Length, Params);

                err = bxdualsdk.bxDual_dynamicArea_AddAreaInfos_5G_Point(Program.ip, Program.port, bxdualsdk.E_ScreenColor_G56.eSCREEN_COLOR_DOUBLE, uAreaId, RunMode, Timeout, RelateAllPro, RelateProNum, RelateProSerial,
                                                                         ImmePlay, uAreaX, uAreaY, uWidth, uHeight, oFrame, (byte)Params.Length, Params);
            }
            //串口
            if (false)
            {
                //该接口调用报错
                err = bxdualsdk.bxDual_dynamicArea_AddAreaInfos_5G_Serial(Program.com, Program.baudRate, bxdualsdk.E_ScreenColor_G56.eSCREEN_COLOR_DOUBLE, uAreaId, RunMode, Timeout, RelateAllPro, RelateProNum, RelateProSerial,
                                                                          ImmePlay, uAreaX, uAreaY, uWidth, uHeight, oFrame, (byte)Params.Length, Params);
            }
            Console.WriteLine("bxDual_dynamicArea_AddAreaInfos_5G_Point = " + err);
        }