BPS C++ API  2.24.4
BpsRobotsGui Class Reference

GUI robots interface. More...

#include <bpsrobotsgui.h>

+ Inheritance diagram for BpsRobotsGui:

Signals

void itemRejected (const QVariant &aKey)
 Emitted when a item was rejected by robot or because of data constraints. More...
 
void itemSynced (const QVariant &aKey)
 Emitted when a item was successfully synced, e.g. More...
 

Public Member Functions

 BpsRobotsGui (BpsOrderUtils *aUtils, QObject *aParent=nullptr)
 
bool control (const QVariant &aZone, int aOp, const QVariantMap &aInput, QVariantMap &aOutput, QWidget *aParent)
 Execute robot specific operations. More...
 
bool finishOrders (const QVariant &aZone, BpsRobot::OrderType aOrderType, const QVariantList &aKeys, QWidget *aParent)
 Finish order processing. More...
 
bool loadOrdertrip (const QVariant &aZone, const QVariant &aOrdertripKey, QWidget *aParent)
 Load order trip into robot. More...
 
bool lockRobot (const QVariant &aZone, QWidget *aParent)
 Lock the zone for exclusive robot access. More...
 
bool revokeOrders (const QVariant &aZone, BpsRobot::OrderType aOrderType, const QVariantList &aKeys, QWidget *aParent)
 Revoke orders from the robot. More...
 
bool syncOrders (const QVariant &aZone, BpsRobot::OrderType aOrderType, const QVariantList &aKeys, BpsRobot::OrderSyncMode aSyncMode, QWidget *aParent)
 Synchronize orders to the robot. More...
 
bool syncStock (const QVariant &aZone, QWidget *aParent)
 Import all robot stocks into the BPS stock. More...
 
BpsOrderUtilsutils () const
 
- Public Member Functions inherited from QObject
bool blockSignals (bool block)
 
const QObjectListchildren () const const
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectInfo ()
 
void dumpObjectInfo () const const
 
void dumpObjectTree ()
 
void dumpObjectTree () const const
 
QList< QByteArraydynamicPropertyNames () const const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegExp &regExp, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
QVariant property (const char *name) const const
 
 Q_CLASSINFO (Name, Value)
 
 Q_DISABLE_COPY (Class)
 
 Q_DISABLE_COPY_MOVE (Class)
 
 Q_DISABLE_MOVE (Class)
 
 Q_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_OBJECT Q_OBJECT
 
 Q_PROPERTY (...)
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SLOT Q_SLOT
 
 Q_SLOTS Q_SLOTS
 
qFindChild (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QRegExp &regExp)
 
QList< T > qFindChildren (const QObject *obj, const QString &name)
 
 QObject (QObject *parent)
 
qobject_cast (const QObject *object)
 
qobject_cast (QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds time, Qt::TimerType timerType)
 
QThreadthread () const const
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Public Attributes inherited from QObject
typedef QObjectList
 
- Protected Member Functions inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
int receivers (const char *signal) const const
 
QObjectsender () const const
 
int senderSignalIndex () const const
 
virtual void timerEvent (QTimerEvent *event)
 
- Properties inherited from QObject
 objectName
 

Detailed Description

GUI robots interface.

This class provides convenience functions performing robot operations. Progress dialogs will be shown with the given widget as parent when necessary.

Constructor & Destructor Documentation

◆ BpsRobotsGui()

BpsRobotsGui::BpsRobotsGui ( BpsOrderUtils aUtils,
QObject aParent = nullptr 
)
Parameters
aUtilsThe order utilities object to be used.
aParentThe parent object.

Member Function Documentation

◆ control()

bool BpsRobotsGui::control ( const QVariant aZone,
int  aOp,
const QVariantMap &  aInput,
QVariantMap &  aOutput,
QWidget aParent 
)

Execute robot specific operations.

See documentation of the respective robot interface for details. The default implementation does noting.

Parameters
aZoneKey of the zone.
aOpOperation command.
aInputInput data.
aOutputOutput data.
aParentParent widget for progress dialog and message boxes.
Exceptions
BpsExceptionon errors or when operation is canceled.

◆ finishOrders()

bool BpsRobotsGui::finishOrders ( const QVariant aZone,
BpsRobot::OrderType  aOrderType,
const QVariantList &  aKeys,
QWidget aParent 
)

Finish order processing.

Depending on the implementation the robot can continue picking until all pending jobs are completed.

In case of aOrderType==Trips, the order trip robot status shall either be finished ('f') after successful command transmission to the robot, or the robot shall update the status after completion later in case it has an asynchronous interface (for example a regular executed batch receiving data from robot).

In case of aborting (cancel or fatal error) in a critical communication phase, the status BPS knows about the robot may be inaccurate and have to be cleared manually by the user. The message of the thrown exception will in such a case include information about that fact.

The default implementation does nothing.

Parameters
aZoneKey of the zone.
aOrderTypeType of the records addressed by aKeys.
aKeysList of keys to process. Only keys belonging to a single trip are allowed.
aParentParent widget for progress dialog and message boxes.
Returns
True if all ok, false on cancel or errors.

◆ itemRejected

void BpsRobotsGui::itemRejected ( const QVariant aKey)
signal

Emitted when a item was rejected by robot or because of data constraints.

Parameters
aKeyKey of the order item.

◆ itemSynced

void BpsRobotsGui::itemSynced ( const QVariant aKey)
signal

Emitted when a item was successfully synced, e.g.

accepted by robot.

Parameters
aKeyKey of the order item.

◆ loadOrdertrip()

bool BpsRobotsGui::loadOrdertrip ( const QVariant aZone,
const QVariant aOrdertripKey,
QWidget aParent 
)

Load order trip into robot.

In case the order trip was already loaded before nothing happens. On success the method sets the order trip status to active.

In case of aborting (cancel or fatal error) in a critical communication phase, the status BPS knows about the robot may be inaccurate and have to be cleared manually by the user. The message of the thrown exception will in such a case include information about that fact.

Parameters
aZoneKey of the zone.
aOrdertripKeyKey of the order trip to load.
aParentParent widget for progress dialog and message boxes.
Returns
True if all ok, false on cancel or errors.

◆ lockRobot()

bool BpsRobotsGui::lockRobot ( const QVariant aZone,
QWidget aParent 
)

Lock the zone for exclusive robot access.

Parameters
aZoneKey of the zone.
aParentParent widget for progress dialog and message boxes.
Returns
True if the lock was successful, false if not.

◆ revokeOrders()

bool BpsRobotsGui::revokeOrders ( const QVariant aZone,
BpsRobot::OrderType  aOrderType,
const QVariantList &  aKeys,
QWidget aParent 
)

Revoke orders from the robot.

The method tries to revoke as many items as possible as long as no fatal error or cancel happens, and only throws an exception about the robot unable to revoke certain items at the end.

  • When revoking of an item succeeds, the robot status of the item is deleted.
  • When revoking of any items is rejected or aborted, the robot status of the affected items remain unchanged.

In case of aborting (cancel or fatal error) in a critical communication phase, the status BPS knows about the robot may be inaccurate and have to be cleared manually by the user. The message of the thrown exception will in such a case include information about that fact.

Parameters
aZoneKey of the zone.
aOrderTypeType of the records addressed by aKeys.
aKeysList of keys to process. Only keys belonging to a single trip are allowed.
aParentParent widget for progress dialog and message boxes.
Returns
True if all ok, false on partial success, cancel or errors.

◆ syncOrders()

bool BpsRobotsGui::syncOrders ( const QVariant aZone,
BpsRobot::OrderType  aOrderType,
const QVariantList &  aKeys,
BpsRobot::OrderSyncMode  aSyncMode,
QWidget aParent 
)

Synchronize orders to the robot.

The method tries to synchronize as many items as possible as long as no fatal error or abort happens, and only throws an exception about rejects at the end.

  • When sending of a yet unsent order item is rejected, the order item remains unchanged.
  • When sending updates for a item is rejected, the item is reverted to the known robot status.
  • When sending is aborted, fails fatal or items are locked, the order items remain unchanged.

In case of aborting (cancel or fatal error) in a critical communication phase, the status BPS knows about the robot may be inaccurate and have to be cleared manually by the user. The message of the thrown exception will in such a case include information about that fact.

Parameters
aZoneKey of the zone.
aOrderTypeType of the records addressed by aKeys.
aKeysList of keys to process. Only keys belonging to a single trip are allowed.
aSyncModeSynchronizing mode.
aParentParent widget for progress dialog and message boxes.
Returns
True if all ok, false on partial success, cancel or errors.

◆ syncStock()

bool BpsRobotsGui::syncStock ( const QVariant aZone,
QWidget aParent 
)

Import all robot stocks into the BPS stock.

Parameters
aZoneKey of the zone.
aParentParent widget for progress dialog and message boxes.
Returns
True if all ok, false on partial success, cancel or errors.

◆ utils()

BpsOrderUtils* BpsRobotsGui::utils ( ) const
Returns
The orderutils object.

The documentation for this class was generated from the following file: