Is there a reference implementation for the newly introduced TxExpressionEditor, particulary regarding the aquto completion features? I would like to use it in one of my applications and came across the following issues:
So far I have implemented the ITxExpressionBuilder interface and assigned it to the corresponding variable in the TxExpressionEditor (I wrote a dedicated parser to implement "ParseExpressionToWords", and since I do not want to interface directly with the PS logic interpreter, "GetExpression" still returns null). I also filled the variables for "Operands", "Operators" and "Functions" with entries consistent with my parser.
When I enter something into the TxExpressionEditor WPF-element, I observe the following behavior:
Welcome to the forum! Currently there is no reference for that control other than the Tecnomatix.NET.chm.
You can send me your code over the e-mail and I will check what is the problem.
I tried to delve into this over a year ago in version 11TR3 with little success. I wanted to be able to import logic blocks fully from the Excel format exported, including expressions....I got stuck on expressions. I was not able to implement the editor class back then. Did they change around the scope in these classes with later releases? I remember running into the abstract and sealed class brick wall with this.
I tried doing it the hard way creating a class to parse the sting into the various components (Operators, Operands, etc) and using the Expresion Builder interace methods to put it together one component at a time, but each time it looped around to add another component to the expression the array was emptied of the last element inserted.
I am really interested in any sucess stories in this area as I am now doing development for Virtual Commisioning, and the ability to write a FULL Logic Block import including expressions would be usefull.
Regarding the issue that you don't see the functions in the drop down - for that you need to add the functions also to the Operands list.
For the auto completion, the ParseExpressionToWords method should return a list of the expression words including a word for the text that is not recognized as operator or operand. For example if you enter "M", then you need to return a ExpressionWord with text M and its Start and End Position in the expression string.
I spoke with a Siemens representative a year ago about adding a method into the API that attempts to convert a string value into an expression, and returns a handleable error if it fails due to bad syntax. I have yet to hear if they accomplished this. This was during version 11TR3.