[Dashboard\Fiat\Ulysse\BSI Ulysse 912DG128A]

Size(280,300); 

Form
{
    Group("Пробег",5,5,140,50)
    {
        Digit(Distance," ",5,18,90);
        Label(lb1,"KM",110,20);
    }
    Group("VIN. LOGIN",5,70,270,40)
    {
        Label(message," ",0,15);
		
    }
     Group("Информация",5,113,270,40)
    {
        Label(message1," ",0,18);
    }
    Group("Описание",5,155,270,95) 
    {
        Label(lb4,"Калькулятор пробега для BSI Fiat Ulysse.",0,20);
        Label(lb5,"MCU 68HC912DG128A",0,35);
        Label(lb2,"Введите нужное значение в окне ПРОБЕГ",0,55);
        Label(lb3,"и нажмите кнопку <Применить>.",0,70);
    }
    Picture(Picture1,"Fiat.bmp",170,0,0,0);
}
OnShow 
{
   
   var1 = @0x68D^0xff; var2 = @0x68e^0xff; var3 = @0x68f^0xff; var4 = @0x690^0xff; var5 = @0x691^0xff;
   var6 = @0x692^0xff; var7 = @0x693^0xff; var8 = @0x694^0xff; var9 = @0x695^0xff; var10 = @0x696^0xff;
   var11 = @0x697^0xff; var12 = @0x698^0xff; var13 = @0x699^0xff; var14 = @0x69a^0xff; var15 = @0x69b^0xff;
   var16 = @0x69c^0xff; var17 = @0x69d^0xff;
    Var30 = ((@0x6ab << 16) | (@0x6ac <<8) | @0x6ad) ^ 0xFFFFFF;
    Var30 = var30 / 10;
     
    message = "VIN: "+#c.var1+#c.var2+#c.var3+#c.var4+#c.var5+#c.var6+#c.var7+#c.var8+#c.var9+#c.var10+#c.var11+#c.var12+#c.var13+#c.var14+#c.var15+#c.var16+#c.var17;
    Var5 = 0;
     if(Var30 > 999000) {Var5 = 1;}
     if(Var5 = 0)
   {

    message1.Bold = 1;
    message1.Color = 0xFF0000;                    
    message1 = "Дамп ОК. Введите новый пробег.";  
    Distance =  Var30;                            
   }
 else
   {
     message1.Bold = 1;
     message1.Color = 0x0000FF; 	
     message1 = "Неверный дамп!";     
     Distance = 0;              
   }
}
OnApply 
{
    Var1 = Distance;
    Var5 = 0;
    if(Var1 > 999900) {Var5 = 1;}
    if(Var5 != 0)
    {
        message1.Color = 0x0000FF;
        message1.Bold = 1;
        message1 = "Пробег должен быть до 999900 км";
    }
    else
    { 
       Var1 = Var1 * 10;  
       Var3 = (Var1 >> 16)^0xFF; Var4 = (Var1 >> 8)^0xFF; Var5 = (Var1 & 255)^0xFF; Var6 = ((Var3 + Var4) + Var5) & 255;
       Var9 = 0x6a9;
          @Var9 = (Var6 + @0x6aa) & 255; Var9 = Var9 + 2;
          @Var9 = Var3; Var9 = Var9 + 1;
          @Var9 = Var4; Var9 = Var9 + 1;
          @Var9 = Var5; 
       Var9 = 0x6af;
          @Var9 = (Var6 + @0x6b0) & 255; Var9 = Var9 + 2;
          @Var9 = Var3; Var9 = Var9 + 1;
          @Var9 = Var4; Var9 = Var9 + 1;
          @Var9 = Var5;  
       Var9 = 0x6b5;
          @Var9 = (Var6 + @0x6b6) & 255; Var9 = Var9 + 2;
          @Var9 = Var3; Var9 = Var9 + 1;
          @Var9 = Var4; Var9 = Var9 + 1;
          @Var9 = Var5; 
       Var9 = 0x6bb;
          @Var9 = (Var6 + @0x6bc) & 255; Var9 = Var9 + 2;
          @Var9 = Var3; Var9 = Var9 + 1;
          @Var9 = Var4; Var9 = Var9 + 1;
          @Var9 = Var5;  
       Var9 = 0x6c1;
          @Var9 = (Var6 + @0x6c2) & 255; Var9 = Var9 + 2;
          @Var9 = Var3; Var9 = Var9 + 1;
          @Var9 = Var4; Var9 = Var9 + 1;
          @Var9 = Var5; 
       Var9 = 0x6c7;
          @Var9 = (Var6 + @0x6c8) & 255; Var9 = Var9 + 2;
          @Var9 = Var3; Var9 = Var9 + 1;
          @Var9 = Var4; Var9 = Var9 + 1;
          @Var9 = Var5; 
       Var9 = 0x6cd;
          @Var9 = (Var6 + @0x6ce) & 255; Var9 = Var9 + 2;
          @Var9 = Var3; Var9 = Var9 + 1;
          @Var9 = Var4; Var9 = Var9 + 1;
          @Var9 = Var5;  
       Var9 = 0x6d3;
          @Var9 = (Var6 + @0x6d4) & 255; Var9 = Var9 + 2;
          @Var9 = Var3; Var9 = Var9 + 1;
          @Var9 = Var4; Var9 = Var9 + 1;
          @Var9 = Var5; 
       
        message1.Color = 0xFF0000;
        message1.Bold = 1;
        message1 = "Дамп OK. Новый пробег записан.";
        
    }
}

