[Dashboard\Volvo\S70\S70 68HC908AZ32]

Size(280,270);


Form {
    Group("Пробег",35,13,120,50)
    {
        Digit(Distance," ",5,18,70);
        Label(lbkm,"КМ",90,20);
    }
    Group("Информация",5,80,270,45) 
    {
        Label(msg," ",0,18);
    }    
    Group("Описание",5,130,270,90) 
    {
        Label(lb1,"Калькулятор пробега для Volvo S70.",0,20);
        Label(lb2,"Yazaki. 68HC908AZ32 internal EEPROM",0,35);
        Label(lb3,"Введите нужное значение в окне <Пробег>.",0,50);
        Label(lb4,"Нажмите кнопку <Применить>.",0,65);
    }
     Picture(Logo,"Volvo.bmp",165,10,0,0);
}

OnShow 
{
      Var0 = 0;
      if (@0x1c4 != 0x55) { Var0 = Var0 + 1;}
      if (@0x1c5 != 0xaa) { Var0 = Var0 + 1;}
      if (@0x1be != @0x1bf) { Var0 = Var0 + 1;}
      if (@0x1bf != @0x1c0) { Var0 = Var0 + 1;}
      if (@0x1c0 != @0x1c1) { Var0 = Var0 + 1;}
      if (@0x1c1 != @0x1c2) { Var0 = Var0 + 1;}
      if (@0x1c2 != @0x1c3) { Var0 = Var0 + 1;}
      if(Var0 = 0)
       {
        Var5 = 0; Var2 = 0; Var3 = 0; Var4 = 0;
        var1 = 0x100;
        while( Var1 != 0x1be)
         {
          var2 = (@0x1be + 1) & 255;
          var3 = (@var1 + 1) & 255;
          Var4 = (var2 << 8) | Var3;
          Var5 = Var5 + var4;
          Var1 = var1 + 1;
         } 
           
        msg.Color = 0xFF0000;
        msg.Bold = 1;
        msg = "Дамп ОК. Введите пробег.";
        Distance = Var5;
        }
       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
    {
        Var2 = Var2 / 190;
        Var3 = (Var2 >> 8) & 255;
        Var4 = Var2 & 255;
        Var5 = 0x100;
        while (Var5 != 0x1be)
         {
          if(var4 = 0x00) {Var4 = 0x100;}
          @Var5 = Var4 - 1;
          Var5 = Var5 + 1;
         }
        Var6 = 0x1be;
        while (Var6 != 0x1c4)
         {
          if(var3 = 0x00) {Var3 = 0x100;}
          @Var6 = Var3 - 1;
          Var6 = Var6 + 1;
         }

            msg.Color = 0xFF0000;
            msg.Bold = 1;
            msg = "Новый пробег записан.";
        
        }
    }
}
