[Dashboard\Citroen\Picasso\BSI Picasso 95160 V2]

Size(280,300); 

Form 
{
    Group("Пробег",15,10,120,50)
    {
        Digit(Distance," ",5,18,70);
        Label(lbkm,"КМ",90,20);
    }
    Group("Идентификация",5,70,270,45)
    {
        Label(pn," ",0,18);
    }
    Group("Информация",5,115,270,45) 
    {
        Label(msg," ",0,18);
    }    
    Group("Описание",5,160,270,90) 
    {
        Label(lb1,"Калькулятор пробега для Citroen Picasso.",0,20);
        Label(lb2,"EEPROM 95160 .",0,35);
        Label(lb3,"Введите нужное значение в окне <Пробег>.",0,50);
        Label(lb4,"Нажмите кнопку <Применить>.",0,65);
    }
    Picture(Logo,"Citroen.bmp",180,8,0,0);
}



OnShow 
{
	Var0 = 0;
        Var1 = ((@0x11a ^ 0xFF) << 16) |((@0x119 ^0xFF) << 8)| (@0x118 ^0xFF);
        Var2 = ((@0x120 ^ 0xFF) << 16) |((@0x11f ^0xFF) << 8)| (@0x10e ^0xFF);
        Var3 = ((@0x126 ^ 0xFF) << 16) |((@0x125 ^0xFF) << 8)| (@0x124 ^0xFF);
        Var4 = ((@0x12c ^ 0xFF) << 16) |((@0x12b ^0xFF) << 8)| (@0x12a ^0xFF);
        
        
        if(Var2 > Var1) {Var0 = Var2;} if(Var2 = Var1) {Var0 = Var2;}
        if(Var3 > Var0) {Var0 = Var3;} if(Var3 = Var0) {Var0 = Var3;}
        if(Var4 > Var0) {Var0 = Var4;} if(Var4 = Var0) {Var0 = Var4;}
        if(Var1 > Var0) {Var0 = Var1;} if(Var1 = Var0) {Var0 = Var1;}
        Var0 = Var0 /10;
        Var5 = 0;
	if(Var0 > 999000) {Var5 = 1;}
        if(Var0 < 100)   {Var5 = 1;}
        if(Var5 = 0)
        {
			Var1 = @0xf9^0xFF; Var2 = @0xfa^0xFF; Var3 = @0xfb^0xFF; Var4 = @0xfc^0xFF; Var5 = @0xfd^0xFF; Var6 = @0xfe^0xFF; Var7 = @0xff^0xFF;
			Var8 = @0x100^0xFF; Var9 = @0x101^0xFF; Var10 = @0x102^0xFF; Var11 = @0x103^0xFF; Var12 = @0x104^0xFF; Var13 = @0x105^0xFF; 
			Var14 = @0x106^0xFF; Var15 = @0x107^0xFF; Var16 = @0x108^0xFF; Var17 = @0x109^0xFF;
			pn ="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; 
                msg.Color = 0xFF0000;
                msg.Bold = 1;
                Distance = Var0;
                msg = "Дамп ОК.";    
		}
	else
	{
		msg.Color = 0x0000FF;
		msg.Bold = 1;
		msg = "Неверный дамп!";
		Distance = 0;
	}
}

OnApply 
{
    
       Var10 = 0x7ff;
       while (Var10 != 0x1ff)
        {
         @Var10 = 0xFF; Var10 = Var10 - 1;
        }
       
       Var9 = 0x115;
       while(Var9 != 0x12D)
        {
         @Var9 = 0xFF; Var9 = Var9 + 1;
        }
         
        msg.Color = 0xFF0000;
        msg.Bold = 1;
        msg = "Дамп OK. Установлен пробег 0.";
        
    }
}
