Universal Robots Forum

ToolbarContext problem when changing installation file

Hi there,

I am developing an URCap to control a gripper.

In the ToolbarContribution.java file we have the following code:

toolToolbarContribution(ToolbarContext context) {
    context_ = context;
    installation_ = context_.getAPIProvider().getApplicationAPI().getInstallationNode(toolInstallationNodeContribution.class);
    keyboard_factory_ = context_.getAPIProvider().getUserInterfaceAPI().getUserInteraction().getKeyboardInputFactory();
    view_builder_ = context_.getAPIProvider().getSystemAPI().getSoftwareVersion().getMajorVersion() >= 5 ? new ViewBuilder5() : new ViewBuilder3();
  }

while in ProgramNodeContribution.java file we have:

public toolProgramNodeContribution(ProgramAPIProvider api_provider, toolProgramNodeView view, DataModel model) {
    api_provider_ = api_provider;
    installation_ = api_provider.getProgramAPI().getInstallationNode(toolInstallationNodeContribution.class);
    view_ = view;
    model_ = model;
...
}

We have seen that when loading an existing .installation file which differs from the default one, in the toolbar the installation_ variable is not updated, while the one in the programNode is correctly updated.

Does anyone faced this problem? Do you have any suggestion? Are there any differences between the two getInstallationNode methods?

Thank you in advance,

Umberto

1 Like

Probably because the code who set the variable in ProgramNodeContribution has been executed after the .installation file has been loaded ??