[Dashboard\Saab\Saab - 24C04 Bosch]


Size(280,320); 

Form
{
    Group("Пробег",15,10,115,50)
    {
        Digit(Distance," ",5,18,60);
        Label(lb1,"KM",80,20);
    }
    Picture(Picture1,"Saab.bmp",175,10,0,0);
    Group("Идентифткация",5,80,270,45)
    {
        Label(vin," ",0,18);
    }
    Group("Информация",5,130,270,45)
    {
        Label(message," ",0,18);
    }
    Group("Описание",5,180,270,90) 
    {
        Label(lb4,"Калькулятор пробега для Saab 93.",0,20);
        Label(lb5,"EEPROM 24C04",0,35);
        Label(lb2,"Введите нужное значение в окне ПРОБЕГ",0,50);
        Label(lb3,"и нажмите кнопку <Применить>.",0,65);
    }
}

OnShow 
{
    Message.Bold = 1;  
    Var0 = 0; 	
    if(@0x00 = 0xFF) 	{ Var0 = Var0 + 1;}	
    if(Var0 != 0)
    {
        message.Color = 0x0000FF; 	
        Message = "Неверный дамп!";     
        Distance = 0;                   
    }
    else
    {
      Var0 = 0; Var1 = 0; 
  Var1 =  (@0x00 << 16) | (@0x01 << 8) | @0x02;
      
       }
        message.Color = 0xFF0000;                    
        message = "Дамп ОК. Введите новый пробег.";  
        Distance =  Var1;                            
       
                                   
  vin.Bold =1;
  vin="VIN: "+#c.@0x28+#c.@0x29+#c.@0x2a+#c.@0x2b+#c.@0x2c+#c.@0x2d+#c.@0x2e+#c.@0x2f+#c.@0x30+
      #c.@0x31+#c.@0x32+#c.@0x33+#c.@0x34+#c.@0x35+#c.@0x36+#c.@0x37+#c.@0x38; 
}

OnApply
{
    Var1 = Distance;

    Var0 = 0;
    if(Var1 < 100)      { Var0 = Var0 - 1; }
    if(Var1 > 999900)   { Var0 = Var0 - 1; }
    if(Var1 < 100)      { Var0 = Var0 - 1; }

    if(Var0 != 0)
    {
        message.Color = 0x0000FF;
       message.Bold = 1;
        message = "Пробег должен быть от 100 до 999900 км"; 

    }
    else
    {
    
      Var4 = (var1 >> 16) & 0xFF; Var3 = (var1 >> 8) & 0xFF; Var2 = var1 & 0xFF; 
      Var5 = 0x00;var6 = 0x04;var7 = 0x08;var8 = 0x0c;var9 = 0x10;
      while(Var5 != 0x03)
       {  
  @Var5 = Var4; Var5 = Var5 + 1;
  @Var5 = Var3; Var5 = Var5 + 1;
  @Var5 = Var2; Var5 = Var5 + 1;
  @Var6 = Var4; Var6 = Var6 + 1;
  @Var6 = Var3; Var6 = Var6 + 1;
  @Var6 = Var2; Var6 = Var6 + 1;
  @Var7 = Var4; Var7 = Var7 + 1;
  @Var7 = Var3; Var7 = Var7 + 1;
  @Var7 = Var2; Var7 = Var7 + 1;
  @Var8 = Var4; Var8 = Var8 + 1;
  @Var8 = Var3; Var8 = Var8 + 1;
  @Var8 = Var2; Var8 = Var8 + 1;
  @Var9 = Var4; Var9 = Var9 + 1;
  @Var9 = Var3; Var9 = Var9 + 1;
  @Var9 = Var2; Var9 = Var9 + 1;
       
        }
        message.Color = 0xFF0000;
        message.Bold = 1;
        message = "Дамп OK. Новый пробег записан.";


    }
}







