|
|
@ -24,20 +24,35 @@ template<class D> MString ActionTSC::DoAction(const CLArgs& args, D& ds) |
|
|
|
auto [tindexes, err] = GetTIndexes(ds, args, pars); |
|
|
|
auto [tindexes, err] = GetTIndexes(ds, args, pars); |
|
|
|
if(err.Exist()) return err; |
|
|
|
if(err.Exist()) return err; |
|
|
|
|
|
|
|
|
|
|
|
if(!args.contains("var")) return "Variables not specified"; |
|
|
|
MString varstring; |
|
|
|
auto vlist = michlib::Split_on_words(args.at("var"), " ,", false); |
|
|
|
if(args.contains("var")) |
|
|
|
|
|
|
|
varstring = args.at("var"); |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if(args.contains("vars")) |
|
|
|
|
|
|
|
varstring = args.at("vars"); |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if constexpr(HasDefVars<D>) |
|
|
|
|
|
|
|
varstring = ds.DefaultVars(); |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
return "Variables not specified"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
auto vlist = michlib::Split_on_words(varstring, " ,", false); |
|
|
|
std::vector<MString> vnames{std::make_move_iterator(std::begin(vlist)), std::make_move_iterator(std::end(vlist))}; |
|
|
|
std::vector<MString> vnames{std::make_move_iterator(std::begin(vlist)), std::make_move_iterator(std::end(vlist))}; |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::set<MString> used; |
|
|
|
std::set<MString> used; |
|
|
|
for(const auto& vname: vnames) |
|
|
|
for(const auto& vname: vnames) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if(used.contains(vname)) return "Duplicate variable " + vname + " in list " + args.at("var"); |
|
|
|
if(used.contains(vname)) return "Duplicate variable " + vname + " in list " + varstring; |
|
|
|
if(!ds.CheckVar(vname)) return "Variable " + vname + " not exists in this dataset"; |
|
|
|
if(!ds.CheckVar(vname)) return "Variable " + vname + " not exists in this dataset"; |
|
|
|
used.insert(vname); |
|
|
|
used.insert(vname); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
pars.SetParameter("variables", args.at("var")); |
|
|
|
pars.SetParameter("variables", varstring); |
|
|
|
|
|
|
|
|
|
|
|
std::unique_ptr<const BaseParameters> sourcepars; |
|
|
|
std::unique_ptr<const BaseParameters> sourcepars; |
|
|
|
if constexpr(ParametersSupported<D>) |
|
|
|
if constexpr(ParametersSupported<D>) |
|
|
|