BPS C++ API  2.24.4
bpsrobot.h
Go to the documentation of this file.
1 
4 #ifndef BPSROBOT_H
5 #define BPSROBOT_H
6 
7 #include "bpscore_global.h"
8 #include <QObject>
9 #include <QVariantList>
10 #include <QVariantMap>
11 
12 class BpsDatastore;
13 class BpsOrderUtils;
14 
19 {
20  Q_OBJECT
22 
23 public:
27  enum Feature {
43  CanSyncStock
44  };
45 
51  SyncInvalid = 0,
52  SyncAll = 1,
53  SyncNew = 2,
54  SyncUpdate = 3
55  };
56 
60  enum OrderType {
61  TypeInvalid = 0,
62  TypeTrips = 1,
63  TypeRows = 2,
64  TypeCols = 3,
65  TypeItems = 4
66  };
67 
73  BpsRobot(BpsDatastore* aDatastore, const QVariant& aZone, QObject* aParent=0);
74 
78  virtual ~BpsRobot();
79 
87  virtual bool hasFeature(Feature aFeature);
88 
93 
98  void showProgressMessage(const QString& aMessage);
99 
103  QVariant zone() const;
104 
108  QString zoneName() const;
109 
114  QString pickMode() const;
115 
122  virtual QString subjobItemCondition(const QString& aPrefix = QString());
123 
130  virtual void sendSubjobLu(const QVariant& aOrdertrip, const QVariant& aLuid, volatile bool* aCancelFlag = nullptr);
131 
138  QVariantMap getOrdertripRobot(const QVariant& aOrdertrip) const;
139 
146  bool lock(int aTimeout, volatile bool* aCancelFlag = nullptr);
147 
153  void unlock();
154 
159  bool isLocked();
160 
177  virtual void loadOrdertrip(const QVariant& aOrdertripKey, volatile bool* aCancelFlag = nullptr);
178 
201  virtual void syncOrders(OrderType aOrderType, const QVariantList& aKeys, OrderSyncMode aSyncMode, volatile bool* aCancelFlag = nullptr);
202 
223  virtual void revokeOrders(OrderType aOrderType, const QVariantList& aKeys, volatile bool* aCancelFlag = nullptr);
224 
245  virtual void finishOrders(OrderType aOrderType, const QVariantList& aKeys, volatile bool* aCancelFlag = nullptr);
246 
255  virtual void syncStock(volatile bool* aCancelFlag = nullptr);
256 
267  virtual void control(int aOp, const QVariantMap& aInput, QVariantMap& aOutput, volatile bool* aCancelFlag = nullptr);
268 
269 signals:
270 
277  void showProgress(int aMaximum, const QString& aLabel);
278 
283  void updateProgressMaximum(int aMaximum);
284 
289  void updateProgressValue(int aValue);
290 
295  void updateProgressLabel(const QString& aLabel);
296 
301  void hideProgress();
302 
307  void itemSynced(const QVariant& aKey);
308 
313  void itemRejected(const QVariant& aKey);
314 
321  void robotEvent(int aEvt, const QVariantMap& aData);
322 
323 };
324 
325 #endif // BPSROBOT_H
Public include file for BPS CORE library macros.
#define BPSCORE_EXPORT
Declare class to be an import from the shared library.
Definition: bpscore_global.h:22
#define BPS_PRIVATE(Class)
Declare pointer to private object in a public class.
Definition: bpsglobals.h:102
BPS datastore class.
Definition: bpsdatastore.h:61
BPS order utilities.
Definition: bpsorderutils.h:19
Pick robot interface.
Definition: bpsrobot.h:19
void updateProgressValue(int aValue)
Emitted when progress reaches next value to update the progress indicator.
QVariant zone() const
void unlock()
Unlock the zone, in case it was locked by the current actor.
void updateProgressLabel(const QString &aLabel)
Emitted to update the progress label text.
virtual QString subjobItemCondition(const QString &aPrefix=QString())
Get the orderitem selecting condition for subjobs created by this robot.
virtual bool hasFeature(Feature aFeature)
Query information about available features.
void robotEvent(int aEvt, const QVariantMap &aData)
Emitted when a spontaneous robot specific event happens.
OrderType
Type of the key/keys to process.
Definition: bpsrobot.h:60
OrderSyncMode
Order items synchronize modes.
Definition: bpsrobot.h:50
virtual void revokeOrders(OrderType aOrderType, const QVariantList &aKeys, volatile bool *aCancelFlag=nullptr)
Revoke orders from the robot.
bool isLocked()
Check if robot is locked.
BpsDatastore * datastore() const
bool lock(int aTimeout, volatile bool *aCancelFlag=nullptr)
Lock the zone for exclusive robot access.
virtual void control(int aOp, const QVariantMap &aInput, QVariantMap &aOutput, volatile bool *aCancelFlag=nullptr)
Execute robot specific operations.
virtual void loadOrdertrip(const QVariant &aOrdertripKey, volatile bool *aCancelFlag=nullptr)
Load order trip into robot.
Feature
Feature identifiers.
Definition: bpsrobot.h:27
@ CanRevokeTrips
Supports revoking order trips with syncOrders().
Definition: bpsrobot.h:34
@ CanRevokeRows
Supports revoking order rows with syncOrders().
Definition: bpsrobot.h:35
@ CanRevokeCols
Supports revoking order cols with syncOrders().
Definition: bpsrobot.h:36
@ CanSyncRows
Supports syncing order rows with syncOrders().
Definition: bpsrobot.h:30
@ CanSyncCols
Supports syncing order cols with syncOrders().
Definition: bpsrobot.h:31
@ CanRevokeItems
Supports revoking order items with syncOrders().
Definition: bpsrobot.h:37
@ CanFinishItems
Supports finishing order items with syncOrders().
Definition: bpsrobot.h:41
@ CanFinishCols
Supports finishing order cols with syncOrders().
Definition: bpsrobot.h:40
@ CanFinishTrips
Supports finishing order trips with syncOrders().
Definition: bpsrobot.h:38
@ CanSyncItems
Supports syncing order items with syncOrders().
Definition: bpsrobot.h:32
@ CanSyncChanged
Supports syncing of changed items.
Definition: bpsrobot.h:33
@ CanFinishRows
Supports finishing order rows with syncOrders().
Definition: bpsrobot.h:39
@ CanSyncTrips
Supports syncing order trips with syncOrders().
Definition: bpsrobot.h:29
@ CanHandleSubjobs
The robot may send create subjobs for manual picking and receive back the finalized lu's.
Definition: bpsrobot.h:42
@ CanLoadTrip
Supports loading an order trip with loadOrdertrip().
Definition: bpsrobot.h:28
void hideProgress()
Emitted after the operation is completed (or failed or was aborted).
void showProgressMessage(const QString &aMessage)
Emit signals to show a progress message with undefined running length.
void itemRejected(const QVariant &aKey)
Emitted when a item was rejected by robot or because of data constraints.
virtual void sendSubjobLu(const QVariant &aOrdertrip, const QVariant &aLuid, volatile bool *aCancelFlag=nullptr)
Send back a subjob after a LU got finalized.
virtual void finishOrders(OrderType aOrderType, const QVariantList &aKeys, volatile bool *aCancelFlag=nullptr)
Finish order processing.
virtual void syncStock(volatile bool *aCancelFlag=nullptr)
Import all robot stocks into the BPS stock.
virtual ~BpsRobot()
Virtual default destructor.
QVariantMap getOrdertripRobot(const QVariant &aOrdertrip) const
Get the robot status record for order trip.
void updateProgressMaximum(int aMaximum)
Emitted to change the highest tick value.
QString zoneName() const
void showProgress(int aMaximum, const QString &aLabel)
Emitted at start of operation to begin showing the progress indicator.
void itemSynced(const QVariant &aKey)
Emitted when a item was successfully synced, e.g.
QString pickMode() const
Get the picking mode of this robots zone (robot.mifa, robot.geko, robot.tako, robot....
virtual void syncOrders(OrderType aOrderType, const QVariantList &aKeys, OrderSyncMode aSyncMode, volatile bool *aCancelFlag=nullptr)
Synchronize orders to the robot.
BpsRobot(BpsDatastore *aDatastore, const QVariant &aZone, QObject *aParent=0)