Home AMX User Forum AMX General Discussion

Text feedback

When I went to RMS training, a fellow student was wondering if there was a way to get text that was populated in a text field on a touch panel back from the touch panel for comparison. Example, say you're using a request module, the module will send song info, title, etc to various text boxes on the panel. Once that text box is populated, can you find out by coding what text is populating the text box after it's been sent? Obviously, a good programmer will have a structure or other variable arrays to keep/manage this information before sending out to a panel. In using a module, most of the time you don't have the luxury of looking at the comm portion of the module to see how this information is being sent. Or say you are new to the project and you just want to find out what text is in a particular variable text box at any given time.

My understanding is that there really isn't a way to "leech" the text back from the panel once it's been sent. You can use a virtual device to capture any messages between the module and the panel and then re-route or manage differently which imo would be the best way. Any thoughts?

Comments

  • ericmedleyericmedley Posts: 4,177
    When I went to RMS training, a fellow student was wondering if there was a way to get text that was populated in a text field on a touch panel back from the touch panel for comparison. Example, say you're using a request module, the module will send song info, title, etc to various text boxes on the panel. Once that text box is populated, can you find out by coding what text is populating the text box after it's been sent? Obviously, a good programmer will have a structure or other variable arrays to keep/manage this information before sending out to a panel. In using a module, most of the time you don't have the luxury of looking at the comm portion of the module to see how this information is being sent. Or say you are new to the project and you just want to find out what text is in a particular variable text box at any given time.

    My understanding is that there really isn't a way to "leech" the text back from the panel once it's been sent. You can use a virtual device to capture any messages between the module and the panel and then re-route or manage differently which imo would be the best way. Any thoughts?
    the way you describe is probably the best way. Make an interceding virtual device.
  • viningvining Posts: 4,368
    BCalderwood wrote:
    My understanding is that there really isn't a way to "leech" the text back from the panel once it's been sent.
    The act of querying a TP to obtain the current variable text would be as demanding on the proecssor as just sending the variable text which is why they probably don't have a method for doing it.

    The best way to track what was sent is as you said to create a structure or array and just refer to that for comparisions. The issues you pose with locked modules is another reason most of us don't like using them but VT to the panels is usually in the open UI module. I guess if it wasn't you could as you suggest track the strings yourself by passing the module a virtuall device instead of the real device so you could intercept and route the modules device string yourself but writing your own module wouldn't be much more difficult and a heck of alot cleaner.
  • Joe HebertJoe Hebert Posts: 2,159
    CUSTOM_EVENT
    My understanding is that there really isn't a way to "leech" the text back from the panel once it's been sent.
    You have the option to use CUSTOM_EVENTs to extract some of the current button properties including the button text. Aside from the text you can also grab properties such as the current bitmap name, icon name, font, and colors to name a few.

    I attached some CUSTOM_EVENT sample code. It?s not my code and I don?t remember where it originated but I think I got it from the forum.
  • viningvining Posts: 4,368
    Joe Hebert wrote:
    You have the option to use CUSTOM_EVENTs to extract some of the current button properties including the button text
    But isn't that just the button text that you input in TPD4 when creating the button as assigned in the states text field and not variable text sent to the address channel?
  • Joe HebertJoe Hebert Posts: 2,159
    vining wrote: »
    But isn't that just the button text that you input in TPD4 when creating the button as assigned in the states text field and not variable text sent to the address channel?
    Nope, it?s the real deal real-time text that you see on the screen. I just wrote a quick test that queries the current text and the bitmap name of a button that is loaded in my TP and the CUSTOM_EVENT works as advertised. Pretty cool. :cool:
  • viningvining Posts: 4,368
    Interesting! So it is indeed possible to query the panel to determine if the VT fields are in need of an update. Not sure when that would ever be useful but knowing it's possible should it ever be needed is cool indeed.
  • Joe HebertJoe Hebert Posts: 2,159
    Right, I don?t see that as useful or practical looking at it from that angle either. But I?m intrigued enough to want to find a reason to ask for properties like text, bitmap name, icon index, and the rest. Seems like a cool thing to do, even cooler if I knew why I?d want to do it. :)
  • mpullinmpullin Posts: 949
    Joe Hebert wrote: »
    Right, I don?t see that as useful or practical looking at it from that angle either. But I?m intrigued enough to want to find a reason to ask for properties like text, bitmap name, icon index, and the rest. Seems like a cool thing to do, even cooler if I knew why I?d want to do it. :)
    Say you have some really convoluted module such as the MAX that you don't really want to dive into and see when what is getting sent to where. This could be an alternative to the "man in the middle virtual device" approach taken above. Just find the field you're interested in and pull from it, say, if you want to display the title of the movie currently playing on some other page in your interface.

    Of course, this is probably a bad example since you need a man in the middle with the MAX anyway to prevent it from spawning its popups all over your main interface. But you get the point.
  • Spire_JeffSpire_Jeff Posts: 1,917
    The only problem I have with that example is that there is more network based traffic involved and on first thought, more processing required than a simple middle man device. But that's just my first thought :)

    Jeff
  • That is exactly what I was wondering. Thx guys! I was curious because:
    1- I didn't know
    2- There was one situation with the early version of a Sirius module where it wasn't updating text feedback often enough and I could tell the module to send again. I was thinking of ways to just send it conditionally and more of a stop gap solution. By the time I got around to working on it, another version of the module came out that fixed the problem. After hearing about it in RMS class and running into a situation where I could have used it made me wonder even more if it was possible. Now, I know it is.

    It's like you know there is candy in your cupboard but you can't find it. It nags you until you figure the mystery out. LOL Anyways....
  • mpullinmpullin Posts: 949
    Do the CUSTOM_EVENTs fire whenever the buttons in question are updated on that panel, or do they only fire when the panels are sent a ? query? I can't get mine to fire either way :(
  • Joe HebertJoe Hebert Posts: 2,159
    mpullin wrote: »
    Do the CUSTOM_EVENTs fire whenever the buttons in question are updated on that panel, or do they only fire when the panels are sent a ? query? I can't get mine to fire either way :(
    I haven’t played around with the custom events much but I’m relatively certain they only fire after a query. I tested the sample code that I attached above and it works fine on my end. Do you want to post some code for us to try?
  • mpullinmpullin Posts: 949
    Joe Hebert wrote: »
    I haven?t played around with the custom events much but I?m relatively certain they only fire after a query. I tested the sample code that I attached above and it works fine on my end. Do you want to post some code for us to try?
    Maybe later, I decided to switch back to the interceding virtual device method. The only real difference between my code and yours is in the CUSTOM_EVENT definition I passed an array of integers for the channel instead of a single integer. That, and I was doing my query manually in NS instead of in my program. It doesn't seem as practical as I first thought if you have to poll your panel.
  • yuriyuri Posts: 861
    mpullin wrote: »
    Do the CUSTOM_EVENTs fire whenever the buttons in question are updated on that panel, or do they only fire when the panels are sent a ? query? I can't get mine to fire either way :(

    The custom event only fires after a query. Make sure you set the address code correctly.
    I've tried to use it on a project, but found out it didn't update fast enough. I wanted to query 8 text boxes shortly after each other, but got in some problems doing so...
Sign In or Register to comment.