[Carradio\NISSAN\CT078 PN-1628M-N no immo]

Size(260,370);  

Form {
    	HexDigit(Code,"Code ",70,15,60,4);
    	CheckBox(ResetCounter,"Обнулить счётчик попыток",82,80);
	ComboBox(CodeRequest," SECURITY ",65,50,50,"On","Off");

	Group("Информация",5,155,250,50)	 
    {
        Label(message," ",0,22);		 
    }
    	Group("Описание",5,105,250,200) 	 
    {
        Label(lb1,"Code calculator for NISSAN :",0,15);
    	Label(lb2,"Model:  CT078  PN-1628M-N",32,30);
    	Label(lb3,"Sec. Type:  IMMO + CODE 4 dig",32,45);
	Label(lb4,"Manufacturen: CLARION.",32,60);
	Label(lb5,"Partnumer:  CL0394   28113 BN314",32,75);
    	Label(lb6,"MCU:  D78F4216GC124",32,90);
	Label(lb7,"EEPROM: 93LC46smd !!!rotated!!!",32,105);
	Label(lb8,"Sec.loc.: EEPROM",32,120);
    	Label(lb9,"Autor:  telik@ukrwest.net   2008",0,180);
    	Label(lb10,"Enter code: кнопками 1,2,3,4 подтверж.^",32,135);
    }
	Picture(Logo,"nissan.bmp",180,10,0,0);
    {
        Label(msg," ",0,310);				 
    } 
}


OnShow {
	msg.Color=0x0000FF; msg.Bold=1; msg="http://www.eeprom.lg.ua";				
        	  
    	var0=1;
    	if(@0x00!=0xAA){Var0=0;} if(@0x01!=0xAA){Var0=0;}	
    	if(var0=0){message.Color=0x0000FF; message.Bold=1; message="Неверный дамп !"; Code=0;}
    else
    {
	var1=@0x02; var2=@0x03; var2=var2<<8;
	Code=var2|var1;
	
	ResetCounter=0;
	if(@0x04!=0x00){ResetCounter=1;}     
		
	CodeRequest=1; 
    	if(@0x06!=0x02){CodeRequest=0;}

	message.Color=0xFF0000; message.Bold=1;	message="Дамп ОК.";
    }
}

OnApply {
	var0=1;
    	if(@0x00!=0xAA){Var0=0;} if(@0x01!=0xAA){Var0=0;}	
    	if(var0=0){message.Color=0x0000FF; message.Bold=1; message="Неверный дамп! Запись прекращена!"; Code=0;}
    else
    {
	if(ResetCounter=1){@0x04=0x00;} 
	if(CodeRequest=1){@0x06=0x02;}
    	if(CodeRequest=0){@0x06=0x01;}
	message.Color=0xFF0000; message.Bold=1;	message="Попытки и запрос IMMO успешно изменены.";
    }
}
