2004-05-17 22:15:10 +00:00
|
|
|
// $Id$
|
|
|
|
//
|
2004-04-10 09:11:03 +00:00
|
|
|
// The contents of this file are subject to the BOINC Public License
|
|
|
|
// Version 1.0 (the "License"); you may not use this file except in
|
|
|
|
// compliance with the License. You may obtain a copy of the License at
|
|
|
|
// http://boinc.berkeley.edu/license_1.0.txt
|
|
|
|
//
|
|
|
|
// Software distributed under the License is distributed on an "AS IS"
|
|
|
|
// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
|
|
// License for the specific language governing rights and limitations
|
|
|
|
// under the License.
|
|
|
|
//
|
|
|
|
// The Original Code is the Berkeley Open Infrastructure for Network Computing.
|
|
|
|
//
|
|
|
|
// The Initial Developer of the Original Code is the SETI@home project.
|
|
|
|
// Portions created by the SETI@home project are Copyright (C) 2002
|
|
|
|
// University of California at Berkeley. All Rights Reserved.
|
|
|
|
//
|
|
|
|
// Contributor(s):
|
|
|
|
//
|
2004-05-17 22:15:10 +00:00
|
|
|
// Revision History:
|
|
|
|
//
|
|
|
|
// $Log$
|
2004-07-13 05:56:03 +00:00
|
|
|
// Revision 1.7 2004/07/13 05:56:01 rwalton
|
|
|
|
// Hooked up the Project and Work tab for the new GUI.
|
|
|
|
//
|
2004-07-12 08:46:26 +00:00
|
|
|
// Revision 1.6 2004/07/12 08:46:25 rwalton
|
|
|
|
// Document parsing of the <get_state/> message
|
|
|
|
//
|
2004-06-25 22:51:00 +00:00
|
|
|
// Revision 1.5 2004/06/25 22:50:56 rwalton
|
|
|
|
// Client spamming server hotfix
|
|
|
|
//
|
2004-05-17 22:15:10 +00:00
|
|
|
// Revision 1.4 2004/05/17 22:15:09 rwalton
|
|
|
|
// *** empty log message ***
|
|
|
|
//
|
|
|
|
//
|
2004-04-10 09:11:03 +00:00
|
|
|
|
2004-04-11 04:37:10 +00:00
|
|
|
#ifndef _MAINDOCUMENT_H_
|
|
|
|
#define _MAINDOCUMENT_H_
|
|
|
|
|
|
|
|
#if defined(__GNUG__) && !defined(__APPLE__)
|
|
|
|
#pragma interface "MainDocument.cpp"
|
|
|
|
#endif
|
|
|
|
|
2004-06-25 22:51:00 +00:00
|
|
|
#include "XMLParser.h"
|
2004-07-12 08:46:26 +00:00
|
|
|
#include "ActiveTask.h"
|
|
|
|
#include "App.h"
|
|
|
|
#include "AppVersion.h"
|
|
|
|
#include "FileInfo.h"
|
|
|
|
#include "Message.h"
|
|
|
|
#include "Project.h"
|
|
|
|
#include "ProxyInfo.h"
|
|
|
|
#include "Result.h"
|
|
|
|
#include "Workunit.h"
|
2004-06-25 22:51:00 +00:00
|
|
|
|
2004-04-10 09:11:03 +00:00
|
|
|
|
2004-06-25 22:51:00 +00:00
|
|
|
class CMainDocument : public CXMLParser
|
2004-04-10 09:11:03 +00:00
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS(CMainDocument)
|
|
|
|
|
2004-07-12 08:46:26 +00:00
|
|
|
private:
|
|
|
|
wxSocketClient* m_pSocket;
|
2004-07-13 05:56:03 +00:00
|
|
|
wxSocketOutputStream* m_pSocketOutput;
|
|
|
|
wxSocketInputStream* m_pSocketInput;
|
|
|
|
wxTextOutputStream* m_pTextOutput;
|
|
|
|
wxTextInputStream* m_pTextInput;
|
|
|
|
|
2004-07-12 08:46:26 +00:00
|
|
|
|
|
|
|
wxDateTime m_dtCachedStateTimestamp;
|
|
|
|
wxDateTime m_dtCachedStateLockTimestamp;
|
|
|
|
bool m_bCachedStateLocked;
|
|
|
|
|
|
|
|
CArrayActiveTask m_ActiveTasks;
|
|
|
|
CArrayApp m_Apps;
|
|
|
|
CArrayAppVersion m_AppVersions;
|
|
|
|
CArrayFileInfo m_FileInfos;
|
|
|
|
CArrayProject m_Projects;
|
|
|
|
CArrayResult m_Results;
|
|
|
|
CArrayWorkunit m_Workunits;
|
|
|
|
|
|
|
|
CArrayMessage m_Messages;
|
|
|
|
|
|
|
|
CProxyInfo m_ProxyInfo;
|
|
|
|
|
2004-07-13 05:56:03 +00:00
|
|
|
wxInt32 SendMessageToCore(wxString& strMessage, wxTextInputStream** pTextInput);
|
2004-07-12 08:46:26 +00:00
|
|
|
|
|
|
|
wxInt32 CachedStateUpdate();
|
|
|
|
|
|
|
|
CApp* LookupApp(wxString& strName);
|
|
|
|
CAppVersion* LookupAppVersion(wxString& strName, wxInt32 iVersionNumber);
|
|
|
|
CWorkunit* LookupWorkunit(wxString& strName);
|
|
|
|
CResult* LookupResult(wxString& strName);
|
|
|
|
|
2004-04-10 09:11:03 +00:00
|
|
|
public:
|
2004-06-25 22:51:00 +00:00
|
|
|
CMainDocument();
|
|
|
|
~CMainDocument();
|
2004-04-11 04:37:10 +00:00
|
|
|
|
2004-07-12 08:46:26 +00:00
|
|
|
wxInt32 CachedStateLock();
|
|
|
|
wxInt32 CachedStateUnlock();
|
|
|
|
|
2004-07-13 05:56:03 +00:00
|
|
|
wxInt32 GetProjectCount();
|
|
|
|
wxString GetProjectName(wxInt32 iIndex);
|
|
|
|
wxString GetProjectAccountName(wxInt32 iIndex);
|
|
|
|
wxString GetProjectTotalCredit(wxInt32 iIndex);
|
|
|
|
wxString GetProjectAvgCredit(wxInt32 iIndex);
|
|
|
|
wxString GetProjectResourceShare(wxInt32 iIndex);
|
|
|
|
|
|
|
|
wxInt32 GetResultCount();
|
|
|
|
wxString GetResultProjectName(wxInt32 iIndex);
|
|
|
|
wxString GetResultApplicationName(wxInt32 iIndex);
|
|
|
|
wxString GetResultName(wxInt32 iIndex);
|
|
|
|
wxString GetResultCPUTime(wxInt32 iIndex);
|
|
|
|
wxString GetResultProgress(wxInt32 iIndex);
|
|
|
|
wxString GetResultTimeToCompletion(wxInt32 iIndex);
|
|
|
|
wxString GetResultReportDeadline(wxInt32 iIndex);
|
|
|
|
wxString GetResultStatus(wxInt32 iIndex);
|
2004-07-12 08:46:26 +00:00
|
|
|
|
|
|
|
};
|
2004-04-11 04:37:10 +00:00
|
|
|
|
2004-04-11 05:09:18 +00:00
|
|
|
#endif
|
|
|
|
|