68 #include <wx/msgdlg.h>
69 #include <wx/stopwatch.h>
70 #include <wx/filename.h>
71 #include <wx/datetime.h>
161 return "net_blast_data_source";
167 return "Net BLAST Data Source";
248 ERR_POST(
Info <<
"Registered Net BLAST Data Source - " <<
t <<
" sec");
319 const CObject* obj = it->object.GetPointer();
346 menu->Append(wxID_SEPARATOR,
wxT(
"Top Actions"));
353 if( ! jobs.empty()) {
367 if(items.size() != 1) {
383 wxMenu* menu =
new wxMenu;
384 menu->Append(wxID_SEPARATOR,
wxT(
"Top Actions"));
388 contrib.first = menu;
402 descr->Init(params, *
this);
414 descr->Init(rid, *
this);
426 if( ! descr->IsDeleted()) {
427 descriptors.push_back(descr);
440 if( descr->GetRID() == rid ){
456 LOG_POST(
Info <<
"Net BLAST Data Source - saving job descriptors...");
460 vector< CRef<CUser_object> > jobs;
470 jobs.push_back(job_obj);
473 LOG_POST(
Error <<
"Saving Net BLAST jobs - exception while saving a job - " << e.
GetMsg());
485 LOG_POST(
Info <<
"Net BLAST Data Source - finished saving job descriptors");
494 LOG_POST(
Info <<
"Net BLAST Data Source - loading job descriptors...");
498 if (wxFileName::FileExists(path)) {
508 for(
size_t i = 0;
i < jobs.size();
i++ ) {
512 descr->FromUserObject(job_obj);
519 LOG_POST(
Info <<
"Net BLAST Data Source - finished loading job descriptors");
536 for(
size_t i = 0;
i < jobs.size();
i++) {
538 RIDs.push_back(descr.
GetRID());
542 task->Init_RetrieveRID(RIDs);
551 task->Init_Monitoring(jobs);
559 for(
size_t i = 0;
i < descriptors.size();
i++) {
614 monitor_jobs.push_back(descr);
619 size_t n = monitor_jobs.size();
621 LOG_POST(
Info <<
"Net BLAST start monitoring for " <<
n <<
" jobs");
630 : m_Descr(
"Net BLAST Client Service",
"",
"",
"",
"NetBlastUI" )
657 static string ext_id(
"net_blast_data_source_type");
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
static void COpenDialog(IWorkbench *workbench, const string &loader_label=NcbiEmptyString, const vector< wxString > &filenames=vector< wxString >())
CAppTaskService - Application Task Service.
static CBLASTDatabases & GetInstance()
void Load(const char *path, const char *dbtree)
CBLASTParams - save user-specified parameters and preferences.
virtual void SelectToolByName(const string &name)
CRegistryWriteView GetWriteView(const string §ion)
get a read-write view at a particular level.
static CGuiRegistry & GetInstance()
access the application-wide singleton
CRegistryReadView GetReadView(const string §ion) const
get a read-only view at a particular level.
CNetBLASTUIDataSourceType.
CNetBlastDSEvtHandler - wxEvtHandler-derived adapter for Net BLAST data source.
void OnLoadRIDs(wxCommandEvent &event)
void OnMonitor(wxCommandEvent &event)
CNetBlastDSEvtHandler(CNetBLASTUIDataSource &ds)
void OnRetrieve(wxCommandEvent &event)
void OnDelete(wxCommandEvent &event)
void OnExplore(wxCommandEvent &event)
CNetBLASTUIDataSource::TJobDescrVec m_Jobs
CNetBlastDSEvtHandler(CNetBLASTUIDataSource &ds, CNetBLASTUIDataSource::TJobDescrVec &jobs)
CRef< CNetBLASTUIDataSource > m_NetBlastDS
class CRegistryReadView provides a nested hierarchical view at a particular key.
CProjectSelectOptions - describes how new Project Items shall be added to a workspace.
static wxString ResolvePath(const wxString &path, const wxString &rel_name)
Utility function to hide the platform specifics of locating our standard directories and files.
CUICommandRegistry is a centralized registry where all application commands should be registered.
static CUICommandRegistry & GetInstance()
the main instance associated with the application
wxMenuItem * AppendMenuItem(wxMenu &menu, TCmdID cmd_id) const
CUser_object & AddField(const string &label, const string &value, EParseField parse=eParse_String)
add a data field to the user object that holds a given value
const CUser_field & GetField(const string &str, const string &delim=".", NStr::ECase use_case=NStr::eCase) const
Access a named field in this user object.
pair< wxMenu *, wxEvtHandler * > TContribution
Contribution consists of a Menu object and event handler.
pair< wxMenu *, wxEvtHandler * > TContribution
IServiceLocator - an abstract mechanism for locating services.
IUIDataSourceType - defines a type of a Data Source, can serve as a Data Source factory.
IUIDataSource - an interface representing a Data Source.
IUIObject - object that provides basic properties often required in a UI object.
IViewManagerService IViewManagerService manages views in Workbench.
IWorkbench is the central interface in the application framework.
virtual int GetType() const =0
const TData & GetData() const
void(*)(CSeq_entry_Handle seh, IWorkbench *wb, const CSerialObject &obj) handler
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
void Error(CExceptionArgs_Base &args)
const string & GetMsg(void) const
Get message string.
void Info(CExceptionArgs_Base &args)
CIRef< T > GetServiceByType()
retrieves a typed reference to a service, the name of C++ type is used as the name of the service.
void AddTask(IAppTask &task)
Add a task to the queue.
virtual CIRef< IView > ShowSingletonView(const string &singleton_ui_name)=0
activates the specified view, create a new view if it does not exist
void x_AutoStartMonitoring()
virtual int GetDefaultCommand()
friend class CNetBlastDSEvtHandler
void GetJobDescriptors(TJobDescrVec &descriptors)
returns Job Descriptors not marked as Deleted
void DeleteJobDescriptors(TJobDescrVec &descriptors)
friend class CNetBlastJobDescriptor
void x_StartTask(CBlastSearchTask &task)
void StartMonitoringTask(TJobDescrVec &descriptors)
virtual string GetExtensionIdentifier() const
returns the unique human-readable identifier for the extension the id should use lowercase letters se...
virtual void SetServiceLocator(IServiceLocator *locator)
CRef< CNetBlastJobDescriptor > FindJobDescriptor(const string &rid)
virtual void SaveSettings() const
virtual IUIDataSourceType & GetType() const
void StartRetrievingTask(TJobDescrVec &descriptors)
virtual const IUIObject & GetDescr()
returns UI description of the object (label, icon etc.)
virtual void SetRegistryPath(const string &path)
objects::CUser_object * ToUserObject() const
virtual void LoadSettings()
virtual void SetLoadingOptions(CSelectProjectOptions &options)
define how the task results shall be handled
virtual void EditProperties()
virtual bool IsOpen()
a Data source needs to be open before use and closed after.
void x_SaveJobDescriptors()
CRef< CNetBLASTUIDataSourceType > m_Type
CFastMutex m_JobDescrMutex
IServiceLocator * m_SrvLocator
virtual string GetExtensionLabel() const
returns a displayable label for this extension ( please capitalize the key words - "My Extension" )
CNetBLASTUIDataSourceType()
CNetBLASTUIDataSourceType.
virtual wxEvtHandler * CreateEvtHandler()
#define NET_BLAST_LOADER_LABEL
virtual bool Open()
Prepares Data Source for use, any initialization that can be potentially time-consuming or may requir...
void x_OnJobDescrChanged(CNetBlastJobDescriptor &descr)
callback - invoked by CNetBlastJobDescriptor
CRef< CNetBlastJobDescriptor > CreateJobDescriptor(const CBLASTParams ¶ms)
virtual string GetExtensionIdentifier() const
returns the unique human-readable identifier for the extension the id should use lowercase letters se...
#define NET_BLAST_DM_TOOL_NAME
virtual bool AutoCreateDefaultDataSource()
returns "true" if this type needs to create a default instance of the Data Source at start-up
vector< CRef< CNetBlastJobDescriptor > > TJobDescrVec
virtual IObjectCmdContributor::TContribution GetMenu(TConstScopedObjects &objects)
returns a menu with commands applicable to the objects and optional command handler for the commands ...
void x_LoadJobDescriptors()
virtual const IUIObject & GetDescr()
returns UI description of the type (label, icon etc.)
virtual ~CNetBLASTUIDataSource()
void MarkDeleted(bool deleted)
virtual IUIToolManager * GetLoadManager()
virtual IUIDataSource * CreateDataSource()
factory method; create an Data Source instance
virtual string GetExtensionLabel() const
returns a displayable label for this extension ( please capitalize the key words - "My Extension" )
static CIRef< IExtensionRegistry > GetInstance()
provides access to the Singleton
void Post(CRef< CEvent > evt, EDispatch disp_how=eDispatch_Default, int pool_name=ePool_Default)
Handles an event asynchronously (process and/or dispatch).
virtual const string & GetLabel() const
vector< SConstScopedObject > TConstScopedObjects
#define MSerial_AsnText
I/O stream manipulators –.
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
IO_PREFIX::ofstream CNcbiOfstream
Portable alias for ofstream.
IO_PREFIX::ifstream CNcbiIfstream
Portable alias for ifstream.
static string DoubleToString(double value, int precision=-1, TNumToStringFlags flags=0)
Convert double to string.
double Restart(void)
Return time elapsed since first Start() or last Restart() call (in seconds).
double Elapsed(void) const
Return time elapsed since first Start() or last Restart() call (in seconds).
void Stop(void)
Suspend the timer.
string AsSmartString(CTimeSpan::ESmartStringPrecision precision, ERound rounding, CTimeSpan::ESmartStringZeroMode zero_mode=CTimeSpan::eSSZ_SkipZero) const
Transform elapsed time to "smart" string.
void Start(void)
Start the timer.
@ eStart
Start timer immediately after creating.
const TData & GetData(void) const
Get the Data member data.
void SetType(TType &value)
Assign a value to Type data member.
const TObjects & GetObjects(void) const
Get the variant data.
static const char * kCmdExtPoint
static const char * kJobsTag
static const wxChar * kJobDescrPath
static const char * kNetBLAST_DS_Icon
CNetBLASTUIDataSource.
static const char * kAppExpCmdExtPoint
ViewerWindowBase::OnEditMenu ViewerWindowBase::OnJustification EVT_MENU(MID_SHOW_GEOM_VLTNS, ViewerWindowBase::OnShowGeomVltns) EVT_MENU(MID_FIND_PATTERN