cancel
Showing results for 
Search instead for 
Did you mean: 

TxExpressionEditor: Auto completion issues

Experimenter
Experimenter

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:

  • all names of operators and operands are displayed for selection when I press CTRL+space. However, the names of functions I added to "Functions" are still missing. (Remark: I have not yet set the image and object properties of the operands, operators and functions)
  • auto completion is not working as expected (as known from the PS GUI): for example, if I enter "Move" into the editor, the auto completion list is not restricted to elements starting with "Move". Also, if I select an element from the list (e.g. "MoveRobot"), the text is not replaced as expected in the editor -> instead of just "MoveRobot", I got "MoveMoveRobot", i.e. the existing part is not replaced correctly by auto completion.
  • For my application I would like to restrict the elements in the auto completion list based on context information, i.e. the user is not allowed to use certain signal names in some situations. Is there a way to edit the autocompletion list directly?
5 REPLIES

Re: TxExpressionEditor: Auto completion issues

Siemens Legend Siemens Legend
Siemens Legend

Hi Mayerh,

 

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.

 

Best Regards,

DianaG

Re: TxExpressionEditor: Auto completion issues

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.

Re: TxExpressionEditor: Auto completion issues

Valued Contributor
Valued Contributor

Hi

 

Yes I have exactly the same situation with the expression and  really need a solution to create LB for VC.

 

Regards

 

Re: TxExpressionEditor: Auto completion issues

Siemens Legend Siemens Legend
Siemens Legend

Hi Mayerh,

 

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.

 

Best Regards,

DianaG

Re: TxExpressionEditor: Auto completion issues

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.