[Carradio\BECKER\TRAFFIC PRO HIGH SPEED  BE7825]

Size(310,470);  

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

	Group("Идентификация",5,105,300,45)		
    {
        Label(sn," ",65,20); 				  
    }
	Group("Информация",5,155,300,50)		
    {
        Label(message," ",0,22);			 
    }
    	Group("Описание",5,205,300,200) 		
    {
        Label(lb1,"Code calculator for BECKER :",0,15);
    	Label(lb2,"Model:  TRAFFIC PRO HIGH SPEED",32,30);
    	Label(lb3,"Sec. Type:  CODE 11111-66666",32,45);
	Label(lb4,"Manufacturen: BECKER.",32,60);
	Label(lb5,"Partnumer:  BE7825",32,75);
    	Label(lb6,"MCU:  SAFC161CI32F-16F  ",32,90);
	Label(lb7,"EEPROM:  24LC04 smd",32,105);
	Label(lb8,"Sec.loc.: EEPROM",32,120);
    	Label(lb9,"Autor:  telik@ukrwest.net   2008",0,180);
    	Label(lb10,"Enter code: ",32,135);
    }
	Picture(Logo,"becker.bmp",210,10,0,0);
    {
        Label(msg," ",0,410);				
    } 
}


OnShow {
	msg.Color=0x0000FF;						 
        msg.Bold=1;							 
	msg="http://www.eeprom.lg.ua";				
        
	message.Bold = 1;  
    	Var0 = 1;
    	if(@0x0AA != 0x37) { Var0 = 0;}	
    	if (Var0 = 0)
    {
        message.Color = 0x0000FF;
        Message = "Неверный дамп ! ";
        Code = 0;
    }
    else
    {
	var1 = @0x094 ;
	var2 = @0x095 ;
	var3 = @0x096 ;
	var4 = var1 ^ 0xAA ;
	var5 = var2 ^ 0xAA ;
	var6 = var3 ^ 0xAA ;
	var4 = var4 << 12 ;
	var5 = var5 << 4 ;
	var6 = var6 >> 4 ;
	var7 = @0x09B;
	if(var7 != 0xA9) { ResetCounter = 1; }     
	message.Color = 0xFF0000;
    	message.Bold = 1;
    	message = "  Дамп ОК. ";
	sn = "Serial No.: "+#c.@0x0e1+#c.@0x0e2+#c.@0x0e3+#c.@0x0e4+#c.@0x0e5+#c.@0x0e6+#c.@0x0e7;
    	Code = var4 | var5 | var6 ;
   }
}

OnApply {
	Var0 = 1;
    	if(@0x0AA != 0x37) { Var0 = 0;}	
    	if (Var0 = 0)
    	{
        message.Color = 0x0000FF;
        Message = "Неверный дамп! Запись прекращена!";
        Code = 0;
 	}
    else
    	{
	if(ResetCounter = 1) { @0x09B = 0xA9; } 
	if(ResetCounter = 1) { @0x0A0 = 0xAA; }
	message.Color = 0xFF0000;
        message.Bold = 1;
       	message = "Счётчик попыток успешно изменён.";
    }
}
