[Dashboard\Ford\Galaxy\Galaxy 93C86 V1]

Size(280,250);
Form
{
  Group("Пробег",5,5,140,50)
    {
        Digit(Distance," ",5,18,90);
        Label(lb1,"KM",110,20);
    }
    
    Group("Информация",5,70,270,45)
    {
        Label(msg," ",0,18);
    }
    Group("Описание",5,120,270,80) 
    {
        Label(lb4,"Калькулятор пробега для Ford Galaxy.",0,15);
        Label(lb5,"VDO. EEPROM 93C86",0,30);
        Label(lb2,"Введите нужное значение в окне <Пробег>.",0,45);
        Label(lb3,"и нажмите кнопку <Применить>.",0,60);
    }

   Picture(Logo,"Ford.bmp",185,5,0,0);
}
OnShow 
{
 Var0=0;
 
   Var4 = ((@0xfd << 8) | @0xfc)^0xffff; Var5 = ((@0xff << 8) | @0xfe)^0xffff; Var6 = ((@0x101 << 8) | @0x100)^0xffff; Var7 = ((@0x103 << 8) | @0x102)^0xffff;
   Var8 = ((@0x105 << 8) | @0x104)^0xffff; Var9 = ((@0x107 << 8) | @0x106)^0xffff; Var10 = ((@0x109 << 8) | @0x108)^0xffff; Var11 = ((@0x10b << 8) | @0x10a)^0xffff;         
   Var12 = Var4+Var5+Var6+Var7+Var8+Var9+Var10+Var11;
      if(Var12 > 500000)
      {Var0 = 1;} 
      if(Var0 = 0)
      {        
       	msg.Color = 0xFF0000;
       	msg.Bold = 1;
       	msg = "Дамп ОК. Введите новый пробег.";
       	Distance = Var12 * 2;
      }
  else
      {
        msg.Color = 0x0000FF;
	msg.Bold = 1;
	msg = "Неверный дамп!";
	Distance = 0;     
      }
}
OnApply 
{
    Var5 = 0;
    Var2 = Distance;
    if(Var2 > 999900) {Var5 = 1;}
    if(Var2 < 100)   {Var5 = 1;}
    if(Var5 != 0)
    {
        msg.Color = 0x0000FF;
        msg.Bold = 1;
        msg = "Пробег должен быть от 100 до 999900 км";
    }
    else
    {
        Var3 = 0xfc;
        while(Var3 != 0x10c)
        {
            @Var3 = Var2 >> 4 & 255 ^ 0xFF;
            @Var3.mismatch = 1;
            Var3 = Var3 + 1;
            @Var3 = (Var2 >> 12 & 255) ^ 0xFF;
            @Var3.mismatch = 1;
            Var3 = Var3 + 1;
        }   
    }
}
