[Dashboard\Hyundai\Genesis 93C66]

Size(280,250); 

Form
{
    Group("Value",5,5,140,50)
    {
        Digit(Distance," ",5,18,90);
        Label(lb1,"KM",110,20);
    }
    Group("Operation info.",5,58,270,45)
    {
        Label(message," ",0,18);
    }
    Group("Other info.",5,105,270,100) 
    {
        Label(lb4,"Dash Value of Hyndai Genesis.",0,20);
        Label(lb5,"EEPROM 93C66",0,35);
        Label(lb2,"Введите нужное значение в окне Value",0,55);
        Label(lb3,"и нажмите кнопку <Применить>.",0,70);
    }
    Picture(Picture1,"Hyndai.bmp",170,13,0,0);
}

OnShow
{
    Message.Bold = 1;
    Var0 = 0; 
    
    if(@0x00 != @0x20) { Var0 = Var0 + 1;}

    if(Var0 != 0)
    {
        message.Color = 0x0000FF;
        Message = "No mileage found in the dump";
        Distance = 0;
    }
    else
    {
	Var5 = (((@0x00 << 8)+@0x01) ^ 0xFFFF) << 5;
        message.Color = 0xFF0000;
        message = "File contains binary data";
        Distance =  Var5;
    }
}

OnApply
{
   Var5 = 0;
    Var2 = Distance;
    Var7 = Var2 >> 5 & 65535 ^ 0xFFFF;
    if(Var2 > 999900) {Var5 = 1;}
    if(Var2 < 100)   {Var5 = 1;}
    if(Var5 != 0)
    {
        message.Color = 0x0000FF;
        message.Bold = 1;
        message = "Value должен быть от 100 до 999900 км";
    }
    else
    {
        Var3 = 0x00;
        while(Var3 != 0x20)
        {
            
            @Var3 = Var7 >> 8 & 255;
            @Var3.mismatch = 1;
            Var3 = Var3 + 1;
            @Var3 = Var7 & 255;
            @Var3.mismatch = 1;
            Var3 = Var3 + 1;
            Var6 = Var7 * 2;
            Var7 = (Var6 >> 16 + Var6) & 65535;
            message.Color = 0xFF0000;
            message.Bold = 1;
            message = "Новый Value записан.";
        }
        Var3 = 0x20;
        while(Var3 != 0x40)
        {
            
            @Var3 = Var7 >> 8 & 255;
            @Var3.mismatch = 1;
            Var3 = Var3 + 1;
            @Var3 = Var7 & 255;
            @Var3.mismatch = 1;
            Var3 = Var3 + 1;
            Var6 = Var7 * 2;
            Var7 = (Var6 >> 16 + Var6) & 65535;
            message.Color = 0xFF0000;
            message.Bold = 1;
            message = "Новый Value записан.";
        }
    
   }
}
