Software Porting Guidelines

This document provides guidelines for porting the software from IFW 2024.0.0 to IFW 2025.0.0 based on the experience porting the template instrument provided with the IFW software.

Target Audience

These guidelines are intended for software developers involved in the porting process.

Prerequisites

A successful installation of the software as described in Installation.

List of Changes

The startup script in the template instrument has significant changes due to the changes in Nomad job files. Probably it is easier to take the new template version and adapt it to the instrument.

Update Include Path

Include file path of IFW components have be updated by adding the prefix of the project. Projects shall update all the paths accordingly.

Here there is one example (C++):

< #include <utils/bat/logger.hpp>

< #include “fcf/devmgr/common/deviceConfig.hpp”

< #include “fcf/devmgr/common/dataContext.hpp”

Should be changed to:

> #include <ifw/core/utils/bat/logger.hpp>

> #include “ifw/fcf/devmgr/common/deviceConfig.hpp”

> #include “ifw/fcf/devmgr/common/dataContext.hpp”

Python example:

< !cfg.include schema/ccf/common/setup.schema.yaml:

Should be changed to:

> !cfg.include schema/ifw/ccf/common/setup.schema.yaml:

Configuratio example:

< scxml : “config/fcf/devmgr/server/sm.xml” < dictionaries : [‘dictionary/dit/stddid/primary.did.yaml’, ‘dictionary/fcf/devmgr/server/fcf.did’]

Should be changed to:

> scxml : “config/ifw/fcf/devmgr/server/sm.xml” > dictionaries : [‘dictionary/ifw/core/dit/stddid/primary.did.yaml’, ‘dictionary/ifw/fcf/devmgr/server/fcf.did’]

Update Namespaces

C++ and Python namespaces have been updated as well.

Here there is one example:

< {fcf::devmgr::common::SUBSTATE_NOTREADY, fcf::devmgr::common::SUBSTATE_NOTREADY_STR}, < {fcf::devmgr::common::SUBSTATE_INITIALISING, fcf::devmgr::common::SUBSTATE_INITIALISING_STR},

Should be changed to:

> {ifw::fcf::devmgr::common::SUBSTATE_NOTREADY, ifw::fcf::devmgr::common::SUBSTATE_NOTREADY_STR}, > {ifw::fcf::devmgr::common::SUBSTATE_INITIALISING, ifw::fcf::devmgr::common::SUBSTATE_INITIALISING_STR},

Qt Changes

To avoid having dependencies on specific version of Qt, custom widgets should be updated.

Here there is one example:

from PySide2.QtCore import Slot

from PySide2.QtCore import Qt

from PySide2.QtGui import QColor

Should be changed to:

from qtpy.QtCore import Slot

from qtpy.QtCore import Qt

from qtpy.QtGui import QColor

FCF Custom Server

To support custom OPCUA configurations, the FCF commnication interface has been updated.

Add the following code:

auto interface_cfg = config.GetDeviceInterfaceCfg(i);

Change the RegisterComm() call from:

auto interface = CommFactory::Instance().Create(resolved_filename, devname, ifname);

To

auto interface = CommFactory::Instance().Create(interface_cfg, devname, ifname);

Adaptation to new ifw-tpl Component

IFW 2025 includes a new component (ifw-tpl). This component tries to include all the common functionality for instrument templates. As first implementation, it uses mainly what it was already part of the template instrument. Instruments shall start using this component in templates. For more details, refer to the ifw-template for IFW 2025.

> from ifw.tpl.seq.ifw_component import DDTFacade, CCFFacade, FCFFacade > > from ifw.tpl.seq import services >

For example:

< import tins.seq.tpl.ccsif_async_commands as ccs

Should be changed to:

> from ifw.tpl.seq.ifw_component import DDTFacade, CCFFacade, FCFFacade

> from ifw.tpl.seq import services > import ifw.tpl.seq.ccsif_async_commands as ccs

Another example:

< self.fcf_name = “fcs” < self.fcf_uri = self.cons.get_uri(f”{self.fcf_name}-req”)

Should be changed to:

> self.fcs_facade = FCFFacade(“fcs”) > self.fcf_uri = self.fcs_facade.get_req_uri()

HLCC Main process

The main HLCC process has been renamed.

< self.ccs_name = “telifsim”

Should be changed to:

> self.ccs_name = “telif”

FCF Dictionary

FCF dictionary has been updated to make it more compatible with DICB. Among other changes, the keyword MOT has been removed.

< fits_prefix: “MOT1”

Should be changed to:

> fits_prefix: “OPTI1”