Home AMX User Forum NetLinx Studio
Options

Video Conference

I got a touchpanel on Video Conference application on the touchpanel. I wonder how can I collect the phone number from the panel?

Also I'd like to save the phone number on AMX. I wonder how to save it so I still have the when the phone number when AMX is rebooted.

Comments

  • Options
    DHawthorneDHawthorne Posts: 4,584
    I have not done a lot of conference rooms, so I can't suggest how to collect the phone number in the first place, but when you have it, store it in a variable tagged with the PERSISTENT keyword and it will survive both reboots and a new program load. If you only want it to survive a reboot, that is the default, though you could tag it with NON_VOLATILE if you like. similarly, if you need it to clear when you reboot, declare it VOLATILE. IN any but the PERSISTENT declaration, you can't initialize the variable, or the initialization will override it. PERSISTENT ignores initializations.
  • Options
    AMXJeffAMXJeff Posts: 450
    This is one way you can do it, use persistent to hold onto your data even after a download.
    //////////////////////////////////////////////
    DEFINE_DEVICE
    
    dvTP = 10001:1:0
    
    DEFINE_VARIABLE
    
    // PHONE STORAGE
    VOLATILE CHAR cPhoneNumber[25];
    
    // PHONEBOOK, STORES
    PERSISTENT CHAR cPhoneNumbers[10][25];
    
    
    // KEYPAD BUTTONS
    VOLATILE INTEGER nDialPad[] = 
    {
    	100,															// DIGIT 0
    	101,															// DIGIT 1
    	102,															// DIGIT 2
    	103,															// DIGIT 3
    	104,															// DIGIT 4
    	105,															// DIGIT 5
    	106,															// DIGIT 6
    	107,															// DIGIT 7
    	108,															// DIGIT 8
    	109,															// DIGIT 9
    	110,															// DIGIT *
    	111, 															// DIGIT #
    	112,															// CLEAR
    	113																// BACKSPACE
    }                                        
    
    
    VOLATILE INTEGER nPresetStoresBtns[] = 
    {
    	200,															// PRESET 1
    	201,															// PRESET 2
    	202,															// PRESET 3
    	203,															// PRESET 4
    	204,															// PRESET 5
    	205,															// PRESET 6
    	206,															// PRESET 7
    	207,															// PRESET 8
    	208,															// PRESET 9
    	209																// PRESET 10
    }
    
    DEFINE_EVENT
    
    
    BUTTON_EVENT[dvTP,nDialPad]
    {
    	PUSH:
    	{
    		STACK_VAR INTEGER nIndex;
    		
    		nIndex = GET_LAST(nDialPad);
    		
    		SWITCH (nIndex)
    		{
    			CASE 1:		// DIGIT 0
    			CASE 2:		// DIGIT 1
    			CASE 3:		// DIGIT 2
    			CASE 4:		// DIGIT 3
    			CASE 5:		// DIGIT 4
    			CASE 6:		// DIGIT 5
    			CASE 7:		// DIGIT 6
    			CASE 8:		// DIGIT 7
    			CASE 9:		// DIGIT 8
    			CASE 10:	// DIGIT 9
    			{
    				// Concatentation of Digits
    				cPhoneNumber = "cPhoneNumber,ITOA(nIndex - 1)"
    				
    				// Sends Text to TP for Display
    				SEND_COMMAND dvTP,"'!T',1,cPhoneNumber"
    			}
    			CASE 11:		// DIGIT *
    			{
    				// Concatentation of Digits
    				cPhoneNumber = "cPhoneNumber,'*'"
    				
    				// Sends Text to TP for Display
    				SEND_COMMAND dvTP,"'!T',1,cPhoneNumber"
    			}
    			CASE 12:	// DIGIT #
    			{
    				// Concatentation of Digits
    				cPhoneNumber = "cPhoneNumber,'#'"
    				
    				// Sends Text to TP for Display
    				SEND_COMMAND dvTP,"'!T',1,cPhoneNumber"
    			}		
    			CASE 13:	// CLEAR
    			{
    				cPhoneNumber = ""
    				
    				// Sends Text to TP for Display
    				SEND_COMMAND dvTP,"'!T',1,cPhoneNumber"
    			}		
    			CASE 14:	// BACKSPACE
    			{
    				// Concatentation of Digits
    				SET_LENGTH_STRING(cPhoneNumber,LENGTH_STRING(cPhoneNumber) - 1);
    				
    				// Sends Text to TP for Display
    				SEND_COMMAND dvTP,"'!T',1,cPhoneNumber"
    			}	
    		}            		
    	}
    }
    
    
    BUTTON_EVENT[dvTP,nPresetStoresBtns]
    {
    	PUSH:
    	{
    		STACK_VAR INTEGER nIndex;
    		
    		nIndex = GET_LAST(nPresetStoresBtns);
    		
    		// Stores the PhoneNumber from above keypad.
    		cPhoneNumbers[nIndex] = cPhoneNumber
    	}
    }
    
Sign In or Register to comment.