Skip to content

v2.0.0

Latest
Compare
Choose a tag to compare
@WimPessemier WimPessemier released this 17 Jul 14:49
· 144 commits to master since this release

Informally:

  • Sessions, subscriptions and service calls can now be configured and controlled more easily.
    Basically, all Config classes (like SessionConfig, SubscriptionConfig, ReadConfig, ...)
    have disappeared. This means that the config arguments (e.g. read(..., sessionConfig=None, ...))
    have disappeared as well! Instead of using configs, you can now:

    • easily configure default SessionSettings, SubscriptionSettings, ReadSettings, etc.:

      clientSettings = ClientSettings()
      clientSettings.defaultSessionSettings.sessionTimeoutSec = 100.0
      clientSettings.defaultReadSettings.callTimeoutSec = 2.0
      myClient.setClientSettings(clientSettings)
      myClient.read(addresses) # this will use the above defaults

    • easily configure SessionSettings, SubscriptionSettings, ReadSettings, etc. per service call:

      myClient.read(addresses = myAddresses,
      ... serviceSettings = myReadSettings, # optional *_kwarg
      ... sessionSettings = mySessionSettings) # optional *_kwarg
      myClient.createMonitoredData(addresses = myAddresses,
      ... serviceSettings = myCreateMonitoredDataSettings, # optional *_kwarg
      ... sessionSettings = mySessionSettings, # optional *_kwarg
      ... subscriptionSettings = mySubscriptionSettings) # optional **kwarg

    • easily keep full control over sessions, subscriptions and services (only if you know
      what you're doing):

      myClient.read(addresses, clientConnectionId = 3)
      myClient.createMonitoredData(addresses, clientConnectionId = 3, clientSubscriptionHandle = 1)

    Check the examples/pyuaf/client/how_to_configure_all_settings.py example or the API docs for
    more detailed information!

    This is a breaking change that may affect existing code!!!
    Check your code for any occurrences of the word "config" (case insensitive) and check with the API
    documentation to spot any changes!

  • OpenSSL security is now supported. See the example how_to_connect_to_a_secured_endpoint.py.

  • Everything related to status/error handling has changed significantly:

    • Many more error types are now defined, so errors can now be handled much more "fine grained".
      For instance, in addition to the old "SecurityError", you can now also catch a
      "OpenSSLStoreInitializationError". The former is a superclass of the latter, so if you're
      handling SecurityErrors, you'll also handling all "fine grained" security related errors.
      To maintain backwards compatibility, no errors have been removed from the framework. If an
      error has become obsolete, it is now a subclass of the "BackwardsCompatibilityError", and it
      will never be raised.
      For PyUAF, see the documentation on pyuaf.util.errors to get an overview of all errors.
      For the C++ UAF, see the errors in the headers of src/uaf/errors/*.h.
    • The newly defined errors often have diagnostic attributes. For instance, the
      "ConnectionFailedError" has an "endpointUrl" string attribute, so you'll know for which
      endpoint the connection failed. It also has a "sdkStatus" attribute of the new type SdkStatus.
      SdkStatus instances hold the low-level statuscode and status description from the Unified
      Automation SDK. In other words, you can use the sdkStatus attribute to know what caused the
      ConnectionFailedError at the SDK level.
      Again, see the documentation of pyuaf.util.errors (or the C++ error headers) to know which
      attributes are defined for each error.
    • Since individual error classes now have diagnostic attributes, the StatusDiagnostics class
      (which previously held all diagnostic info) has been removed from the framework. Consequently,
      the "statusDiagnostics()" method of the Status class has been removed. Search through your
      existing code for "statusdiagnostics" (case insensitive) to detect problems due to backwards
      incompatibility. Especially watch out when creating monitored items: diagnostics are often
      used there to store clientHandles even if the monitored items could not be created. Check out
      the documentation on the "createMonitoredData()" or "createMonitoredEvents()" methods of the
      pyuaf.client.Client class to see how to adapt your code.
  • Relevant for the C++ side only: the uafc:: namespace has been removed and all code is now part of
    the uaf:: namespace. We did this because SWIG apparently has problems with namespaces in certain
    cases (e.g. subclasses of an abstract class of another namespace may give problems when used in
    wrapped vectors).

  • ExtensionObjects are now supported, and so are model change events.
    See example how_to_monitor_model_changes.py.

  • The endpoint descriptions of the discovered servers can now be accessed via Client::getEndpoints().

  • SessionInformation and SubscriptionInformation contains more diagnostic info.

  • Bugfixes: see #62 and #80