VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
askIfCanTask.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2015 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
8 
9 #pragma once
10 
11 #if !defined(Q_MOC_RUN)
14 #include <vrfutil/rwUUID.h>
15 
17 #endif
18 
19 #include <vector>
20 #include <string>
21 #include <map>
22 
23 #include <QtWidgets/QWidget>
24 #include <QtCore/QTime>
25 
26 class DtSimTask;
27 class QTimer;
28 class QLabel;
29 class QPushButton;
30 
31 namespace makVrv
32 {
33  class DtDe;
34 }
35 
36 namespace makVrf
37 {
41  {
42  Q_OBJECT
43 
44  public:
45  DtAskIfCanTaskDialog(makVrv::DtDe&, QWidget* parent);
46 
47  virtual ~DtAskIfCanTaskDialog() override;
48 
50  virtual std::vector<DtUUID> askIfCanTask(const std::vector<DtUUID>& names, const DtSimTask& newTask);
51 
53  virtual int exec();
54 
55  boost::signals2::signal<void ()> signal_accept;
56  boost::signals2::signal<void ()> signal_reject;
57 
58  protected:
60  virtual void setupGui();
61 
63  virtual void receiveCurrentTasks(const DtUUID&, const DtVrfCurrentTaskManager::EntityTaskInformation&);
64 
67 
69  virtual void timeout();
70 
71  virtual void closeEvent(QCloseEvent*) override;
72 
73  protected slots:
74  virtual void accept();
75  virtual void reject();
76 
78  virtual void askToTask();
79 
81  virtual void timerCheck();
82 
84  virtual void hideMe();
85 
87  virtual bool shouldInterruptTask(DtSimObjectReference);
88 
90  virtual bool shouldAbandonPlan(DtSimObjectReference);
91 
92  public:
93  QWidget* myWaitingFrame;
96 
97  protected:
99  QVector<DtUUID> myAskingToTask;
100  std::vector<DtUUID> myToTask;
102 
103  typedef std::map<DtUUID, QString> NeedToAskMap;
105 
106  QTimer* myCheckTimer;
108 
111 
112  QRect myGeometry;
113  int myResult = -1;
114  };
115 
120  {
121  public:
123 
125  virtual ~DtAskIfCanTask() override;
126 
127  static DtAskIfCanTask& instance(makVrv::DtDe&);
128  static void registerInstance(makVrv::DtDe&, DtAskIfCanTask *);
129 
133  virtual std::vector<DtUUID> askIfCanTask(const std::vector<DtUUID>& names, const DtSimTask& newTask);
134 
135  protected:
136  virtual DtAskIfCanTaskDialog* createAskToTaskDialog(QWidget* parent);
137 
138  protected:
140  };
141 }
UUID is a unique ID wrapper class.
Definition: uuid.h:59
boost::signals2::signal< void()> signal_reject
Definition: askIfCanTask.h:56
QTimer * myCheckTimer
Definition: askIfCanTask.h:106
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
Definition: DtVirtualBaseClass.h:19
QTime myElapsedTimer
Definition: askIfCanTask.h:107
makVrv::DtDe & myDe
Definition: askIfCanTask.h:98
Dialog that will present the names of the tasks/plans to be interrupted. Will ask user if it is ok to...
Definition: askIfCanTask.h:40
std::vector< DtUUID > myToTask
Definition: askIfCanTask.h:100
std::shared_ptr< DtSimTask > DtSimTaskSharedPtr
Definition: vrfCurrentTaskManager.h:44
Contains the DtUUID class declaration.
makVrv::DtDe & myDe
Definition: askIfCanTask.h:139
NeedToAskMap myNeedToAsk
Definition: askIfCanTask.h:104
Contains makVrf::DtAskIfCanTask class. This class will create a DtAskIfCanTask dialog to ask the user...
Definition: askIfCanTask.h:119
QPushButton * myCancel
Definition: askIfCanTask.h:95
QVector< DtUUID > myAskingToTask
Definition: askIfCanTask.h:99
Contains makVrv::DtVirtualBaseClass class.
#define DT_DLL_VRFGUICOMMONQT
Definition: vrfGuiCommonQt.h:20
std::map< DtUUID, QString > NeedToAskMap
Definition: askIfCanTask.h:103
QWidget * myWaitingFrame
Definition: askIfCanTask.h:93
QRect myGeometry
Definition: askIfCanTask.h:112
boost::signals2::signal< void()> signal_accept
Definition: askIfCanTask.h:55
DtSimTask is an abstract base class from which real tasks can derive. It manages the read/write capab...
Definition: simTask.h:30
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:76
int mySelectedInterruptAll
Definition: askIfCanTask.h:109
DtSimTask * myNewTask
Definition: askIfCanTask.h:101
QLabel * myWaitingLabel
Definition: askIfCanTask.h:94
std::vector< TaskInformation > EntityTaskInformation
Definition: vrfCurrentTaskManager.h:60
int mySelectedAbandonAll
Definition: askIfCanTask.h:110

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)