Keyboard Shortcuts
ctrl + shift + ? :
Show all keyboard shortcuts
ctrl + g :
Navigate to a group
ctrl + shift + f :
Find
ctrl + / :
Quick actions
esc to dismiss
Likes
Search
WHERE USED doesn't find sensors located in setSensorState statements
#logixng
I have LogixNG statements using? Digital Formula: setSensorState("69-RWKE",getSensorState("69W-R")).? ?When using WHERE USED to find either of these sensor terms, these instances don't show up.? I assume this is also true for the other getX/SetX functions.? Is this a capability that can be added to WHERE USED in a future release??
?
--
Jim Moomaw Portland, OR - Willamette Model Railroad Club (WMRC) - NMRA, Pacific NW |
Jim, The Where Used looks for instances of an object, such as a sensor. ?The Digital Formula statements create temporary instances as needed when the text is executed. ? It might be possible to extend the Where Used to also do a string search on the formula text. Dave Sand ----- Original message ----- From: "Jim Moomaw - PDX via groups.io" <JMOOMAW_COM=[email protected]> Subject: [jmriusers] WHERE USED doesn't find sensors located in setSensorState statements Date: Thursday, May 29, 2025 3:38 AM I have LogixNG statements using? Digital Formula: setSensorState("69-RWKE",getSensorState("69W-R")).? ?When using WHERE USED to find either of these sensor terms, these instances don't show up.? I assume this is also true for the other getX/SetX functions.? Is this a capability that can be added to WHERE USED in a future release?? ? -- Jim Moomaw Portland, OR - Willamette Model Railroad Club (WMRC) - NMRA, Pacific NW |
Jim, Maybe something like this: LogixNG: Simulate E-14 Signal Mast Logic ?? ConditionalNG: Milw East Bound ????? ! A ???????? If Then Else. Always execute ??????????? ! Then ?????????????? If Then Else. Always execute ????????????????? ! Then ???????????????????? If Then Else. Always execute ??????????????????????? ? If ?????????????????????????? And. Evaluate All ????????????????????????????? ? E1 ???????????????????????????????? Turnout T-Hopkins-West is Closed?? <<==== ??????????????????????? ? Else_If_1 ?????????????????????????? And. Evaluate All ????????????????????????????? ? E1 ???????????????????????????????? Turnout T-Hopkins-West is Thrown?? <<==== ?? ConditionalNG: Milw West Bound ????? ! A ???????? If Then Else. Always execute ??????????? ! Then ?????????????? Many ????????????????? ! A3 ???????????????????? If Then Else. Always execute ??????????????????????? ! Then ?????????????????????????? If Then Else. Always execute ????????????????????????????? ? If ???????????????????????????????? Turnout T-Hopkins-West is Closed?? <<==== ????????????????????????????? ? Else_If_1 ???????????????????????????????? Turnout T-Hopkins-West is Thrown?? <<==== ?? ConditionalNG: Milw West Turnout ????? ! A ???????? If Then Else. Execute on change ??????????? ! Then ?????????????? Set turnout T-Hopkins-West to state Closed?? <<==== ??????????? ! Then_1 ?????????????? Set turnout T-Hopkins-West to state Thrown?? <<==== ?? ConditionalNG: Test formula ????? ! A ???????? Many ??????????? ! A1 ?????????????? Digital Formula: test = getTurnoutState("T-Hopkins-West")?? <<==== Dave Sand ----- Original message ----- From: Dave Sand <ds@...> To: "[email protected]" <[email protected]> Subject: Re: [jmriusers] WHERE USED doesn't find sensors located in setSensorState statements Date: Thursday, May 29, 2025 10:41 AM Jim, The Where Used looks for instances of an object, such as a sensor. ?The Digital Formula statements create temporary instances as needed when the text is executed. ? It might be possible to extend the Where Used to also do a string search on the formula text. Dave Sand ----- Original message ----- From: "Jim Moomaw - PDX via groups.io" <JMOOMAW_COM=[email protected]> Subject: [jmriusers] WHERE USED doesn't find sensors located in setSensorState statements Date: Thursday, May 29, 2025 3:38 AM I have LogixNG statements using? Digital Formula: setSensorState("69-RWKE",getSensorState("69W-R")).? ?When using WHERE USED to find either of these sensor terms, these instances don't show up.? I assume this is also true for the other getX/SetX functions.? Is this a capability that can be added to WHERE USED in a future release?? ? -- Jim Moomaw Portland, OR - Willamette Model Railroad Club (WMRC) - NMRA, Pacific NW |
Jim, PR #14140 has been created to implement searching formulas. Dave Sand ----- Original message ----- From: Dave Sand <ds@...> To: "[email protected]" <[email protected]> Subject: Re: [jmriusers] WHERE USED doesn't find sensors located in setSensorState statements Date: Thursday, May 29, 2025 1:19 PM Jim, Maybe something like this: LogixNG: Simulate E-14 Signal Mast Logic ?? ConditionalNG: Milw East Bound ????? ! A ???????? If Then Else. Always execute ??????????? ! Then ?????????????? If Then Else. Always execute ????????????????? ! Then ???????????????????? If Then Else. Always execute ??????????????????????? ? If ?????????????????????????? And. Evaluate All ????????????????????????????? ? E1 ???????????????????????????????? Turnout T-Hopkins-West is Closed?? <<==== ??????????????????????? ? Else_If_1 ?????????????????????????? And. Evaluate All ????????????????????????????? ? E1 ???????????????????????????????? Turnout T-Hopkins-West is Thrown?? <<==== ?? ConditionalNG: Milw West Bound ????? ! A ???????? If Then Else. Always execute ??????????? ! Then ?????????????? Many ????????????????? ! A3 ???????????????????? If Then Else. Always execute ??????????????????????? ! Then ?????????????????????????? If Then Else. Always execute ????????????????????????????? ? If ???????????????????????????????? Turnout T-Hopkins-West is Closed?? <<==== ????????????????????????????? ? Else_If_1 ???????????????????????????????? Turnout T-Hopkins-West is Thrown?? <<==== ?? ConditionalNG: Milw West Turnout ????? ! A ???????? If Then Else. Execute on change ??????????? ! Then ?????????????? Set turnout T-Hopkins-West to state Closed?? <<==== ??????????? ! Then_1 ?????????????? Set turnout T-Hopkins-West to state Thrown?? <<==== ?? ConditionalNG: Test formula ????? ! A ???????? Many ??????????? ! A1 ?????????????? Digital Formula: test = getTurnoutState("T-Hopkins-West")?? <<==== Dave Sand ----- Original message ----- From: Dave Sand <ds@...> To: "[email protected]" <[email protected]> Subject: Re: [jmriusers] WHERE USED doesn't find sensors located in setSensorState statements Date: Thursday, May 29, 2025 10:41 AM Jim, The Where Used looks for instances of an object, such as a sensor. ?The Digital Formula statements create temporary instances as needed when the text is executed. ? It might be possible to extend the Where Used to also do a string search on the formula text. Dave Sand ----- Original message ----- From: "Jim Moomaw - PDX via groups.io" <JMOOMAW_COM=[email protected]> Subject: [jmriusers] WHERE USED doesn't find sensors located in setSensorState statements Date: Thursday, May 29, 2025 3:38 AM I have LogixNG statements using? Digital Formula: setSensorState("69-RWKE",getSensorState("69W-R")).? ?When using WHERE USED to find either of these sensor terms, these instances don't show up.? I assume this is also true for the other getX/SetX functions.? Is this a capability that can be added to WHERE USED in a future release?? ? -- Jim Moomaw Portland, OR - Willamette Model Railroad Club (WMRC) - NMRA, Pacific NW |
RE:? It might be possible to extend the Where Used to also do a string search on the formula text.
?
That's what I was thinking.? Using XML editors like NOTEPAD++ are not particularly helpful since they don't easily show which LogixNG statements/conditionals these strings are in.? ?You can use NOTEPAD to search the txt output files from PanelPro LogixNG editors, but that requires creating all of them first if you don't know where the terms are located.? Do-able, but slower.?
?
My initial confusion was not remembering how I was using these setX strings, and then not understanding how sensors were in fact being set when WHERE USED wasn't showing any specific set sensor statements.? Funny how quickly I forget the code written just a few months ago.
?
Is this something I should put in the github wishlist???
?
--
Jim Moomaw Portland, OR - Willamette Model Railroad Club (WMRC) - NMRA, Pacific NW |
Jim, The formula matches also show up in the standard Where Used. Dave Sand ----- Original message ----- From: "Jim Moomaw - PDX via groups.io" <JMOOMAW_COM=[email protected]> Subject: Re: [jmriusers] WHERE USED doesn't find sensors located in setSensorState statements #logixng Date: Thursday, May 29, 2025 3:39 PM Never mind my last post... you covered it. ? -- Jim Moomaw Portland, OR - Willamette Model Railroad Club (WMRC) - NMRA, Pacific NW |
?A decision needs to be taken on LogixNG comments containing sensor (or indeed other relevant) names. Should they, or should they not, be reported as used? I tend think they should, but it's a bit of a conundrum. Wouter On Thu, 29 May 2025 at 21:44, Dave Sand via <ds=[email protected]> wrote:
|
Wouter, Comments are not relevant to the operation of JMRI. ?The presence of a comment for a deleted sensor has no impact. Dave Sand ----- Original message ----- From: "whmvd via groups.io" <vandoornw=[email protected]> Subject: Re: [jmriusers] WHERE USED doesn't find sensors located in setSensorState statements #logixng Date: Thursday, May 29, 2025 4:03 PM ?A decision needs to be taken on LogixNG comments containing sensor (or indeed other relevant) names. Should they, or should they not, be reported as used? I tend think they should, but it's a bit of a conundrum. Wouter On Thu, 29 May 2025 at 21:44, Dave Sand via <ds=[email protected]> wrote:
|
Hi Dave, Yes, that is the one side of the argument. And it holds water. The other, though, is that something the user carefully documented is now going to be out of date. Which is something (s)he could or even should be interested in. It's something that, if I were to code it, I'd leave to the user via a checkbox in preferences. But, not being a user of LogixNG, I have no stake in this. Just thought I'd mention it. Wouter On Thu, 29 May 2025, 22:12 Dave Sand via , <ds=[email protected]> wrote:
|
Good point.? ?PanelPro searching tools end up being especially helpful since the alternatives are less so, especially when trying to figure out *where* the search terms are located.? ?The WHERE USED is pretty good at that for things it discovers.? The question here is what else do we wish it to discover?? ?Perhaps a checkbox for including "text" searches would be a way to control depth of output.? ??
--
Jim Moomaw Portland, OR - Willamette Model Railroad Club (WMRC) - NMRA, Pacific NW |
to navigate to use esc to dismiss