Documents > BPS V2 C++ API
BpsRobotsGui Class Reference

GUI robots interface. More...

#include <bpsrobotsgui.h>

List of all members.

Signals

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.

Public Member Functions

 BpsRobotsGui (BpsRobots *aRobots, QObject *aParent=0)
bool lockRobot (const QVariant &aZone, QWidget *aParent)
 Lock the zone for exclusive robot access.
bool revokeOrders (const QVariant &aZone, BpsRobot::OrderType aOrderType, const QVariantList &aKeys, QWidget *aParent)
 Revoke orders from the robot.
BpsRobotsrobots () const
bool syncOrders (const QVariant &aZone, BpsRobot::OrderType aOrderType, const QVariantList &aKeys, BpsRobot::OrderSyncMode aSyncMode, QWidget *aParent)
 Synchronize orders to the robot.
bool syncStock (const QVariant &aZone, QWidget *aParent)
 Import all robot stocks into the BPS stock.

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 ( BpsRobots aRobots,
QObject *  aParent = 0 
)
Parameters:
[in]aRobotsThe robots object to be used.
[in]aParentThe parent object.

Member Function Documentation

void BpsRobotsGui::itemRejected ( const QVariant &  aKey) [signal]

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

Parameters:
[in]aKeyKey of the order item.
void BpsRobotsGui::itemSynced ( const QVariant &  aKey) [signal]

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

accepted by robot.

Parameters:
[in]aKeyKey of the order item.
bool BpsRobotsGui::lockRobot ( const QVariant &  aZone,
QWidget *  aParent 
)

Lock the zone for exclusive robot access.

Parameters:
[in]aZoneKey of the zone.
[in]aParentParent widget for progress dialog and message boxes.
Returns:
True if the lock was successful, false if not.
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:
[in]aZoneKey of the zone.
[in]aOrderTypeType of the records addressed by aKeys.
[in]aKeysList of keys to process.
[in]aParentParent widget for progress dialog and message boxes.
Returns:
True if all ok, false on partial success, cancel or errors.
BpsRobots* BpsRobotsGui::robots ( ) const
Returns:
The robots object.
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:
[in]aZoneKey of the zone.
[in]aOrderTypeType of the records addressed by aKeys.
[in]aKeysList of keys to process.
[in]aSyncModeSynchronizing mode.
[in]aParentParent widget for progress dialog and message boxes.
Returns:
True if all ok, false on partial success, cancel or errors.
bool BpsRobotsGui::syncStock ( const QVariant &  aZone,
QWidget *  aParent 
)

Import all robot stocks into the BPS stock.

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

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