Exemple #1
0
        public unsafe static byte Hmi_RefPage(ushort index)
        {
            strxinxi strxinxi = default(strxinxi);
            byte     result;

            if (index >= Hmi.myapp.app.pageqyt)
            {
                Hmi.myapp.errcode = 3;
                result            = 0;
            }
            else
            {
                Hmi.myapp.dpage         = index;
                Hmi.myapp.downobjid     = 255;
                Hmi.myapp.moveobjstate  = 0;
                Hmi.myapp.dpagemerrypos = 0;
                Hmi.Hmi_ClearTimer();
                Hmi.Hmi_Clearredian(0);
                Hmi.Hmi_ClearHexstr();
                Hmi.Hmi_GuiPageInit();
                if (Hmi.myapp.upapp.runapptype != runapptype.run || Hmi.myapp.binsuc != 1)
                {
                    result = 1;
                }
                else
                {
                    Hmi.myapp.upapp.pageidchange((int)index);
                    Readdata.Readdata_ReadPage(ref Hmi.myapp.dpagexinxi, (int)index);
                    Readdata.Readdata_ReadStr(ref strxinxi, (int)Hmi.myapp.dpagexinxi.zhilingstar);
                    Hmi.myapp.dobjnameseradd = strxinxi.addbeg + Hmi.myapp.app.strdataadd;
                    Hmi.myapp.pageobjs       = (pageobjs_ *)(Hmi.myapp.mymerry + Hmi.myapp.ovemerrys);
                    if (Hmi.myapp.dpagexinxi.zhilingqyt > 0)
                    {
                        Readdata.Readdata_ReadStr(ref strxinxi, (int)(Hmi.myapp.dpagexinxi.zhilingstar + 1));
                        Readdata.SPI_Flash_Read(Hmi.myapp.mymerry + Hmi.myapp.ovemerrys, Hmi.myapp.app.strdataadd + strxinxi.addbeg, (uint)strxinxi.size);
                        Hmi.myapp.dpagemerrypos = (ushort)(Hmi.myapp.ovemerrys + strxinxi.size);
                        Hmi.myapp.Hexstrindex   = (ushort)(Hmi.myapp.dpagexinxi.zhilingstar + 2);
                        Hmi.myapp.pagestate     = 0;
                    }
                    result = 1;
                }
            }
            return(result);
        }
Exemple #2
0
        public static unsafe void Hmi_Init()
        {
            strxinxi strxinxi = default(strxinxi);
            appinf0  appinf   = default(appinf0);

            Hmi.myapp.delay            = 0;
            Hmi.myapp.brush.sta        = 0;
            Hmi.myapp.brush.pointcolor = 0;
            Hmi.myapp.brush.backcolor  = 0;
            Hmi.myapp.brush.hangjux    = 0;
            Hmi.myapp.brush.hangjuy    = 0;
            Hmi.myapp.brush.xjuzhong   = 0;
            Hmi.myapp.brush.yjuzhong   = 0;
            Hmi.myapp.upapp.lcddev.wup = 255;
            Hmi.myapp.brush.pw         = 0;
            Hmi.myapp.paus             = 0;
            Hmi.myapp.sys.thsp         = 0;
            Hmi.myapp.sys.thsleepup    = 0;
            Hmi.myapp.sys.ussp         = 0;
            Hmi.myapp.touchsendxy      = 0;
            Hmi.myapp.errcode          = 255;
            Hmi.myapp.dpage            = 0;
            Hmi.myapp.Hexstrindex      = 65535;
            Hmi.myapp.downobjid        = 255;
            Hmi.myapp.moveobjstate     = 0;
            Hmi.Hmi_ClearTimer();
            Hmi.Hmi_Clearredian(0);
            Hmi.Hmi_ClearHexstr();
            Hmi.myapp.dpagemerrypos = 0;
            if (Hmi.myapp.binsuc != 1)
            {
                MessageOpen.Show("Data Error!");
            }
            else
            {
                Touch.TP_REST();
                Readdata.Readdata_ReadApp0(ref appinf);
                if (Hmi.myapp.app.strqyt > 0u)
                {
                    Readdata.Readdata_ReadStr(ref strxinxi, 0);
                    if (strxinxi.size < 8192)
                    {
                        Readdata.SPI_Flash_Read(Hmi.myapp.mymerry, Hmi.myapp.app.strdataadd + strxinxi.addbeg, (uint)strxinxi.size);
                        Hmi.myapp.ovemerrys = strxinxi.size;
                    }
                }
                Readdata.Readdata_ReadStr(ref strxinxi, 1);
                Hmi.myapp.pagenameseradd = strxinxi.addbeg + Hmi.myapp.app.strdataadd;
                Hmi.myapp.upapp.Lcd_Set(appinf.guidire);
                uint[] array = new uint[2];
                Hmi.lastpagenamecrc = array;
                Hmi.lastpageid      = new ushort[]
                {
                    65535,
                    65535
                };
                Hmi.lastobjaddr = new uint[]
                {
                    65535u,
                    65535u
                };
                array = new uint[2];
                Hmi.lastobjnamecrc = array;
                Hmi.lastobjid      = new ushort[]
                {
                    65535,
                    65535
                };
            }
        }