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:
|
|
|
|
//
|
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-09-10 23:17:08 +00:00
|
|
|
#include "gui_rpc_client.h"
|
|
|
|
|
2004-04-10 09:11:03 +00:00
|
|
|
|
2004-08-11 23:52:22 +00:00
|
|
|
class CMainDocument : public wxObject
|
2004-04-10 09:11:03 +00:00
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS(CMainDocument)
|
|
|
|
|
2004-09-25 21:33:24 +00:00
|
|
|
public:
|
|
|
|
CMainDocument();
|
|
|
|
~CMainDocument();
|
|
|
|
|
2004-10-09 03:05:01 +00:00
|
|
|
wxInt32 OnInit();
|
|
|
|
wxInt32 OnExit();
|
|
|
|
wxInt32 OnIdle();
|
|
|
|
|
2004-10-19 18:14:40 +00:00
|
|
|
enum RESULTTYPES
|
|
|
|
{
|
|
|
|
RESULT_NEW = 0,
|
|
|
|
RESULT_FILES_DOWNLOADING = 1,
|
|
|
|
RESULT_FILES_DOWNLOADED = 2,
|
|
|
|
RESULT_COMPUTE_ERROR = 3,
|
|
|
|
RESULT_FILES_UPLOADING = 4,
|
|
|
|
RESULT_FILES_UPLOADED = 5
|
|
|
|
};
|
|
|
|
|
|
|
|
enum CPUSCHEDTYPES
|
|
|
|
{
|
|
|
|
CPU_SCHED_UNINITIALIZED = 0,
|
|
|
|
CPU_SCHED_PREEMPTED = 1,
|
|
|
|
CPU_SCHED_SCHEDULED = 2
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2004-09-25 21:33:24 +00:00
|
|
|
//
|
2004-09-29 22:21:45 +00:00
|
|
|
// Global
|
2004-09-25 21:33:24 +00:00
|
|
|
//
|
2004-07-12 08:46:26 +00:00
|
|
|
private:
|
2004-09-29 22:21:45 +00:00
|
|
|
|
2004-09-10 23:17:08 +00:00
|
|
|
RPC_CLIENT rpc;
|
2004-10-09 03:05:01 +00:00
|
|
|
CC_STATE state;
|
2004-10-19 18:14:40 +00:00
|
|
|
HOST_INFO host;
|
2004-10-09 03:05:01 +00:00
|
|
|
wxDateTime m_dtCachedStateTimestamp;
|
|
|
|
wxDateTime m_dtCachedStateLockTimestamp;
|
|
|
|
bool m_bCachedStateLocked;
|
2004-09-25 21:33:24 +00:00
|
|
|
|
2004-10-01 00:06:32 +00:00
|
|
|
bool m_bIsConnected;
|
|
|
|
|
2004-10-09 03:05:01 +00:00
|
|
|
wxInt32 CachedStateUpdate();
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
wxInt32 CachedStateLock();
|
|
|
|
wxInt32 CachedStateUnlock();
|
|
|
|
|
2004-09-29 22:21:45 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// Project Tab
|
|
|
|
//
|
|
|
|
private:
|
|
|
|
|
2004-09-25 21:33:24 +00:00
|
|
|
PROJECTS project_status;
|
2004-09-29 22:21:45 +00:00
|
|
|
float m_fProjectTotalResourceShare;
|
2004-09-25 21:33:24 +00:00
|
|
|
|
|
|
|
wxInt32 CachedProjectStatusUpdate();
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
wxInt32 GetProjectCount();
|
2004-10-22 00:41:18 +00:00
|
|
|
wxInt32 GetProjectProjectName( wxInt32 iIndex, wxString& strBuffer );
|
|
|
|
wxInt32 GetProjectProjectURL( wxInt32 iIndex, wxString& strBuffer );
|
|
|
|
wxInt32 GetProjectAccountName( wxInt32 iIndex, wxString& strBuffer );
|
|
|
|
wxInt32 GetProjectTeamName( wxInt32 iIndex, wxString& strBuffer );
|
|
|
|
wxInt32 GetProjectTotalCredit( wxInt32 iIndex, float& fBuffer );
|
|
|
|
wxInt32 GetProjectAvgCredit( wxInt32 iIndex, float& fBuffer );
|
|
|
|
wxInt32 GetProjectResourceShare( wxInt32 iIndex, float& fBuffer );
|
|
|
|
wxInt32 GetProjectTotalResourceShare( wxInt32 iIndex, float& fBuffer );
|
|
|
|
wxInt32 GetProjectMinRPCTime( wxInt32 iIndex, wxInt32& iBuffer );
|
|
|
|
wxInt32 GetProjectWebsiteCount( wxInt32 iIndex );
|
|
|
|
wxInt32 GetProjectWebsiteName( wxInt32 iProjectIndex, wxInt32 iWebsiteIndex, wxString& strBuffer );
|
|
|
|
wxInt32 GetProjectWebsiteDescription( wxInt32 iProjectIndex, wxInt32 iWebsiteIndex, wxString& strBuffer );
|
|
|
|
wxInt32 GetProjectWebsiteLink( wxInt32 iProjectIndex, wxInt32 iWebsiteIndex, wxString& strBuffer );
|
|
|
|
bool IsProjectSuspended( wxInt32 iIndex );
|
|
|
|
bool IsProjectRPCPending( wxInt32 iIndex );
|
2004-09-25 21:33:24 +00:00
|
|
|
|
|
|
|
wxInt32 ProjectAttach( wxString& strURL, wxString& strAccountKey );
|
2004-10-21 14:29:59 +00:00
|
|
|
wxInt32 ProjectDetach( wxInt32 iIndex );
|
|
|
|
wxInt32 ProjectUpdate( wxInt32 iIndex );
|
|
|
|
wxInt32 ProjectReset( wxInt32 iIndex );
|
|
|
|
wxInt32 ProjectSuspend( wxInt32 iIndex );
|
|
|
|
wxInt32 ProjectResume( wxInt32 iIndex );
|
2004-09-25 21:33:24 +00:00
|
|
|
|
2004-09-29 22:21:45 +00:00
|
|
|
|
2004-10-11 04:38:00 +00:00
|
|
|
//
|
|
|
|
// Work Tab
|
|
|
|
//
|
|
|
|
private:
|
|
|
|
RESULTS results;
|
|
|
|
|
|
|
|
wxInt32 CachedResultsStatusUpdate();
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
wxInt32 GetWorkCount();
|
2004-10-22 00:41:18 +00:00
|
|
|
wxInt32 GetWorkProjectName( wxInt32 iIndex, wxString& strBuffer );
|
|
|
|
wxInt32 GetWorkProjectURL( wxInt32 iIndex, wxString& strBuffer );
|
|
|
|
wxInt32 GetWorkApplicationName( wxInt32 iIndex, wxString& strBuffer );
|
2004-10-11 04:38:00 +00:00
|
|
|
wxInt32 GetWorkApplicationVersion(wxInt32 iIndex, wxInt32& iBuffer);
|
2004-10-22 00:41:18 +00:00
|
|
|
wxInt32 GetWorkName( wxInt32 iIndex, wxString& strBuffer );
|
|
|
|
wxInt32 GetWorkCurrentCPUTime( wxInt32 iIndex, float& fBuffer );
|
|
|
|
wxInt32 GetWorkEstimatedCPUTime( wxInt32 iIndex, float& fBuffer );
|
|
|
|
wxInt32 GetWorkFinalCPUTime( wxInt32 iIndex, float& fBuffer );
|
|
|
|
wxInt32 GetWorkFractionDone( wxInt32 iIndex, float& fBuffer );
|
|
|
|
wxInt32 GetWorkReportDeadline( wxInt32 iIndex, wxInt32& iBuffer );
|
|
|
|
wxInt32 GetWorkState( wxInt32 iIndex );
|
|
|
|
wxInt32 GetWorkSchedulerState( wxInt32 iIndex );
|
|
|
|
bool IsWorkAcknowledged( wxInt32 iIndex );
|
|
|
|
bool IsWorkActive( wxInt32 iIndex );
|
|
|
|
bool IsWorkReadyToReport( wxInt32 iIndex );
|
|
|
|
bool IsWorkSuspended( wxInt32 iIndex );
|
2004-10-11 04:38:00 +00:00
|
|
|
|
2004-10-21 14:29:59 +00:00
|
|
|
wxInt32 WorkSuspend( wxInt32 iIndex );
|
|
|
|
wxInt32 WorkResume( wxInt32 iIndex );
|
2004-10-22 08:51:50 +00:00
|
|
|
wxInt32 WorkShowGraphics( wxInt32 iIndex, bool bFullScreen );
|
|
|
|
wxInt32 WorkAbort( wxInt32 iIndex );
|
2004-10-19 18:14:40 +00:00
|
|
|
|
2004-10-11 04:38:00 +00:00
|
|
|
|
2004-09-29 22:21:45 +00:00
|
|
|
//
|
|
|
|
// Messages Tab
|
|
|
|
//
|
|
|
|
private:
|
|
|
|
|
|
|
|
MESSAGES messages;
|
|
|
|
wxInt32 m_iMessageSequenceNumber;
|
|
|
|
|
|
|
|
wxInt32 CachedMessageUpdate();
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
wxInt32 GetMessageCount();
|
2004-10-22 00:41:18 +00:00
|
|
|
wxInt32 GetMessageProjectName( wxInt32 iIndex, wxString& strBuffer );
|
|
|
|
wxInt32 GetMessageTime( wxInt32 iIndex, wxDateTime& dtBuffer );
|
|
|
|
wxInt32 GetMessagePriority( wxInt32 iIndex, wxInt32& iBuffer );
|
|
|
|
wxInt32 GetMessageMessage( wxInt32 iIndex, wxString& strBuffer );
|
2004-09-29 22:21:45 +00:00
|
|
|
|
|
|
|
|
2004-10-22 00:41:18 +00:00
|
|
|
//
|
|
|
|
// Transfers Tab
|
|
|
|
//
|
2004-09-25 21:33:24 +00:00
|
|
|
private:
|
|
|
|
|
2004-09-10 23:17:08 +00:00
|
|
|
FILE_TRANSFERS ft;
|
2004-07-12 08:46:26 +00:00
|
|
|
|
2004-10-22 00:41:18 +00:00
|
|
|
wxInt32 CachedFileTransfersUpdate();
|
|
|
|
|
2004-04-10 09:11:03 +00:00
|
|
|
public:
|
2004-04-11 04:37:10 +00:00
|
|
|
|
2004-09-10 23:17:08 +00:00
|
|
|
wxInt32 GetTransferCount();
|
2004-10-22 00:41:18 +00:00
|
|
|
wxInt32 GetTransferProjectName( wxInt32 iIndex, wxString& strBuffer );
|
2004-10-22 08:51:50 +00:00
|
|
|
wxInt32 GetTransferFileName( wxInt32 iIndex, wxString& strBuffer );
|
|
|
|
wxInt32 GetTransferFileSize( wxInt32 iIndex, float& fBuffer );
|
|
|
|
wxInt32 GetTransferBytesXfered( wxInt32 iIndex, float& fBuffer );
|
|
|
|
wxInt32 GetTransferSpeed( wxInt32 iIndex, float& fBuffer );
|
2004-10-22 18:39:21 +00:00
|
|
|
wxInt32 GetTransferTime( wxInt32 iIndex, float& fBuffer );
|
|
|
|
wxInt32 GetTransferNextRequestTime( wxInt32 iIndex, wxInt32& iBuffer );
|
|
|
|
wxInt32 GetTransferStatus( wxInt32 iIndex, wxInt32& iBuffer );
|
2004-10-22 08:51:50 +00:00
|
|
|
|
|
|
|
bool IsTransferActive( wxInt32 iIndex );
|
2004-10-22 18:39:21 +00:00
|
|
|
bool IsTransferGeneratedLocally( wxInt32 iIndex );
|
2004-09-10 23:17:08 +00:00
|
|
|
|
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
|
|
|
|
|