23 #include "wxgis/net/netfactory.h"
24 #include "wxgis/net/netevent.h"
25 #include "wxgis/geoprocessing/tskmngr.h"
26 #include "wxgis/core/json/jsonval.h"
27 #include "wxgis/core/pointer.h"
29 #include <wx/dynarray.h>
40 wxGISTaskMessage(
long nId = wxNOT_FOUND,
const wxString &sMsg = wxEmptyString, wxGISEnumMessageType eType = enumGISMessageUnk,
const wxDateTime &dt = wxDateTime::Now())
50 m_sMessage = Msg.m_sMessage;
52 m_eType = Msg.m_eType;
58 m_sMessage = Msg.m_sMessage;
60 m_eType = Msg.m_eType;
66 wxGISEnumMessageType m_eType;
70 WX_DECLARE_USER_EXPORTED_OBJARRAY(
wxGISTaskMessage, wxGISTaskMessagesArray, WXDLLIMPEXP_GIS_GP);
74 wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_GIS_GP, wxGISTASK_ADD,
wxGISTaskEvent);
75 wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_GIS_GP, wxGISTASK_DEL,
wxGISTaskEvent);
76 wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_GIS_GP, wxGISTASK_CHNG,
wxGISTaskEvent);
77 wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_GIS_GP, wxGISTASK_MESSAGEADDED,
wxGISTaskEvent);
88 wxGISTaskEvent(
int nTaskId = 0, wxEventType eventType = wxGISTASK_ADD,
long nMessageId = wxNOT_FOUND) : wxEvent(nTaskId, eventType)
90 m_nMessageId = nMessageId;
97 virtual wxEvent *Clone()
const {
return new wxGISTaskEvent(*
this); }
98 long GetMessageId(
void)
const {
return m_nMessageId;};
105 typedef void (wxEvtHandler::*wxGISTaskEventFunction)(
wxGISTaskEvent&);
107 #define wxGISTaskEventHandler(func) \
108 wxEVENT_HANDLER_CAST(wxGISTaskEventFunction, func)
110 #define EVT_GISTASK_ADD(func) wx__DECLARE_EVT0(wxGISTASK_ADD, wxGISTaskEventHandler(func))
111 #define EVT_GISTASK_DEL(func) wx__DECLARE_EVT0(wxGISTASK_DEL, wxGISTaskEventHandler(func))
112 #define EVT_GISTASK_CHNG(func) wx__DECLARE_EVT0(wxGISTASK_CHNG, wxGISTaskEventHandler(func))
113 #define EVT_GISTASK_MESSAGEADDED(func) wx__DECLARE_EVT0(wxGISTASK_MESSAGEADDED, wxGISTaskEventHandler(func))
116 WX_DECLARE_HASH_MAP(
int,
wxGISTaskBase*, wxIntegerHash, wxIntegerEqual, wxGISTaskMap );
133 virtual wxString GetName()
const;
134 virtual wxString GetLastError()
const;
135 virtual int GetId(
void)
const;
136 virtual wxGISEnumTaskStateType GetState(
void)
const;
137 virtual bool Delete(
void);
142 virtual void NetMessage(wxGISNetCommand eCmd, wxGISNetCommandState eCmdState,
const wxJSONValue &val);
143 virtual size_t GetSubTaskCount(
void)
const;
146 virtual int GetRunTaskCount(
void)
const;
149 virtual bool RenameTask(
const wxString& sNewName);
151 virtual void OnSubTaskChanged(
int nId);
153 virtual void SendNetMessageAsync(wxGISNetCommand eCmd, wxGISNetCommandState eCmdState,
const wxJSONValue &val);
154 virtual wxGISNetCommandState SendNetMessageSync(wxGISNetCommand eCmd, wxGISNetCommandState eCmdState,
const wxJSONValue &val);
157 virtual void ClearTasks(
void);
158 virtual void NetCommand(wxGISNetCommandState eCmdState,
const wxJSONValue &val);
159 virtual void NetNote(wxGISNetCommandState eCmdState,
const wxJSONValue &val);
164 wxGISEnumTaskStateType m_nState;
165 wxString m_sLastError;
166 wxGISTaskMap m_omSubTasks;
184 virtual wxString GetDescription(
void)
const;
185 virtual wxString GetExecutable(
void)
const;
186 virtual wxDateTime GetDateBegin(
void)
const;
187 virtual wxDateTime GetDateEnd(
void)
const;
188 virtual wxDateTime GetDateCreated(
void)
const;
189 virtual wxULongLong GetVolume(
void)
const;
190 virtual long GetPriority(
void)
const;
191 virtual void SetPriority(
long nPriority);
192 virtual double GetDone(
void)
const;
193 virtual void SetState(wxGISEnumTaskStateType eState);
194 virtual int GetChildrenCount()
const;
203 virtual void AddSubTask(
wxGISTask* pTask);
206 virtual wxGISTaskMessagesArray GetMessages(
void)
const;
209 virtual bool StartTask(
bool bWait =
false);
210 virtual bool StopTask(
bool bWait =
false);
212 virtual void NetNote(wxGISNetCommandState eCmdState,
const wxJSONValue &val);
214 wxString m_sDescription;
215 wxDateTime m_dtBeg, m_dtEnd, m_dtCreated;
216 wxString m_sExecPath;
217 wxULongLong m_nVolume;
222 wxGISTaskMessagesArray m_oaMessages;
223 int m_nChildrenCount;
240 virtual void SetName(
const wxString& sName);
241 virtual void SetDescription(
const wxString& sDescription);
242 virtual void SetExecutable(
const wxString& sExecutable);
259 virtual void ProcessNetMessage(
const wxNetMessage &msg);
260 virtual void SetMaxTaskExec(
short nMaxExecTaskCount);
261 virtual bool CreateTask(
wxGISTask*
const pTask);
263 virtual void SendNetMessageAsync(wxGISNetCommand eCmd, wxGISNetCommandState eCmdState,
const wxJSONValue &val);
264 virtual wxGISNetCommandState SendNetMessageSync(wxGISNetCommand eCmd, wxGISNetCommandState eCmdState,
const wxJSONValue &val);
The JSON value class implementation.
Definition: jsonval.h:91
Task Manager Server communicate class.
Definition: tskmngr.h:89
The Task event.
Definition: task.h:85