Code Monkey home page Code Monkey logo

Comments (23)

zerox1212 avatar zerox1212 commented on July 19, 2024

@oroulet As discussed in FreeOpcUa/opcua-widgets#1; do you have time to add support for a list of ListOfExtensionObjects in Attributes widget? After I looked at it closer it seems I don't have enough experience with QT build the Method GUI in a reasonable time.

I will continue your work in xmlexporter.py to export an Argument extension object. It looks like a good place to start with extension objects, but really need to be able to add Arguments from GUI to fully test.

from opcua-modeler.

oroulet avatar oroulet commented on July 19, 2024

Export and import of extension asking be fully implemented. But the UI is
not finished. I started but it is complex and I I had to focus on other
things ...

On Tue, Oct 4, 2016, 02:08 Andrew [email protected] wrote:

@oroulet https://github.com/oroulet As discussed in
FreeOpcUa/opcua-widgets#1
FreeOpcUa/opcua-widgets#1; do you have time
to modify xmlimporter.py to return created extension objects so that
Attributes widget can display a list of ListOfExtensionObjects?

I can start working on xmlexporter.py to create an Argument extension
object. It looks like a good place to start with extension objects.


You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
#13 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACcfzq34PsXoLd91KWa7cH19Ugc4TNdwks5qwZjngaJpZM4KNI-P
.

from opcua-modeler.

oroulet avatar oroulet commented on July 19, 2024

Should be fully.... Keyboard completion error

On Tue, Oct 4, 2016, 07:46 Olivier Roulet-Dubonnet [email protected]
wrote:

Export and import of extension asking be fully implemented. But the UI is
not finished. I started but it is complex and I I had to focus on other
things ...

On Tue, Oct 4, 2016, 02:08 Andrew [email protected] wrote:

@oroulet https://github.com/oroulet As discussed in
FreeOpcUa/opcua-widgets#1
FreeOpcUa/opcua-widgets#1; do you have time
to modify xmlimporter.py to return created extension objects so that
Attributes widget can display a list of ListOfExtensionObjects?

I can start working on xmlexporter.py to create an Argument extension
object. It looks like a good place to start with extension objects.


You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
#13 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACcfzq34PsXoLd91KWa7cH19Ugc4TNdwks5qwZjngaJpZM4KNI-P
.

from opcua-modeler.

oroulet avatar oroulet commented on July 19, 2024

When comparing to UAModeler, I see that the simple method I created requires an extension object.

yes args are extension objects

from opcua-modeler.

zerox1212 avatar zerox1212 commented on July 19, 2024

Should I try to do a basic UI? Perhaps just have 5 fixed fields for arguments instead of creating fields dynamically? Any field left blank is not used.

from opcua-modeler.

oroulet avatar oroulet commented on July 19, 2024

Probably a good idea to try. An arg has only 3 fields as far as I remember.
Name, description and type which is a node ID. Do not use ui files so it is
easier to extend later.

On Tue, Oct 4, 2016, 16:15 Andrew [email protected] wrote:

Should I try to do a basic UI? Perhaps just have 5 fixed fields for
arguments instead of creating fields dynamically? Any field left blank is
not used.


You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
#13 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACcfztXnoqYe2jtzyQxO6nbtLXJSbZWjks5qwl-PgaJpZM4KNI-P
.

from opcua-modeler.

zerox1212 avatar zerox1212 commented on July 19, 2024

I almost have it working. I will make a PR soon so you can take a look at it.

Trying to figure out how to keep track of the Input and Output argument nodes in modeler to make sure they get exported.

At the moment the node managment service which creates the method only returns the node ID of the method it added, not the child properties (inputs and outputs).

Edit: I found a solution for above that can be done in modeler, it's simple but now I have the problem mentioned below.

from opcua-modeler.

zerox1212 avatar zerox1212 commented on July 19, 2024

So I'm having a hard time with a UaVariable which is an argument.

The problem is node.get_data_type() on this variable which which is an Argument returns this:
image

Of course then the xml export doesn't work because the extension object isn't created.

When I follow the code _create_method explicitly sets the DataType:

create_property(method,
                    ua.NodeId(),
                    ua.QualifiedName("InputArguments", 0),
                    [_vtype_to_argument(vtype) for vtype in inputs],
                    varianttype=ua.VariantType.ExtensionObject,
                    datatype=ua.ObjectIds.Argument)

Somehow node.get_data_type() is getting a namespace when it shouldn't.

Any idea how to fix this? I've been trying for over and hour and I'm stuck.

For now I added this hack to keep working

# FIXME hack because get_data_type() has issues
        if dtype.NamespaceIndex > 50:
            dtype.Identifier = dtype.NamespaceIndex
            dtype.NamespaceIndex = 0

from opcua-modeler.

oroulet avatar oroulet commented on July 19, 2024

What is with this data type?

On Wed, Oct 5, 2016, 00:49 Andrew [email protected] wrote:

So I'm having a hard time with a UaVariable which is an argument.

The problem is x.get_data_type() on this variable which has an extension
object returns this:
[image: image]
https://cloud.githubusercontent.com/assets/13090472/19095346/cc3d2194-8a5a-11e6-81b7-08e023198ec5.png

Of course then the xml export doesn't work because the extension object
isn't created. Any idea how to fix this? I've been trying for over and hour
and I'm stuck.


You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
#13 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACcfzh6gGD4KPBNpYoZhcTR9VF8tdB1lks5qwtf1gaJpZM4KNI-P
.

from opcua-modeler.

zerox1212 avatar zerox1212 commented on July 19, 2024

I'm finally to the point where I can work on xmlexporter, and so far it is not working. :)

  <UAVariable BrowseName="0:InputArguments" DataType="Argument" NodeId="i=20002" ParentNodeId="i=20001">
    <DisplayName>InputArguments</DisplayName>
    <Description>InputArguments</Description>
    <Value>
      <uax:ListOfArgument>
        <uax:Argument>Argument(Name:ArgName, DataType:TwoByteNodeId(i=NumericNodeId(i=10)), ValueRank:-1, ArrayDimensions:[], Description:LocalizedText(Encoding:2, Locale:None, Text:b'Desc'))</uax:Argument>
      </uax:ListOfArgument>
    </Value>
    <References>
      <Reference IsForward="false" ReferenceType="HasProperty">i=20001</Reference>
      <Reference ReferenceType="HasTypeDefinition">i=68</Reference>
    </References>

I will try to finish it up tomorrow.

from opcua-modeler.

zerox1212 avatar zerox1212 commented on July 19, 2024

It's difficult to work in 3 separate repositories... but I finished early.

Methods are ready if you can finish UI.

Required by modeler to export method children:
#14

Test widget to add a single input arg:
FreeOpcUa/opcua-widgets#2

Updated exporter to handle extension objects:
FreeOpcUa/python-opcua#311

from opcua-modeler.

zerox1212 avatar zerox1212 commented on July 19, 2024

When a method is added, should the input and output argument nodes have a namespace?
image

from opcua-modeler.

oroulet avatar oroulet commented on July 19, 2024

Idx should be 0. This is correct

On Fri, Oct 7, 2016, 20:31 Andrew [email protected] wrote:

When a method is added, should the input and output argument nodes have a
namespace?
[image: image]
https://cloud.githubusercontent.com/assets/13090472/19201220/689c93a6-8c92-11e6-9c4c-455e0226bbf6.png


You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
#13 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACcfzvhhk6JLR2XxdSEPfIylrZYZ6YaFks5qxpAbgaJpZM4KNI-P
.

from opcua-modeler.

zerox1212 avatar zerox1212 commented on July 19, 2024

Ok. New question.
If I make a node ns=1, shouldn't the browse name be "1:Name"? Currently browse name always gets "0:"
image

from opcua-modeler.

oroulet avatar oroulet commented on July 19, 2024

Browse name idx should be same as node ID by default

On Fri, Oct 7, 2016, 20:39 Andrew [email protected] wrote:

Ok. New question.
If I make a node ns=1, shouldn't the browse name be "1:Name"? Currently
browse name always gets "0:"
[image: image]
https://cloud.githubusercontent.com/assets/13090472/19201453/7d75585c-8c93-11e6-9374-59be40b999ae.png


You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
#13 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACcfzsOnmBehC8wKU-YSmkCpEw3go42_ks5qxpHrgaJpZM4KNI-P
.

from opcua-modeler.

zerox1212 avatar zerox1212 commented on July 19, 2024

Looks like it's a problem in manage_nodes.py. Instantiate is called, but it doesn't pass the namespace id.

def create_object(parent, nodeid, bname, objecttype=None):
    """
    create a child node object
    arguments are nodeid, browsename, [objecttype]
    or namespace index, name, [objecttype]
    if objectype is given (a NodeId) then the type node is instantiated inclusive its child nodes
    """
    nodeid, qname = _parse_nodeid_qname(nodeid, bname)
    if objecttype is not None:
        objecttype = node.Node(parent.server, objecttype)
        return instantiate(parent, objecttype, nodeid, bname)[0]  # DOESN'T PASS NS ID?

from opcua-modeler.

zerox1212 avatar zerox1212 commented on July 19, 2024

After more investigation. I think instantiate(parent, objecttype, nodeid, bname)[0] should pass qname not bname.

Should this be fixed in python-opcua or should modeler create a QualifiedName instead of just passing a string?

Modeler could do args.append(ua.QualifiedName(name, ns)) instead of args.append(name).

What is the correct way to fix this?

from opcua-modeler.

zerox1212 avatar zerox1212 commented on July 19, 2024

Idx should be 0. This is correct

I think this is not correct. Unifed Automation modeler does not do this, it adds the arguments to the same namespaces as the method.
image

The problem with how python modeler works, it will export the nodes, but if you import them again they get ignored.
image

from opcua-modeler.

oroulet avatar oroulet commented on July 19, 2024

As far as I remember, uaexpert refused to call the method if the arguments
where in another namespace than 0. But check and let us know what you find
out....

On Fri, Oct 7, 2016, 22:06 Andrew [email protected] wrote:

Idx should be 0. This is correct

I think this is not correct. Unifed Automation modeler does not do this,
it adds the arguments to the same namespaces as the method.
[image: image]
https://cloud.githubusercontent.com/assets/13090472/19203773/c273e0d0-8c9e-11e6-8130-9ab4d18dbcf3.png

The problem with how python modeler works, it will export the nodes, but
if you import them again they get ignored.


You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
#13 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACcfzqaa_C6N61SaZpINuUs_Jciia99aks5qxqY0gaJpZM4KNI-P
.

from opcua-modeler.

zerox1212 avatar zerox1212 commented on July 19, 2024

This is very difficult to get working. If the arguments are not in NS=0 lots of wierd things happen. If I try to put them in NS=0 xmlparser doesn't work... I will keep trying to figure this out.

from opcua-modeler.

zerox1212 avatar zerox1212 commented on July 19, 2024

From testing UA Expert has no problem calling methods with arguments in address space greater than 0. Now I just need to figure out what is going on with importing and calling them when XML is used...

from opcua-modeler.

zerox1212 avatar zerox1212 commented on July 19, 2024

Many PRs but now everything seems to be working.

from opcua-modeler.

zerox1212 avatar zerox1212 commented on July 19, 2024

Seems all related items have been merged. GUI needs some improvement, but it's functional. Closing...

from opcua-modeler.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.