[Dashboard\Smart\Smart W451\Smart W451 9S12B128]


Size(280,310); 

Form 
{
    Group("Пробег",5,13,110,50)
    {
        Digit(Distance," ",5,18,50);
        Label(lbkm,"КМ",80,20);
       
    }
    Group("Идентификация",5,80,270,45)
    {
        Label(partmb," ",0,18);
    }
    Group("Информация",5,125,270,45) 
    {
        Label(Message," ",0,18);
    }    
    Group("Описание",5,175,270,90) 
    {
        Label(lb1,"Калькулятор пробега для Smart SAM",0,20);
        Label(lb2,"9S12B128 internal EEPROM.",0,35);
        Label(lb3,"Введите нужное значение в окне <Пробег>.",0,50);
        Label(lb4,"Нажмите кнопку <Применить>.",0,65);
    }
     Picture(Logo,"Smart.bmp",140,20,0,0);
}

OnShow 
{
    
    Var5 = (@0x269 << 16) | (@0x26a << 8) | @0x26b;
    message.Color = 0xFF0000;
    message.Bold = 1;
    message = "Дамп ОК. Введите новый пробег.";
    Distance = Var5;
    partmb = "VIN: "+#c.@0x159+#c.@0x15a+#c.@0x15b+#c.@0x15c+#c.@0x15d+#c.@0x15e+#c.@0x15f+#c.@0x160+#c.@0x161+#c.@0x162+#c.@0x163+#c.@0x164+#c.@0x165+#c.@0x166+#c.@0x167+#c.@0x168+#c.@0x169;
    
}
    
OnApply
{
    Var5 = 0;
    Var2 = Distance;
    if(Var2 > 999999) {Var5 = 1;}
    if(Var2 < 0)   {Var5 = 1;}
    if(Var5 != 0)
    {
        message.Color = 0x0000FF;
        message.Bold = 1;
        message = "Пробег должен быть не более 999999 км";
    }
    else
    { 
       Var2 = Var2;
       Var0 = 0x269;
        @Var0 = Var2 >>16; Var0 = Var0 +1;
        @Var0 = Var2 >>8; Var0 = Var0 +1;
        @Var0 = Var2 & 255;  
            
       message.Color = 0xFF0000;
       message.Bold = 1;
       message = "Новый пробег записан.";
    }
   
}













