Ejemplo n.º 1
0
        public unsafe static byte GuiCurveInit(objxinxi *obj, byte ID)
        {
            if (GuiCurve.myapp.upapp.runapptype == runapptype.bianji)
            {
                GuiCurve.GuiCurvePageInit();
            }
            byte result;

            if (obj->attpos + obj->attposqyt > 8192)
            {
                result = 0;
            }
            else
            {
                for (byte b = 0; b < 5; b += 1)
                {
                    if (GuiCurve.CurveIndex[(int)b].objID == 255)
                    {
                        GuiCurve.CurveIndex[(int)b].objID  = ID;
                        GuiCurve.CurveIndex[(int)b].offset = obj->attpos;
                        if (GuiCurve.myapp.upapp.runapptype == runapptype.bianji)
                        {
                            GuiCurve.CurveRefBack(obj, ID);
                        }
                        break;
                    }
                }
                result = 1;
            }
            return(result);
        }
Ejemplo n.º 2
0
        public unsafe static byte CurveRefBack(objxinxi *obj, byte ID)
        {
            byte[]       array = new byte[0];
            CURVE_PARAM *ptr;

            if (GuiCurve.myapp.upapp.runapptype == runapptype.bianji)
            {
                GuiCurve.GuiCurvePageInit();
                ptr = (CURVE_PARAM *)GuiCurve.myapp.mymerry;
            }
            else
            {
                ptr = (CURVE_PARAM *)(GuiCurve.myapp.mymerry + obj->attpos);
            }
            if (GuiCurve.myapp.upapp.runapptype == runapptype.bianji || GuiCurve.myapp.pageobjs[ID].vis == 1)
            {
                if (ptr->BackType == 0)
                {
                    Showpic.Showpic_ShowXpic((int)obj->redian.x, (int)obj->redian.y, (ushort)(obj->redian.endx - obj->redian.x + 1), (ushort)(obj->redian.endy - obj->redian.y + 1), (int)obj->redian.x, (int)obj->redian.y, ptr->PicID);
                }
                else if (ptr->BackType == 2)
                {
                    Showpic.Showpic_ShowPic((int)obj->redian.x, (int)obj->redian.y, ptr->PicID);
                }
                else
                {
                    uint qyt = (uint)(ptr->objWid * ptr->objHig);
                    Lcd.LCD_addset((int)obj->redian.x, (int)obj->redian.y, (int)obj->redian.endx, (int)obj->redian.endy, 1);
                    Lcd.Lcd_WR_POINT(qyt, ptr->Bkclr);
                    if (ptr->GridX > 0)
                    {
                        for (short num = (short)obj->redian.x; num <= (short)obj->redian.endx; num += (short)ptr->GridX)
                        {
                            Lcd.LCD_addset((int)((ushort)num), (int)obj->redian.y, (int)((ushort)num), (int)obj->redian.endy, 1);
                            Lcd.Lcd_WR_POINT((uint)ptr->objHig, ptr->Griclr);
                        }
                    }
                    if (ptr->GridY > 0)
                    {
                        for (short num = (short)obj->redian.endy; num >= (short)obj->redian.y; num -= (short)ptr->GridY)
                        {
                            Lcd.LCD_addset((int)obj->redian.x, (int)((ushort)num), (int)obj->redian.endx, (int)((ushort)num), 1);
                            Lcd.Lcd_WR_POINT((uint)ptr->objWid, ptr->Griclr);
                        }
                    }
                }
            }
            return(1);
        }
Ejemplo n.º 3
0
        public static void Usart_ComRecode(byte Res)
        {
            try
            {
                if (Usart.myapp.upapp.runapptype == runapptype.run)
                {
                    while (!Usart.usartzhongduan)
                    {
                    }
                    byte state = Usart.myapp.USART.State;
                    switch (state)
                    {
                    case 0:
                        Commake.Commake_RecvNorComData(Res);
                        break;

                    case 1:
                        break;

                    case 2:
                        break;

                    default:
                        if (state == 23)
                        {
                            GuiCurve.RecCurveTranData(Res);
                        }
                        break;
                    }
                    if (Usart.myapp.sys.ussp > 0)
                    {
                        Usart.myapp.systime.sptime = Usart.myapp.systime.systemruntime;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageOpen.Show("Usart_ComRecode RunError:" + ex.Message);
            }
        }
Ejemplo n.º 4
0
        public unsafe static byte GuiCruveCmd(byte id, byte ch, byte data)
        {
            byte b;

            for (b = 0; b < 5; b += 1)
            {
                if (GuiCurve.CurveIndex[(int)b].objID == id)
                {
                    break;
                }
            }
            byte result;

            if (b < 5)
            {
                if (ch < 4)
                {
                    GuiCurve.CurveIndex[(int)b].Ch = ch;
                    byte b2;
                    fixed(void *ptr = (&GuiCurve.CurveIndex[(int)b]))
                    {
                        b2 = GuiCurve.GuiCurveAdd((GuiCurve.CURVE_INDEX *)ptr, data);
                    }

                    result = b2;
                }
                else
                {
                    result = 0;
                }
            }
            else
            {
                result = 0;
            }
            return(result);
        }
Ejemplo n.º 5
0
        public unsafe static byte RecCurveTranData(byte dat)
        {
            byte result;

            if (GuiCurve.CurveTranCount > 0)
            {
                fixed(void *ptr = (&GuiCurve.CurveIndex[(int)GuiCurve.CurveTranIndex]))
                {
                    GuiCurve.GuiCurveAdd((GuiCurve.CURVE_INDEX *)ptr, dat);
                }

                GuiCurve.CurveTranCount -= 1;
                if (GuiCurve.CurveTranCount == 0)
                {
                    GuiCurve.myapp.USART.State = 9;
                }
                result = 1;
            }
            else
            {
                result = 0;
            }
            return(result);
        }
Ejemplo n.º 6
0
Archivo: Hmi.cs Proyecto: skyclub66/HMI
 private static void Hmi_GuiPageInit()
 {
     GuiCurve.GuiCurvePageInit();
 }