21 #include <tjutils/tjstate.h>
22 #include <tjutils/tjhandler.h>
24 #include <odinpara/protocol.h>
26 #include <odinseq/seqlist.h>
27 #include <odinseq/seqplatform.h>
49 Log<Seq> odinlog(
"SeqMethodProxy",
"SeqMethodProxy()");
52 static void set_current_method(
unsigned int index);
54 static unsigned int get_numof_methods();
55 static unsigned int delete_methods();
56 static const char* get_method_label();
58 static const char* get_status_string();
61 SeqMethod* operator -> () {
return get_current_method();}
62 SeqMethod& operator [] (
unsigned int index);
64 static bool load_method_so(
const STD_string& so_filename);
67 static void init_static();
68 static void destroy_static();
74 static void register_method(
SeqMethod* meth);
80 struct MethodList :
public STD_list<SeqMethod*>,
public Labeled {};
86 struct MethodPtr :
public Labeled {
175 bool clear() {
return empty.obtain_state();}
180 bool init() {
return initialised.obtain_state();}
185 bool build() {
return built.obtain_state();}
190 bool prepare() {
return prepared.obtain_state();}
227 int write_protocol(
const STD_string& filename)
const {create_protcache();
return protcache->
write(filename);}
336 void set_current_testcase(
unsigned int index) {
if(index<
numof_testcases()) current_testcase=index;}
406 void set_parblock_labels();
412 void parameter_relations(LDReditWidget* editwidget);
420 STD_string description;
422 unsigned int current_testcase;
429 void create_protcache()
const;
436 State<SeqMethod> empty;
439 State<SeqMethod> initialised;
440 bool empty2initialised();
442 State<SeqMethod> built;
443 bool initialised2built();
445 State<SeqMethod> prepared;
446 bool built2prepared();
454 #define ODINMETHOD_STRINGIZE_MACRO(x) #x
455 #define ODINMETHOD_STRINGIZE(x) ODINMETHOD_STRINGIZE_MACRO(x)
460 #define ODINMETHOD_ENTRY_POINT \
461 int ODINMAIN(int argc, char *argv[]) {\
462 return (new METHOD_CLASS(ODINMETHOD_STRINGIZE(METHOD_LABEL)))->process(argc,argv); \
467 #define ODINMETHOD_ENTRY_POINT \
468 int ODINMAIN(int argc, char *argv[]) {\
469 if(LogBase::set_log_levels(argc,argv,false)) return 0; \
470 return (new METHOD_CLASS(ODINMETHOD_STRINGIZE(METHOD_LABEL)))->process(argc,argv); \
int load(const STD_string &filename, const LDRserBase &serializer=LDRserJDX())
int write(const STD_string &filename, const LDRserBase &serializer=LDRserJDX()) const
Base class for methods (sequences)
SeqMethod & append_parameter(LDRbase &ldr, const STD_string &label, parameterMode parmode=edit)
SeqPars & get_commonPars()
SeqMethod & set_description(const char *descr)
const char * get_description() const
virtual void method_pars_init()=0
SeqMethod & set_geometry(const Geometry &geo)
int write_protocol(const STD_string &filename) const
SeqMethod & set_sequence(const SeqObjBase &s)
LDRblock & get_methodPars()
unsigned int event(eventContext &context) const
bool prep_acquisition() const
STD_list< const SeqPulsar * > get_active_pulsar_pulses() const
SeqMethod & init_systemInfo(double basicfreq, double maxgrad, double slewrate)
int load_geometry(const STD_string &filename)
unsigned int get_numof_acquisitions() const
bool set_sequenceParameter(const STD_string ¶meter_label, const STD_string &value)
SeqMethod(const STD_string &method_label)
unsigned int get_current_testcase() const
int write_recoInfo(const STD_string &filename) const
virtual void method_rels()=0
virtual void method_seq_init()=0
int load_sequencePars(const STD_string &filename)
int process(int argc, char *argv[])
SeqMethod & set_commonPars(const SeqPars &pars)
virtual void method_pars_set()=0
Geometry & get_geometry()
int write_sequencePars(const STD_string &filename) const
double get_totalDuration() const
STD_string get_main_nucleus() const
int write_meas_contex(const STD_string &prefix) const
int write_geometry(const STD_string &filename) const
int load_systemInfo(const STD_string &filename)
int write_systemInfo(const STD_string &filename) const
int load_protocol(const STD_string &filename)
virtual unsigned int numof_testcases() const
Container for sequence objects.
Sequence Parameter proxy.
Pulsar pulses, combines OdinPulse and SeqPulsNdim.
STD_string get_main_nucleus() const