WD and Projector Information, return string formatting

Moderator: Moderator Group

WD and Projector Information, return string formatting

Postby dlupfer » Sun Feb 04, 2018 5:03 am

I am having a little struggle with Widget Designer for Pandora and hope ya'll are able to point me in the right direction. I have a Projector Control Node, I have the connection working and am able to have buttons that can operate the shutters and lamp on/off. My problem is information. I want to be able to display information in a clean way. For example, the projector returns "%1LAMP=65 1 75 1 64 1 65 1" for the hours on the 4 lamps. Ideally I'd like to be able to manipulate the string a bit so I can put the hours in a orderly format.(Lamp 1 = 65hrs, Lamp 2 = 75hrs) Also, the 1's between the hours turn into 0's or 2's depending on lamp status. Second part of the question, if I pull a query to say status of power or shutter it will return some other strings which I would want to format down to display a indicator light or something for the operator showing that the projector is on/off.

Long story short, the question come down to string manipulation and how to extract pieces and parts into variables. From there I believe I can do If statements and conditional formatting to get the result I am after, I've just hit a wall with this element and getting data.

Thank you for any help or pointers,


--Dan
dlupfer
 
Posts: 3
Joined: Sun Feb 04, 2018 4:58 am

Re: WD and Projector Information, return string formatting

Postby Thomas Mrozek » Mon Feb 05, 2018 11:23 am

Hi Dan,
best way to manipulate text are the 'text filter nodes'.

Most helpful for you will be the 'split text' filter node, as you can separate incoming strings into different single values. The same you can do directly in the 'TCP input node' by using the 'split' ascii and raising the amount of outputs (count). But if you are getting different strings with different splits the way menetioned before is the one for you.

cheers
Thomas
Thomas Mrozek
Product Manager
User avatar
Thomas Mrozek
 
Posts: 138
Joined: Mon Apr 20, 2009 11:08 am

Re: WD and Projector Information, return string formatting

Postby dlupfer » Tue Feb 06, 2018 4:56 pm

Thank you for your reply!


I was unaware the count changed the output on the nodes. So my end result is roughly as follows...


In projector controls in the "ASCII Response String Starts with", I have "%1LAMP". That makes the node only output "65 1 75 1 64 1 65 1", I don't get Shutter and Lamp messages outputted now.(Which still works for me)
I put in a Split Text in with the split field a "Space" and then set the count to 8.
Then I linked 4 Variable output nodes to pull data on 1,3,5,7 of the split for my lamp hours. And if I want to, split pieces 2,4,6,8 are my lamp statuses.


Thanks!


--Dan
dlupfer
 
Posts: 3
Joined: Sun Feb 04, 2018 4:58 am


Return to Widget Designer V4.7

Who is online

Users browsing this forum: No registered users and 18 guests

cron