[Carradio\FIAT\SCUDINO CC MID BP0371 no cancheck]
Size(310,460);  

Form {
    	HexDigit(Code,"Code ",70,15,100,4);
    	//CheckBox(ResetCounter,"Обнулить счётчик попыток",82,45);
	ComboBox(CodeRequest,"CANCHECK ",65,50,50,"On","Off");
	
	Group("Идентификация",5,75,300,40)	  
    {
        Label(part," ",40,20); 			
	
    }
    	Group("Информация",5,120,300,40)	 
    {
        Label(message," ",30,17);		 
    }
    	Group("Описание",5,165,300,220) 		 
    {
        Label(lb1,"Code calculator for FIAT :",0,15);
    	Label(lb2,"Model:  SCUDINO CC MID BP0371",32,30);
    	Label(lb3,"Sec. Type:  IMMO + CODE 1111-6666",32,45);
	Label(lb4,"Manufacturen: BLAUPUNKT.",32,60);
	Label(lb5,"Partnumer:  7 640 371 316 ",32,75);
    	Label(lb6,"MCU: MC68HC11PA8 (8925904781)",32,90);
	Label(lb7,"EEPROM:  24C08 smd",32,105);
	Label(lb8,"Sec.loc.:  MCU",32,120);
    	Label(lb9,"Autor:  telik@ukrwest.net   2008",0,200);
    	Label(lb10,"Enter code: ",32,135);
    }
	Picture(Logo,"fiat.bmp",210,10,0,0);
    {
        Label(msg," ",0,395);				 
    } 
}

OnShow {
        msg.Color = 0x0000FF;				 
        msg.Bold = 1;					 
	msg = "http://www.eeprom.lg.ua";		  
        
	message.Bold = 1;  
    	Var10 = 1;
    	if(@0x01 != 0x20) { Var10 = 0;}	
    	if (Var10 = 0)
    {
        message.Color = 0x0000FF;
        Message = "                Неверный дамп ! ";
        Code = 0;
    }
    else
    {  
	var1 = ((@0x02 & 0x0F) << 12);
	var2 = ((@0x02 & 0xF0) << 4);
	var3 = ((@0x03 & 0x0F) << 4);
	var4 = ((@0x03 & 0xF0) >> 4);	
        Code = var1 |var2 |var3 |var4; 
	
	message.Color = 0xFF0000;
    	message.Bold = 1;
    	message = "                     Дамп ОК. ";
	
	if(@0x04 = 0x00) { CodeRequest = 1; }  
    	if(@0x04 != 0x00) { CodeRequest = 0; } 
    }
}

OnApply {
	Var10 = 1;
    	if(@0x01 != 0x20) { Var10 = 0;}	
    	if (Var10 = 0) { message.Color = 0x0000FF; message = "Неверный дамп !  Запись прекращена !"; Code = 0; }
    else
    	{
	if(CodeRequest = 0) { @0x04 = 0xCF; @0x05 = 0x27; @0x06 = 0x1D; @0x13 = 0xCF; @0x14 = 0x27; @0x15 = 0x1D; @0x2C = 0xCF; @0x2D = 0x27; @0x2E = 0x1D;}
    	if(CodeRequest = 1) { @0x04 = 0x00; @0x05 = 0x00; @0x06 = 0x00; @0x13 = 0x00; @0x14 = 0x00; @0x15 = 0x00; @0x2C = 0x00; @0x2D = 0x00; @0x2E = 0x00;}
	message.Color = 0xFF0000;
        message.Bold = 1;
       	message = "Запрос CANCHECK успешно изменён.";
    }
}
