Pick robot interface. More...
#include <bpsrobot.h>
Public Types | |
enum | Feature { CanLoadTrip , CanSyncTrips , CanSyncRows , CanSyncCols , CanSyncItems , CanSyncChanged , CanRevokeTrips , CanRevokeRows , CanRevokeCols , CanRevokeItems , CanFinishTrips , CanFinishRows , CanFinishCols , CanFinishItems , CanHandleSubjobs , CanSyncStock } |
Feature identifiers. More... | |
enum | OrderSyncMode { SyncInvalid = 0 , SyncAll = 1 , SyncNew = 2 , SyncUpdate = 3 } |
Order items synchronize modes. More... | |
enum | OrderType { TypeInvalid = 0 , TypeTrips = 1 , TypeRows = 2 , TypeCols = 3 , TypeItems = 4 } |
Type of the key/keys to process. More... | |
Signals | |
void | hideProgress () |
Emitted after the operation is completed (or failed or was aborted). More... | |
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... | |
void | robotEvent (int aEvt, const QVariantMap &aData) |
Emitted when a spontaneous robot specific event happens. More... | |
void | showProgress (int aMaximum, const QString &aLabel) |
Emitted at start of operation to begin showing the progress indicator. More... | |
void | updateProgressLabel (const QString &aLabel) |
Emitted to update the progress label text. More... | |
void | updateProgressMaximum (int aMaximum) |
Emitted to change the highest tick value. More... | |
void | updateProgressValue (int aValue) |
Emitted when progress reaches next value to update the progress indicator. More... | |
Public Member Functions | |
BpsRobot (BpsDatastore *aDatastore, const QVariant &aZone, QObject *aParent=0) | |
virtual void | control (int aOp, const QVariantMap &aInput, QVariantMap &aOutput, volatile bool *aCancelFlag=nullptr) |
Execute robot specific operations. More... | |
BpsDatastore * | datastore () const |
virtual void | finishOrders (OrderType aOrderType, const QVariantList &aKeys, volatile bool *aCancelFlag=nullptr) |
Finish order processing. More... | |
QVariantMap | getOrdertripRobot (const QVariant &aOrdertrip) const |
Get the robot status record for order trip. More... | |
virtual bool | hasFeature (Feature aFeature) |
Query information about available features. More... | |
bool | isLocked () |
Check if robot is locked. More... | |
virtual void | loadOrdertrip (const QVariant &aOrdertripKey, volatile bool *aCancelFlag=nullptr) |
Load order trip into robot. More... | |
bool | lock (int aTimeout, volatile bool *aCancelFlag=nullptr) |
Lock the zone for exclusive robot access. More... | |
QString | pickMode () const |
Get the picking mode of this robots zone (robot.mifa, robot.geko, robot.tako, robot.osiris, ...) More... | |
virtual void | revokeOrders (OrderType aOrderType, const QVariantList &aKeys, volatile bool *aCancelFlag=nullptr) |
Revoke orders from the robot. More... | |
virtual void | sendSubjobLu (const QVariant &aOrdertrip, const QVariant &aLuid, volatile bool *aCancelFlag=nullptr) |
Send back a subjob after a LU got finalized. More... | |
void | showProgressMessage (const QString &aMessage) |
Emit signals to show a progress message with undefined running length. More... | |
virtual QString | subjobItemCondition (const QString &aPrefix=QString()) |
Get the orderitem selecting condition for subjobs created by this robot. More... | |
virtual void | syncOrders (OrderType aOrderType, const QVariantList &aKeys, OrderSyncMode aSyncMode, volatile bool *aCancelFlag=nullptr) |
Synchronize orders to the robot. More... | |
virtual void | syncStock (volatile bool *aCancelFlag=nullptr) |
Import all robot stocks into the BPS stock. More... | |
void | unlock () |
Unlock the zone, in case it was locked by the current actor. More... | |
QVariant | zone () const |
QString | zoneName () const |
virtual | ~BpsRobot () |
Virtual default destructor. | |
![]() | |
bool | blockSignals (bool block) |
const QObjectList & | children () 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< QByteArray > | dynamicPropertyNames () const const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegExp ®Exp, 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 QMetaObject * | metaObject () const const |
void | moveToThread (QThread *targetThread) |
QString | objectName () const const |
void | objectNameChanged (const QString &objectName) |
QObject * | parent () 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 | |
T | qFindChild (const QObject *obj, const QString &name) |
QList< T > | qFindChildren (const QObject *obj, const QRegExp ®Exp) |
QList< T > | qFindChildren (const QObject *obj, const QString &name) |
QObject (QObject *parent) | |
T | qobject_cast (const QObject *object) |
T | 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) |
QThread * | thread () const const |
Additional Inherited Members | |
![]() | |
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) |
![]() | |
typedef | QObjectList |
![]() | |
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 |
QObject * | sender () const const |
int | senderSignalIndex () const const |
virtual void | timerEvent (QTimerEvent *event) |
![]() | |
objectName | |
Pick robot interface.
enum BpsRobot::Feature |
Feature identifiers.
Enumerator | |
---|---|
CanLoadTrip | Supports loading an order trip with loadOrdertrip(). |
CanSyncTrips | Supports syncing order trips with syncOrders(). |
CanSyncRows | Supports syncing order rows with syncOrders(). |
CanSyncCols | Supports syncing order cols with syncOrders(). |
CanSyncItems | Supports syncing order items with syncOrders(). |
CanSyncChanged | Supports syncing of changed items. |
CanRevokeTrips | Supports revoking order trips with syncOrders(). |
CanRevokeRows | Supports revoking order rows with syncOrders(). |
CanRevokeCols | Supports revoking order cols with syncOrders(). |
CanRevokeItems | Supports revoking order items with syncOrders(). |
CanFinishTrips | Supports finishing order trips with syncOrders(). |
CanFinishRows | Supports finishing order rows with syncOrders(). |
CanFinishCols | Supports finishing order cols with syncOrders(). |
CanFinishItems | Supports finishing order items with syncOrders(). |
CanHandleSubjobs | The robot may send create subjobs for manual picking and receive back the finalized lu's. |
CanSyncStock | Supports syncStock(). |
Order items synchronize modes.
Basic condition for all sync operations is that the order trip status must be active.
enum BpsRobot::OrderType |
BpsRobot::BpsRobot | ( | BpsDatastore * | aDatastore, |
const QVariant & | aZone, | ||
QObject * | aParent = 0 |
||
) |
aDatastore | The datastore to use. |
aZone | The key of the zone to handle by this robot. |
aParent | The parent object. |
|
virtual |
Execute robot specific operations.
See documentation of the respective robot interface for details. The default implementation does nothing.
aOp | Operation command. |
aInput | Input data. |
aOutput | Output data. |
aCancelFlag | If the cancel flag becomes false during operation, the operation will stop and throw a BpsException. |
BpsException | on errors or when operation is canceled. |
BpsDatastore* BpsRobot::datastore | ( | ) | const |
|
virtual |
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.
aOrderType | Type of the records addressed by aKeys. |
aKeys | List of keys to process. Only keys belonging to a single trip are included. |
aCancelFlag | If the cancel flag becomes false during operation, revokeOrders will stop and throw a BpsException. |
BpsException | Thrown when finishing failed or was aborted. |
QVariantMap BpsRobot::getOrdertripRobot | ( | const QVariant & | aOrdertrip | ) | const |
Get the robot status record for order trip.
In case no record yet exists, a new one is created with status "unsent".
aOrdertrip | Key of the order trip. |
BpsException | Thrown on database errors. |
|
virtual |
Query information about available features.
The default implementation returns false for any feature. Overload this method to return true in case.
aFeature | The feature to check. |
|
signal |
Emitted after the operation is completed (or failed or was aborted).
The progress indicator should get hidden.
bool BpsRobot::isLocked | ( | ) |
Check if robot is locked.
|
signal |
Emitted when a item was rejected by robot or because of data constraints.
aKey | Key of the order item. |
|
signal |
Emitted when a item was successfully synced, e.g.
accepted by robot.
aKey | Key of the order item. |
|
virtual |
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.
The default implementation does nothing.
aOrdertripKey | Key of the order trip to load. |
aCancelFlag | It the cancel flag becomes false during operation, lockRobot will stop and throw a BpsException. |
BpsException | Thrown when loading the order trip failed or was aborted. |
bool BpsRobot::lock | ( | int | aTimeout, |
volatile bool * | aCancelFlag = nullptr |
||
) |
Lock the zone for exclusive robot access.
aTimeout | Time out in seconds. Special values: 0 = no wait, -1 = wait endless |
aCancelFlag | It the cancel flag becomes false during operation, lockRobot will stop and throw a BpsException. |
QString BpsRobot::pickMode | ( | ) | const |
Get the picking mode of this robots zone (robot.mifa, robot.geko, robot.tako, robot.osiris, ...)
|
virtual |
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.
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.
aOrderType | Type of the records addressed by aKeys. |
aKeys | List of keys to process. Only keys belonging to a single trip are included. |
aCancelFlag | If the cancel flag becomes false during operation, revokeOrders will stop and throw a BpsException. |
BpsException | Thrown when revoking failed or was aborted. |
|
signal |
Emitted when a spontaneous robot specific event happens.
See documentation of the respective robot interface for details.
aEvt | Event type identifier. |
aData | Data record. |
|
virtual |
Send back a subjob after a LU got finalized.
aOrdertrip | Key of the order trip. |
aLuid | The id of the logistic unit that was finalized. |
aCancelFlag | It the cancel flag becomes false during operation, sendSubjobLu will stop and throw a BpsException. |
|
signal |
Emitted at start of operation to begin showing the progress indicator.
The indicator should have value ticks from 0 to aMaximum, and be set initially to 0.
aMaximum | Highest tick value, usually the number of processed items. |
aLabel | Label to display in the progress indicator. Use QString() to display no label. |
void BpsRobot::showProgressMessage | ( | const QString & | aMessage | ) |
Emit signals to show a progress message with undefined running length.
aMessage | The message to display. |
Get the orderitem selecting condition for subjobs created by this robot.
For example a subjobItemCondition(bStr("c.")) might return something like "c.c_originfo like 'Osiris;%'".
aPrefix | Prefix to use for the columns of t_orderitems. |
|
virtual |
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.
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.
aOrderType | Type of the records addressed by aKeys. |
aKeys | List of keys to process. Only keys belonging to a single trip are to be included. |
aSyncMode | Synchronizing mode. |
aCancelFlag | If the cancel flag becomes false during operation, syncOrders will stop and throw a BpsException. |
BpsException | Thrown when sending the trip failed or was aborted. |
|
virtual |
Import all robot stocks into the BPS stock.
The default implementation does nothing.
aCancelFlag | It the cancel flag becomes false during operation, syncStock will stop and throw a BpsException. |
BpsException | Thrown when querying the stock levels failed or was aborted. |
void BpsRobot::unlock | ( | ) |
Unlock the zone, in case it was locked by the current actor.
Equivalent to utils()->unlockRobot(zone()).
BpsException | thrown on SQL errors. |
|
signal |
Emitted to update the progress label text.
aLabel | New label text to display in the progress indicator. |
|
signal |
Emitted to change the highest tick value.
aMaximum | Highest tick value, usually the number of processed items. |
|
signal |
Emitted when progress reaches next value to update the progress indicator.
aValue | The value tick reached in the range 1...aMaximum, see showProgress(). |
QVariant BpsRobot::zone | ( | ) | const |
QString BpsRobot::zoneName | ( | ) | const |