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



Size(280,330); // ширина и высота

Form
{
       Group("Пробег",5,10,110,50)
    {
        Digit(Distance," ",5,18,50);
        Label(lb1,"KM",80,20);
     }
    Group("Идентификация",5,65,270,60)
    {
        Label(fg," ",0,15);
        Label(nr," ",0,30);
    } 
    Group("Информация",5,130,270,45)
    {
        Label(message," ",0,18);
    }
    Group("Описание",5,180,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",160,6,0,0);
}




OnShow 
{
Message.Bold = 1;
    Var0 = 0;
    Var1 =(@0xeb4 << 8) |@0xeb5;
     
    if (@0x3f8 = @0xff) {Var0 = Var0 + 1;}
 
    if(Var0 != 0)
    {
        message.Color = 0x0000FF; 	
        Message = "Неверный дамп!";     
        Distance = 0;                   
    }
else
    {
        message.Color = 0xFF0000;                    
        message = "Дамп ОК. Введите новый пробег.";  
        Distance = ( Var1 * 1601) / 10;
        fg.Bold = 1;
        fg = "FGSTNR: "+#c.@0x40c+#c.@0x40d+#c.@0x40e+#c.@0x40f+#c.@0x410+#c.@0x411+#c.@0x412+#c.@0x413+
        #c.@0x414+#c.@0x415+#c.@0x416+#c.@0x417+#c.@0x418+#c.@0x419+#c.@0x41a+#c.@0x41b+#c.@0x41c;
    }      



}

OnApply {
        @0xeb5 = 0x00; @0xeb4 = 0x00; @0xeb6 = 0xff; @0xeb7 = 0xff;
        @0xeb8 = 0x00; @0xeb9 = 0x00; @0xeba = 0xff; @0xebb = 0xff;
              
        message.Color = 0xFF0000;  
        message = "Установлен пробег 0. Дамп ОК.";
    }


}
