Public Types |
| enum | OrderSyncMode {
SyncAll = 0,
SyncNew = 1,
SyncUpdate = 2
} |
| | Order items synchronize modes. More...
|
| enum | OrderType {
Trips = 0,
Rows = 1,
Columns = 2,
Items = 3
} |
| | Type of the key/keys to process. More...
|
Signals |
| void | hideProgress () |
| | Emitted after the operation is completed (or failed or was aborted).
|
| void | itemRejected (const QVariant &aKey) |
| | Emitted when a item was rejected by robot or because of data constraints.
|
| void | itemSynced (const QVariant &aKey) |
| | Emitted when a item was successfully synced, e.g.
|
| void | showProgress (int aMaximum, const QString &aLabel) |
| | Emitted at start of operation to begin showing the progress indicator.
|
| void | updateProgressLabel (const QString &aLabel) |
| | Emitted to update the progress label text.
|
| void | updateProgressMaximum (int aMaximum) |
| | Emitted to change the highest tick value.
|
| void | updateProgressValue (int aValue) |
| | Emitted when progress reaches next value to update the progress indicator.
|
Public Member Functions |
| | BpsRobot (BpsDatastore *aDatastore, const QVariant &aZone, QObject *aParent=0) |
| BpsDatastore * | datastore () const |
| QVariantMap | getOrdertripRobot (const QVariant &aOrdertrip) const |
| | Get the robot status record for order trip.
|
| bool | lockRobot (int aTimeout, volatile bool *aCancelFlag=0) |
| | Lock the zone for exclusive robot access.
|
| virtual void | revokeOrders (OrderType aOrderType, const QVariantList &aKeys, volatile bool *aCancelFlag=0)=0 |
| | Revoke orders from the robot.
|
| virtual void | syncOrders (OrderType aOrderType, const QVariantList &aKeys, OrderSyncMode aSyncMode, volatile bool *aCancelFlag=0)=0 |
| | Synchronize orders to the robot.
|
| virtual void | syncStock (volatile bool *aCancelFlag=0)=0 |
| | Import all robot stocks into the BPS stock.
|
| void | unlockRobot () |
| | Unlock the zone, in case it was locked by the current actor.
|
| BpsOrderUtils * | utils () const |
| QVariant | zone () const |
| QString | zoneName () const |
|
virtual | ~BpsRobot () |
| | Virtual default destructor.
|
| virtual void BpsRobot::revokeOrders |
( |
OrderType |
aOrderType, |
|
|
const QVariantList & |
aKeys, |
|
|
volatile bool * |
aCancelFlag = 0 |
|
) |
| [pure 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.
- 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:
-
| [in] | aOrderType | Type of the records addressed by aKeys. |
| [in] | aKeys | List of keys to process. |
| [in] | aCancelFlag | If the cancel flag becomes false during operation, revokeOrders will stop and throw a BpsException. |
- Exceptions:
-
| BpsException | Thrown when revoking the trip failed or was aborted. |
| virtual void BpsRobot::syncOrders |
( |
OrderType |
aOrderType, |
|
|
const QVariantList & |
aKeys, |
|
|
OrderSyncMode |
aSyncMode, |
|
|
volatile bool * |
aCancelFlag = 0 |
|
) |
| [pure 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.
- 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:
-
| [in] | aOrderType | Type of the records addressed by aKeys. |
| [in] | aKeys | List of keys to process. |
| [in] | aSyncMode | Synchronizing mode. |
| [in] | aCancelFlag | If the cancel flag becomes false during operation, syncOrders will stop and throw a BpsException. |
- Exceptions:
-
| BpsException | Thrown when sending the trip failed or was aborted. |