(filename.empty()) {
59 boollookup_synfile =
true;
61vector<CRef<CMacroRep>> macro_list;
91 for(
auto&& it : macro_list) {
106 if(macro_names.empty()) {
117 for(
auto&& it : macro_names) {
139create_cmd->Execute();
145 LOG_POST(
Info<<
"Total time spent on executing the macro is: "<< time <<
" seconds.");
172 string msg=
"Execution of the macro has failed at "+ macro_rep.
GetTitle() +
" step:";
175errorDlg.SetException(
msg, err);
176errorDlg.ShowModal();
181 if(!report.GetLog().empty()) {
182 log<< report.GetName() <<
":\n"<< report.GetLog() <<
"\n";
185 const auto& logs = macro_stat.GetFunctionsLog();
187 log<< report.GetName() <<
":\n";
189 for(
const auto& it : logs) {
190 log<< it->Print() <<
"\n";
194 if(!report.GetErrorLog().empty()) {
195 log<<
"\nERRORS:\n"<< report.GetErrorLog();
206macro_rep.Reset(engine.
Parse(macro_name));
218 string msg(
"Parsing of "+ macro_name +
" step has failed:\n");
229 boolresolved =
true;
240vector<string> macro_names;
244 for(
const auto& name : macro_names) {
246macros.push_back(name);
void AddCommand(IEditCommand &command)
The following asn-selectors are defined to be used in the FOR EACH statement:
implements special composite command, which does not call to its internal commands when run the very ...
Class for parsed macro representation.
ICommandProccessor * m_CmdProcessor
bool x_ExecuteOneMacro(macro::CMacroRep ¯o_rep, macro::CMacroEngine &engine, CNcbiOstrstream &log, bool resolve_vars=false)
static const char * sm_AutofixWGS
vector< string > TVecMacroNames
static const char * sm_AutofixGB
void x_HandleOutput(const bool status, const bool add_user_object, const string &time)
bool x_ResolveVariables(CRef< macro::CMacroRep > macro_rep)
CRef< CMacroCmdComposite > m_MacroCmd
static TVecMacroNames s_GetMacroSteps(const CTempString ¯o_class)
CConstRef< objects::CSeq_submit > m_SeqSubmit
bool ExecuteMacros(const vector< string > ¯o_names, CNcbiOstrstream &log, bool add_user_object=false, bool resolve_vars=false)
static const char * sm_AutofixTSA
objects::CSeq_entry_Handle m_Seh
CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...
virtual void Execute(IEditCommand *command, wxWindow *window=0)=0
#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)
string ReportAll(TDiagPostFlags flags=eDPF_Exception) const
Report all exceptions.
void Info(CExceptionArgs_Base &args)
bool FindNcbiAutofixUserObject(const objects::CSeq_entry_Handle &tse)
virtual void Execute()
Do the editing action.
virtual void Unexecute()
Undo (opposite to Execute())
const CMacroStat & GetStatistics() const
Gets the most recently executed macro statistics.
const string & GetTitle() const
Return macro description.
bool AreThereGUIResolvableVars() const
Return true if there are any GUI variables.
static CMacroLib & GetInstance()
bool ReadAndParseMacros(const string &filename, vector< CRef< CMacroRep >> ¯o_list)
Parses a file containing macros and stores them in a list.
const CMacroLog & GetMacroReport() const
void GetMacroNames(vector< string > ¯o_names) const
Function builds a list of macro names in the library to use for example in the toolbar.
CRef< objects::CSeqdesc > MakeNcbiAutofixUserObject()
const string & GetErrorMessage() const
Get error message in case previous command was unsuccessful.
bool Exec(const CMacroRep ¯o_rep, const CMacroBioData &data, CRef< CMacroCmdComposite > CmdComposite, bool throw_on_error=false, CNcbiOstream *ostream=nullptr)
Executes a macro.
CMacroRep * Parse(const string ¯o_text)
Parses macro script into its binary representation.
void NcbiErrorBox(const string &message, const string &title="Error")
specialized Message Box function for reporting critical errors
EDialogReturnValue NcbiMessageBox(const string &message, TDialogType type=eDialog_Ok, EDialogIcon icon=eIcon_Exclamation, const string &title="Error", EDialogTextMode text_mode=eRaw)
CRef< C > Ref(C *object)
Helper functions to get CRef<> and CConstRef<> objects.
void Reset(void)
Reset reference object.
TObjectType & GetNCObject(void) const
Get object.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static SIZE_TYPE FindNoCase(const CTempString str, const CTempString pattern, SIZE_TYPE start, SIZE_TYPE end, EOccurrence which=eFirst)
Find the pattern in the specified range of a string using a case insensitive search.
double Elapsed(void) const
Return time elapsed since first Start() or last Restart() call (in seconds).
void Start(void)
Start the timer.
string AsString(const CTimeFormat &fmt=kEmptyStr) const
Transform stopwatch time to string.
void ReportMacroExecution()
Report when a macro is executed.
static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4