[Dashboard\China\Lifan\Lifan X60 24C02]

Size(280,250); 

Form
{
    Group("Пробег",5,5,140,50)
    {
        Digit(Distance," ",5,18,90);
        Label(lb1,"KM",110,20);
    }
        
     Group("Информация",5,58,270,45)
    {
        Label(message," ",0,18);
    }
    Group("Описание",5,105,270,100) 
    {
        Label(lb4,"Калькулятор пробега для Lifan X60.",0,20);
        Label(lb5,"EEPROM 24C02",0,35);
        Label(lb2,"Введите нужное значение в окне ПРОБЕГ",0,55);
        Label(lb3,"и нажмите кнопку <Применить>.",0,70);
    }
}

OnShow 
{
    Message.Bold = 1;

  
    Var1 =  (@0x1 << 16) | (@0x2 << 8) | @0x3;
    
  
       
             
        message.Color = 0xFF0000;                    
        message = "Дамп ОК. Введите новый пробег.";  
        Distance =  Var1;                            

  
}

OnApply
{
    Var1 = Distance;
    
    Var0 = 0;

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

    if(Var0 != 0)
    {
        message.Color = 0x0000FF; 
        Message = "Пробег должен быть от 100 до 999900 км.";
    }
    else
    {
                Var2 = Distance;
		
		
        Var0 = 0x00;                                                                     @Var0 = Var2 >> 24; Var0 = Var0 + 1;
		@Var0 = Var2 >> 16; Var0 = Var0 + 1;
		@Var0 = Var2 >> 8;  Var0 = Var0 + 1;
		@Var0 = Var2 & 255;
		 
		 

        Var0 = 0x04;
        @Var0 = Var2 >> 24; Var0 = Var0 + 1;
		@Var0 = Var2 >> 16; Var0 = Var0 + 1;
		@Var0 = Var2 >> 8;  Var0 = Var0 + 1;
		@Var0 = Var2 & 255;

        Var0 = 0x08;
        
		@Var0 = Var2 >> 24; Var0 = Var0 + 1;
		@Var0 = Var2 >> 16; Var0 = Var0 + 1;
		@Var0 = Var2 >> 8;  Var0 = Var0 + 1;
		@Var0 = Var2 & 255;
Var0 = 0x0c;
        
		@Var0 = Var2 >> 24; Var0 = Var0 + 1;
		@Var0 = Var2 >> 16; Var0 = Var0 + 1;
		@Var0 = Var2 >> 8;  Var0 = Var0 + 1;
		@Var0 = Var2 & 255;
        Var0 = 0x10;
        
		@Var0 = Var2 >> 24; Var0 = Var0 + 1;
		@Var0 = Var2 >> 16; Var0 = Var0 + 1;
		@Var0 = Var2 >> 8;  Var0 = Var0 + 1;
		@Var0 = Var2 & 255; 

        Var0 = 0x14;
        
		@Var0 = Var2 >> 24; Var0 = Var0 + 1;
		@Var0 = Var2 >> 16; Var0 = Var0 + 1;
		@Var0 = Var2 >> 8;  Var0 = Var0 + 1;
		@Var0 = Var2 & 255; 
Var0 = 0x18;
        
		@Var0 = Var2 >> 24; Var0 = Var0 + 1;
		@Var0 = Var2 >> 16; Var0 = Var0 + 1;
		@Var0 = Var2 >> 8;  Var0 = Var0 + 1;
		@Var0 = Var2 & 255; 

        Var0 = 0x1c;
        
		@Var0 = Var2 >> 24; Var0 = Var0 + 1;
		@Var0 = Var2 >> 16; Var0 = Var0 + 1;
		@Var0 = Var2 >> 8;  Var0 = Var0 + 1;
		@Var0 = Var2 & 255;

        Var0 = 0x20;
        
		@Var0 = Var2 >> 24; Var0 = Var0 + 1;
		@Var0 = Var2 >> 16; Var0 = Var0 + 1;
		@Var0 = Var2 >> 8;  Var0 = Var0 + 1;
		@Var0 = Var2 & 255; 
Var0 = 0x24;
        
		@Var0 = Var2 >> 24; Var0 = Var0 + 1;
		@Var0 = Var2 >> 16; Var0 = Var0 + 1;
		@Var0 = Var2 >> 8;  Var0 = Var0 + 1;
		@Var0 = Var2 & 255; 



        message.Color = 0xFF0000;  
        message = "Новый пробег записан. Дамп ОК.";
    }
}





















