[Dashboard\Peugeot\307\BSI 307 95128 Var2]

Size(280,300); 

Form
{
    Group("Пробег",5,5,140,50)
    {
        Digit(Distance," ",5,18,90);
        Label(lb1,"KM",110,20);
    }
    Group("Идентификация",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 Peugeot 307.",0,20);
        Label(lb5,"EEPROM 95128",0,35);
        Label(lb2,"Введите нужное значение в окне ПРОБЕГ",0,55);
        Label(lb3,"и нажмите кнопку <Применить>.",0,70);
    }
    Picture(Picture1,"Peugeot.bmp",180,5,0,0);
}
OnShow 
{
   Var0 = 0;
   Var1 = (@0x1dc << 16) |(@0x1db << 8)| @0x1da;
   Var2 = (@0x1e4 << 16) |(@0x1e3 << 8)| @0x1e2;
   Var3 = (@0x1ec << 16) |(@0x1eb << 8)| @0x1ea;
   

   if(Var2 > Var1) {Var0 = Var2;} if(Var2 = Var1) {Var0 = Var2;}
   if(Var3 > Var0) {Var0 = Var3;} if(Var3 = Var0) {Var0 = Var3;}
   if(Var1 > Var0) {Var0 = Var1;} if(Var1 = Var0) {Var0 = Var1;}
   Var0 = Var0 /10;
   Var10 = 0;
    if(Var0 > 999900) {Var10 = 1;}
   if (Var10 = 0)
   {  
    message = "VIN: "+#c.@0x174+#c.@0x173+#c.@0x172+#c.@0x171+#c.@0x170+#c.@0x16f+#c.@0x16e+#c.@0x16d+#c.@0x16c+#c.@0x16b+#c.@0x16a+#c.@0x169+#c.@0x168+#c.@0x167+#c.@0x166+#c.@0x165;
    message1.Bold = 1;
    message1.Color = 0xFF0000;                    
    message1 = "Дамп ОК. Введите новый пробег.";  
    Distance =  Var0;                            
   }
 else
   {
     message1.Color = 0x0000FF; 	
     Message1 = "Неверный дамп!";     
     Distance = 0;              
   }
}
OnApply 
{
    Var1 = Distance;
    Var5 = 0;
    if(Var1 > 999900) {Var5 = 1;}
    if(Var1 < 100)   {Var5 = 1;}
    if(Var5 != 0)
    {
        message1.Color = 0x0000FF;
        message1.Bold = 1;
        message1 = "Пробег должен быть от 100 до 999900 км";
    }
    else
    { 
       Var1 = Var1 * 10;  
       Var2 = Var1 >> 24; Var3 = Var1 >> 16; Var4 = Var1 >> 8; Var5 = Var1 & 255; Var6 = Var4 ^ 0xFF; Var7 = (((((Var2 + Var3) + Var4) + Var5) + Var6) + 1) ^0xff;
       Var8 = 0x1d8;
       while (Var8 != 0x1f0)
        {
         @Var8 = Var7; Var8 = Var8 + 1;
         @Var8 = Var6; Var8 = Var8 + 1;
         @Var8 = Var5; Var8 = Var8 + 1;
         @Var8 = Var4; Var8 = Var8 + 1;
         @Var8 = Var3; Var8 = Var8 + 1;
         @Var8 = Var2; Var8 = Var8 + 3;
        }
        message1.Color = 0xFF0000;
        message1.Bold = 1;
        message1 = "Дамп OK. Новый пробег записан.";
     }
}