Hello,
I'm having an issue in Visual Studio 2017 where parameter name variable is not suggested. For example, in QAction, I am using protocol.NotifyProtocol (/*NT_FILL_ARRAY_WITH_COLUMN*/) to update a table but when I type "Parameter", nothing is suggested and Visual Studio is trying to replace it with "GetParameters" method. What I need for VS is to suggest table name after that, or if I remember correctly, a list of parameters/tables. A working code looks like this:
Parameter.<table_name>.Pid.<parameter_pid>
I have tried to guess what the parameter_pid should be but DIS validator is throwing a compile error. Any way to turn that suggestion back on?
What does "Generate QAction Helper Code" suppose to do? It doesn't seem to be doing anything for me.
Error message:
I have found out if I change the parameter name from 'operator' to 'leaseoperator' and use variable leaseoperator_2804, it doesn't generate any error message. However, this is a guessing game at this point w/o the help of DIS.
Thanks!
Hi Sean. Do you get an exception when you force DIS to generate the helper code via DIS > Protocol > Generate QAction Helper Code?
Hi Tom,
No, actually, nothing happens when I click on Generate QAction Helper Code (both in XML or inside QAction). What should happen? I’ve been using keyboard shortcuts to generate code in protocol (adding parameters, QActions, Timers, etc)…
I think it will be easier to investigate further during a call. Feel free to contact me on tom.waterbley@skyline.be to setup a call.
Small update for in case somebody faces the same issue in the future. Looked at this together with Sean, and the problem was that the .NET Desktop application development workload was not installed in Visual Studio.
Hi Sean,
Can you verify if your protocol XML is valid?
If you check the DIS tree, corrupt XML items will be shown in red:
When this is the case, the Protocol helper will not build correctly and result in the Parameter class not to be present.
After fixing the XML breaking section, the Parameter class is accessible again.
If you don't see it getting fixed automatically, you can also try to re generate the QAction Helper Code.
(DIS/Protocol/Generate QAction Helper Code)
When it comes down to renaming Parameter names, this will indeed also create compilation errors on the QActions in case these are referenced by there name. such as Parameter.<paramName>
Opening the QAction will let you use the error console to view where the issues are. With the intellisense (CTRL + SPACE) of Visual Studio you should be able to set things right again.
Hope this helps!
Hi Thijs,
I don’t see any highlighted line in my DIS Tree panel. (How do I attach a picture?)
Hi Sean, comments don’t support images yet. Can you edit your question itself (settings button beneath your question) and upload some screenshots over there? thanks!
Just checking, but I guess you have following using in your code enabled?
using Skyline.DataMiner.Scripting;
I also updated my answer to show how to force rebuild the Helper files.
I have updated the original question to include a snippet of my DIS Tree.
Hi Sean,
you have to open the respective QAction (or even all QActions) to get to these errors. The Visual Studio error console will nicely show where the issue is, and via the intellisense you can find the new parameter in case you renamed parameters.
Opening one or more QActions can be done via the QAction XML tag and click on the button before this tag. This will open the QAction in a separate window.
Hi Sean, based on the updates of your question, I have also updated the answer to assist you in how to visualize where the QAction code errors are based on referenced renamed parameters.
Please let us know if that’s good enough to support your case, or if you have further questions.
Hi Sean,
Can you post what exception you see in the DIS Validator module please?
Thanks