Home AMX User Forum NetLinx Studio

Channel selection TP display

I have noticed a channel selection text display on several of the TP files that I have downloaded. I understand that with the IP/232 control over some of the Satellite receivers, the text field can be propagated with the current channel. I was wondering, is there a way to propagate that field with the channel numbers as they are entered, and then upon an Enter button selection, the entire string (in this case, channel 501 for example) can be sent? I was thinking about how clients of mine have a hard time using touchscreen numerics, because they are constantly looking between the TP and the screen, to be sure they entered the correct digit. I'm thinking that perhaps an integer array of 3 fields, assuming a maximum 3 digit channel entry, would be able to handle this.

Comments

  • ericmedleyericmedley Posts: 4,177
    vegastech wrote: »
    I have noticed a channel selection text display on several of the TP files that I have downloaded. I understand that with the IP/232 control over some of the Satellite receivers, the text field can be propagated with the current channel. I was wondering, is there a way to propagate that field with the channel numbers as they are entered, and then upon an Enter button selection, the entire string (in this case, channel 501 for example) can be sent? I was thinking about how clients of mine have a hard time using touchscreen numerics, because they are constantly looking between the TP and the screen, to be sure they entered the correct digit. I'm thinking that perhaps an integer array of 3 fields, assuming a maximum 3 digit channel entry, would be able to handle this.

    I ran into this. It gets a little dicey when a DVR is involved and the client needs to enter in a couple numbers from the keypad or whatnot.

    What I do is create a favorites page with about 50 or so buttons. They can be set by the user but come prepopulated with some common selections. Each button gets a number stored to it and/or a graphic for the channel/network. To set they type a number and press-n-hold. That way I know for a fact they are typing in a channel number.
  • Neato. So how many variables should I need to accomplish this? I am trying to code it like this:
    BUTTON_EVENT[dvCV7Tp2, 10]
    BUTTON_EVENT[dvCV7Tp2, 11]
    BUTTON_EVENT[dvCV7Tp2, 12]
    BUTTON_EVENT[dvCV7Tp2, 13]
    BUTTON_EVENT[dvCV7Tp2, 14]
    BUTTON_EVENT[dvCV7Tp2, 15]
    BUTTON_EVENT[dvCV7Tp2, 16]
    BUTTON_EVENT[dvCV7Tp2, 17]
    BUTTON_EVENT[dvCV7Tp2, 18]
    BUTTON_EVENT[dvCV7Tp2, 19]
    {
    	PUSH:
    	{
    		
    		LOCAL_VAR integer nChannel
    		FOR (nChannel=0;nChannel<4;nChannel++)
    		{
    			
    			SWITCH(nChannel)
    			{
    				CASE 1:
    				{
    					SAT_CHANNEL_ARRAY[1] = BUTTON.INPUT.CHANNEL-10
    				}
    				CASE 2:
    				{
    					SAT_CHANNEL_ARRAY[2] = BUTTON.INPUT.CHANNEL-10
    				}
    				CASE 3:
    				{
    					SAT_CHANNEL_ARRAY[3] = BUTTON.INPUT.CHANNEL-10
    					
    					PULSE[dvSAT,SAT_CHANNEL_ARRAY[1]]
    					PULSE[dvSAT,SAT_CHANNEL_ARRAY[2]]
    					PULSE[dvSAT,SAT_CHANNEL_ARRAY[3]]
    				}
    			}
    		}
    	}
    }
    
    SAT_CHANNEL_ARRAY is a 3 field array, as I am assuming a maximum of 3 digits to be entered(at least to start). I have gone for a switch-case as that was the first option that came into my head when it comes to propagating multiple sections of an array. The big problem I am having now is that when I press any numeric button, all 3 array items get propagated with the same number instead of each one individually, and also my nChannel variable starts at 0, but then with the first press, it jumps to 4. Something is wrong with my For loop...
  • This code would be under the channel buttons.
    SAT_ARRAY[1]=SAT_ARRAY[2]
    SAT_ARRAY[2]=SAT_ARRAY[3]
    SAT_ARRAY[3]=TYPE_CAST(ITOA(BUTTON.INPUT.CHANNEL-10))
    SEND_COMMAND BUTTON.INPUT.DEVICE,"'@TXT',1,SAT_ARRAY"
    

    This will assign the array as they enter it and update the text field you have for it. I store it as a CHAR arrary, makes it easier when updating the touchpanel.

    You will need a clear button:
    SAT_ARRAY='    '
    SEND_COMMAND BUTTON.INPUT.DEVICE,"'@TXT',1,SAT_ARRAY"
    

    Then an enter button when you are done.
    SEND_COMMAND SAT, "'SP',(TYPE_CAST(SAT_ARRAY[1])+10)"
    SEND_COMMAND SAT, "'SP',(TYPE_CAST(SAT_ARRAY[2])+10)"
    SEND_COMMAND SAT, "'SP',(TYPE_CAST(SAT_ARRAY[3])+10)"
    SEND_COMMAND SAT, "'SP',50"
    SAT_ARRAY='    '
    SEND_COMMAND BUTTON.INPUT.DEVICE,"'@TXT',1,SAT_ARRAY"
    

    However you do it, you will want to use the SP command (stacked pulse) rather then pulse. Each pulse will override the last, the SP command wait until the last one is finished before sending the next. You could also use an XCM command with the CHAR array if you wanted to.

    Kevin D.
  • Here's another thought on doing this...
    This way you have txt on the touch panel. The number dials if you wait 3 seconds or press 3 digits. The beauty is using an array of txt numbers to dial presets. Like presets[] = {'123',254','326')
    DEFINE_VARIABLE
    
    integer nChannelBTN[] = {10,1,2,3,4,5,6,7,8,9}
    char Channel_text[3]
    
    
    define_function integer functionDialChannel(char channelNUM[3])
    {
      local_var integer numsize,count
    
      numsize = length_string(channelNUM) + 1
      for (count = 1;count < numsize;count++)
    	{
    	  send_command dvDSS,"'SP',atoi(channelNUM)+10"
    	}
     send_command dvDSS,"'SP',21" //enter
    }
    
    button_event[dvTP,nChannelBTN]
    {
      push:
    	{
    	  Channel_text = "Channel_text,itoa(get_last(nChannelBTN)-1)"
    		send_command dvTP,"'TEXT100-',Channel_text"
    		cancel_wait 'channelWT'
    		wait 30 'channelWT'
    		{
    		  functionDialChannel(Channel_text)
    			set_length_string(Channel_text,0)
    		}
    		if (length_string(Channel_text)= 3)
    		{
    		  functionDialChannel(Channel_text)
    			set_length_string(Channel_text,0)
    			cancel_wait 'channelWT'
    		}
    	}
    }
    
    
  • patbpatb Posts: 140
    Why not use the XCH command to send out all 3 digits at once? If you are entering numbers from a keypad you just need ONE variable to store the current number (nCurNum). If you are doing presets store them all in an array, then set nCurNum = arrayvalue of whatever preset you want and send it the say way using XCH. Much simpler to do that you are making it out to be. Send the same nCurNum back to the panel with a text command.

    PM me if you have any specific questions.
  • Good point! I've used XCH also...
  • DHawthorneDHawthorne Posts: 4,584
    It's not uncommon anymore for there to be 4-digit channel numbers. The latest device and master firmwares will handle this in XCH now. However, it is also getting common to require a . in the channel number, or sometimes a - . I don't think XCH handles that yet.
Sign In or Register to comment.