[Dashboard\Renault\Megane\Megane 93C66 Visteon]

Size(280,315); 

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(vin," ",0,30);
    }   
    Group("Информация",5,115,270,45)
    {
        Label(message," ",0,18);
    }
    Group("Описание",5,165,270,100) 
    {
        Label(lb4,"Калькулятор для Renault Megane.",0,20);
        Label(lb5,"VISTEON. EEPROM 93C66",0,35);
        Label(lb2,"Введите нужное значение в окне ПРОБЕГ",0,55);
        Label(lb3,"и нажмите кнопку <Применить>.",0,70);
    }
    Picture(Picture1,"Renault.bmp",200,5,0,0);
}

OnShow 
{
    Message.Bold = 1;
    
   Var0 = 0;
   Var1 = (@0xa5 << 16) | (@0xa2 << 8) | @0xa3;
   Var2 = (@0x1a5 << 16) | (@0x1a2 << 8) | @0x1a3;
   if(Var1 != Var2) {Var0 = Var0 + 1;}    
   // Var3 = ((((@0x56 + @0x5a) + @0x5b) + @0x58) +@0x59) & 255;
   // Var4 = @0x5c;
   // if(Var3 != Var4) {Var0 = Var0 + 1;}
 
     if(Var0 != 0)
    {
        message.Color = 0x0000FF; 	
        Message = "Неверный дамп!";     
        Distance = 0;                   
    }
    else
    {
        pn = "RENAULT PN: "+#b.@0x11+#b.@0x10+#b.@0x13+#b.@0x12+#b.@0x15;
        vin = "VIN: "+#c.@0x57+#c.@0x56+#c.@0x59+#c.@0x58+#c.@0x5b+#c.@0x5a+#c.@0x5d+#c.@0x5c+#c.@0x5f+#c.@0x5e+#c.@0x61+#c.@0x60+#c.@0x63+#c.@0x62+#c.@0x65+#c.@0x64+#c.@0x67;
        message.Color = 0xFF0000;                    
        message = "Дамп ОК. Введите новый пробег.";  
        Distance =  Var1;  
    }                          
}


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

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

        Var0 = 0x1a2;
        
		@Var0 = (Var2 >> 8) & 255; Var0 = Var0 + 1;
		@Var0 = Var2 & 255;  Var0 = Var0 + 2;
		@Var0 = (Var2 >> 16) & 255; 

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





















