[Dashboard\Range Rover\Dash 93C86]

Size(280,300); 
Form
{
       Group("Пробег",5,5,140,50)
    {
        Digit(Distance," ",5,18,90);
        Label(lb1,"KM",110,20);
        
    }
    Group("VAG P/N. DATE",5,70,270,40)
    {
        Label(pn," ",0,15);
	
    } 
    Group("Информация",5,110,270,45)
    {
        Label(msg," ",0,18);
    }
    Group("Описание",5,155,270,95) 
    {
        Label(lb4,"Калькулятор пробега для Dash Range rover.",0,20);
        Label(lb5,"EEPROM 93C86",0,35);
        Label(lb2,"Введите нужное значение в окне <Пробег>.",0,55);
        Label(lb3,"и нажмите кнопку <Применить>.",0,70);
    }
    Picture(Logo,"vw.bmp",190,17,0,0);
}


OnShow 
{
       if(@0x6C9=0x39)
       {
        Var1 = (((@0x80D << 8)+@0x80C) ^ 0xFFFF) << 5;
        pn = "P/N: "+#c.@0x6e0+#c.@0x6e1+#c.@0x6e2+#c.@0x6e3+#c.@0x6e4+#c.@0x6e5+#c.@0x6e6+#c.@0x6e7+#c.@0x6e8+#c.@0x6e9+#c.@0x6ea+"  "+#c.@0x660+#c.@0x661+#c.@0x662+"   DATE: "+#c.@0x668+#c.@0x669+#c.@0x66a+#c.@0x66b+#c.@0x66c+#c.@0x66d+#c.@0x66e+#c.@0x66f;
        msg.Color = 0xFF0000;
        msg.Bold = 1;
        msg = "Дамп ОК. Введите пробег.";
        Distance = Var1;
        }
       else
        {
        msg.Color = 0x0000FF;
        msg.Bold = 1;
        msg = "Неверный дамп!";
        Distance = 0;
        } 
}

OnApply {
    Var5 = 0;
    Var2 = Distance;
    Var7 = Var2 >> 5 & 65535 ^ 0xFFFF;
    if(Var2 > 999900) {Var5 = 1;}
    if(Var2 < 100)   {Var5 = 1;}
    if(Var5 != 0)
    {
        msg.Color = 0x0000FF;
        msg.Bold = 1;
        msg = "Пробег должен быть от 100 до 999900 км";
    }
    else
    {
        Var3 = 0x80C;
        while(Var3 != 0x82C)
        {
            
            @Var3 = Var7 & 255;
            @Var3.mismatch = 1;
            Var3 = Var3 + 1;
            @Var3 = Var7 >> 8 & 255;
            @Var3.mismatch = 1;
            Var3 = Var3 + 1;
            Var6 = Var7 * 2;
            Var7 = (Var6 >> 16 + Var6) & 65535;
            msg.Color = 0xFF0000;
            msg.Bold = 1;
            msg = "Новый пробег записан.";
        }
       
    }
}
