[Dashboard\BMW\EWS\EWS4 9S12DG64 (2L86D)KM]



Size(280,320); 

Form
{
       Group("Пробег",5,10,110,50)
    {
        Digit(Distance," ",5,18,60);
        Label(lb1,"KM",85,20);
     }
    Group("Идентификация",5,65,270,50)
    {
        Label(fg," ",0,20);
    } 
    Group("Информация",5,120,270,45)
    {
        Label(message," ",0,18);
    }
    Group("Описание",5,170,270,100) 
    {
        Label(lb4,"Калькулятор пробега для BMW EWS4.",0,20);
        Label(lb5,"MCU: 9S12DG64 (2L86D)",0,35);
        Label(lb2,"Для установки пробега 0 ",0,55);
        Label(lb3,"нажмите кнопку <Применить>.",0,70);
    }
    Picture(Picture1,"BMW.bmp",165,6,0,0);
}




OnShow 
{
Message.Bold = 1;
    Var0 = 0;
    Var1 =(@0x2b4 << 8) |@0x2b5;
     
    if (@0x3f8 = @0xff) {Var0 = Var0 + 1;}
 
    if(Var0 != 0)
    {
        message.Color = 0x0000FF; 	
        Message = "Неверный дамп!";     
        Distance = 0;                   
    }
else
    {
        message.Color = 0xFF0000;                    
        message = "Дамп ОК. Введите новый пробег.";  
        Distance =  (Var1 * 256);
        fg.Bold = 1;
        fg = "Serien-Nr.: "+#c.@0xb0+#c.@0xb1+#c.@0xb2+#c.@0xb3+#c.@0xb4+#c.@0xb5+#c.@0xb6+#c.@0xb7+
        #c.@0xb8+#c.@0xb9+#c.@0xba+#c.@0xbb+#c.@0xbc;
    }      



}

OnApply {
        @0x2b5 = 0x00; @0x2b4 = 0x00; @0x2b6 = 0xff; @0x2b7 = 0xff;
        @0x2b8 = 0x00; @0x2b9 = 0x00; @0x2ba = 0xff; @0x2bb = 0xff;
              
        message.Color = 0xFF0000;  
        message = "Установлен пробег 0. Дамп ОК.";
    }


}
