[Dashboard\Seat\Cordoba\Cordoba 9S12H256CFV]

Size(280,290);
Form
{
  Group("Пробег",5,5,140,50)
    {
        Digit(Distance," ",5,18,90);
        Label(lb1,"KM",110,20);
    }
    Group("Идентификация",5,62,270,50)
    {
        Label(pn," ",0,15);
        label(login," ",0,30);
    } 
    Group("Информация",5,113,270,45)
    {
        Label(msg," ",0,18);
    }
    Group("Описание",5,158,270,80) 
    {
        Label(lb4,"Калькулятор пробега для Seat Cordoba.",0,15);
        Label(lb5,"M.Marelli. Internal EEPROM S12H256CFV maskset 2K78X",0,30);
        Label(lb2,"Введите нужное значение в окне <Пробег>.",0,45);
        Label(lb3,"и нажмите кнопку <Применить>.",0,60);
    }

   Picture(Logo,"Seat.bmp",185,5,0,0);
}
OnShow 
{
 Var0=0;
 
 if(@0x600 = 0xff) { Var0 = 1;}
 if(Var0 != 1)
  {
   pn = "VAG P/N:  "+#c.@0x34+#c.@0x35+#c.@0x36+" "+#c.@0x37+#c.@0x38+#c.@0x39+" "+#c.@0x3a+#c.@0x3b+#c.@0x3c+#c.@0x3d;
   Var3 = (@0x4ec << 8) | @0x4ed;   
   login = "LOGIN:  "+#i.Var3;
   Var4= 0; Var5 = 0x600; Var6 = 0x601; Var7 = 0x602; Var8 = 0x603; Var9 = 0;
   while(Var5 != 0x7f0)
   {
    Var9 = (@Var5 << 24)|(@Var6 << 16)|(@Var7 << 8)|@Var8;
    if(Var4 < Var9) {Var4 = Var9;}
    Var5 = Var5 + 8; Var6 = Var6 + 8; Var7 = Var7 + 8; Var8 = Var8 + 8;
   }
    
       	msg.Color = 0xFF0000;
       	msg.Bold = 1;
       	msg = "Дамп ОК. Введите новый пробег.";
       	Distance = Var4 /1000;
  }
  else
  {
        msg.Color = 0x0000FF;
	msg.Bold = 1;
	msg = "Неверный дамп!";
	Distance = 0;     
  }
}
OnApply 
{
    Var5 = 0;
    Var2 = Distance;
    if(Var2 > 999900) {Var5 = 1;}
    if(Var5 != 0)
    {
        msg.Color = 0x0000FF;
        msg.Bold = 1;
        msg = "Пробег должен быть до 999900 км";
    }
    else
    {
        Var2 = Var2 * 1000; Var3=(Var2 >> 24)&0xff; Var4=(Var2 >> 16)&0xff; Var5=(Var2 >> 8)&0xff;
        Var6=(Var2 >> 24)^0xff; Var7=(Var2 >> 16)^0xff; Var8=(Var2 >> 8)^0xff;
        Var9 = 0x600;
        while(Var9 != 0x7f0)
        {
            @Var9 = Var3; Var9 = Var9 + 1;
            @Var9 = Var4; Var9 = Var9 + 1;
            @Var9 = Var5; Var9 = Var9 + 2;
            @Var9 = Var6; Var9 = Var9 + 1;
            @Var9 = Var7; Var9 = Var9 + 1;
            @Var9 = Var8; Var9 = Var9 + 2;
        }   
    }
}
