How to import 800 entries into Property Translation aspect
Hi Everyone,
I need to prepare mapping table between integer fault code and string description of particular fault to be shown at PG2 graphic. This mapping table should have 800 entries.
Is it possible to import 800 lines into the Property translation aspect in any way?
Or is there any more efficient solution ?
I consider to use Simple Scripting aspect.
Thank you for help in advance
Voted best answer
Just paste the 'table' directly into a PG2 text element.
Like this:
if evStatus = 1then"Status description 1"
else if evStatus = 2then"Status description 2"
else if evStatus = 3then"Status description 3"
else if evStatus = 4then"Status description 4"
.
.
else if evStatus = 999then"Status description 999"
else "Unknown Status"
Saving the expression takes a couple of seconds but the runtime performance is super.
Answers
Hi!
To solve the problem you are proposing, I recommend using the "NLS Resource Manager" aspect.
This aspect lets you import a XML File with the 800 texts that you said, and link them with an ID, for example "NLSID_FAULT_###", where ### is the integer value of the fault. Beware, the ID must be unique in the system.
Then in PG2, in the element with string property where you need to show the text value, you have to use the function "NLSTextFromIdent".
I hope this example would help you:
NlsIdTextFromIdent( "NLSDI_FAULT_"+String(IntegerValue), "ObjectWithNLSResourceManager", "IntegerValue not valid")
If you like, you can send me the 800 text values and I send you back the XML file to import in the aspect
Anyhow, send me your questions about this proposal.
Best regards
Add new comment