Home AMX User Forum AMXForums Archive Threads Tips and Tricks
Options

Changing Port numbers in TPD4

Reposted here. Thanks and credit to Hedberg.
Hedberg wrote:
As for fixing your address port thing, TPD4 has a very powerful replace feature which makes this a 20 second problem.

1. copy your template project into one you won't miss if it gets fouled and open in TPD4

2. Menu: Edit -- Item: find&replace.

3. in left colomn, check "address port" and enter the port number you want to overwrite; i.e. '1'

4. in the right column, check "address port" and enter the new address port number; e.g.20.

5. make sure "search scope" is the entire panel (or current page if that's what you want).

6. Click "replace all" or "find next" if you want to approve each overwrite.

7. Have a beer.

That's it.

I can't recall which on-line training session it was -- probably the one about modules -- but Paul Bohnsack pointed out this feature during the session. Made the session more than worthwhile -- much more.

Comments

  • Options
    mpullinmpullin Posts: 949
    Create a port for favorites

    Here's a related trick that I came up with. Let's say you have 40-50 buttons for favorites (TV, Radio, whatever) and you're looking to minimize your code writing. Pick a port you're not using for anything else, say, 3.

    Using the above mentioned trick, change the channel port of all your favorite buttons to that number.

    Then for each button, change the channel code for each favorite button to the channel that favorite is (hopefully you don't have any dashes or dots or you'll need to adjust the technique a little). For instance a button that says Ethel (XM Radio station) would now have Channel Port 3 and Channel Code 47.

    Now for the fun part. In your code create a new device like this:
    dvTP = 10020:1:0 // this is your normal touchpanel
    dvTP_xmFAV = 10020:3:0 // <-- add this device
    
    And in your define_event section:
    BUTTON_EVENT[dvTP_xmFAV,0]{
    PUSH: SEND_COMMAND vdvXM, "'TUNE=',itoa(BUTTON.INPUT.CHANNEL)";
    }
    
  • Options
    flcusatflcusat Posts: 309
    mpullin wrote:
    Here's a related trick that I came up with. Let's say you have 40-50 buttons for favorites (TV, Radio, whatever) and you're looking to minimize your code writing. Pick a port you're not using for anything else, say, 3.

    Using the above mentioned trick, change the channel port of all your favorite buttons to that number.

    Then for each button, change the channel code for each favorite button to the channel that favorite is (hopefully you don't have any dashes or dots or you'll need to adjust the technique a little). For instance a button that says Ethel (XM Radio station) would now have Channel Port 3 and Channel Code 47.

    Now for the fun part. In your code create a new device like this:
    dvTP = 10020:1:0 // this is your normal touchpanel
    dvTP_xmFAV = 10020:3:0 // <-- add this device
    
    And in your define_event section:
    BUTTON_EVENT[dvTP_xmFAV,0]{
    PUSH: SEND_COMMAND vdvXM, "'TUNE=',itoa(BUTTON.INPUT.CHANNEL)";
    }
    

    In this example; Do you need to map the panel to both the dvTP and the dvTP_xmFAV?.
  • Options
    viningvining Posts: 4,368
    flcusat wrote:
    In this example; Do you need to map the panel to both the dvTP and the dvTP_xmFAV?.
    I personally don't map anything except the occasional IR file for the initial IR file transfer. I send TPD4 files to TPs direct from TPD4, IR files from IREdit and when I compile new code I just check the box for code files and send only the new program not the entire system.

    Mapping is just a map of what files go where and most of the time you only want to send one file, a new TP file to a particular panel, a new IR file to a particular port or the a new program to the master.
  • Options
    flcusatflcusat Posts: 309
    vining wrote:
    I personally don't map anything except the occasional IR file for the initial IR file transfer. I send TPD4 files to TPs direct from TPD4, IR files from IREdit and when I compile new code I just check the box for code files and send only the new program not the entire system.

    Mapping is just a map of what files go where and most of the time you only want to send one file, a new TP file to a particular panel, a new IR file to a particular port or the a new program to the master.

    I understand. Thanks.
  • Options
    jjamesjjames Posts: 2,908
    mpullin wrote:
    Here's a related trick that I came up with.
    I've been using this technique for a couple of years now. I've been asked where I saw / how I came up with it, and I honestly tell them that I don't remember. So if you're laying claim to this, I can now tell them it was from you!!! :D Finally!!
  • Options
    mpullinmpullin Posts: 949
    jjames wrote:
    I've been using this technique for a couple of years now. I've been asked where I saw / how I came up with it, and I honestly tell them that I don't remember. So if you're laying claim to this, I can now tell them it was from you!!! :D Finally!!

    Well, I *did* come up with it myself, so I'm laying claim to this method until someone comes along who claims to have done it first. In which case we'll take it to small claims court :p
Sign In or Register to comment.