From 56b532f3af70c49f87f5b3c38adaffc52e0881eb Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (l)" <j.wuttke@fz-juelich.de> Date: Wed, 11 Nov 2015 09:18:48 +0100 Subject: [PATCH] annotate EMBEDDED_DIALOG to prepare for conversion of dialogs into command-line options --- TODO | 15 ++++++++++----- pub/lib/edif.cpp | 2 +- pub/lib/file_out.cpp | 2 +- pub/lib/import.cpp | 4 ++-- pub/lib/jsel.cpp | 2 +- pub/lib/manip.cpp | 5 +---- pub/lib/olf.cpp | 2 +- pub/lib/opr.cpp | 2 +- 8 files changed, 18 insertions(+), 16 deletions(-) diff --git a/TODO b/TODO index e8ca3acf..5eca0397 100644 --- a/TODO +++ b/TODO @@ -44,6 +44,16 @@ oi: wenn mehrere Files mit rank=2, automatisch in einen File packen ==== Refactoring ==== +Register all commands; +transform within-command dialogs into command options + + +(this replaces the following "dialog generics":) + - restore ask callback help for lists (prompt for list, not for string) + - restore help on "?" (e.g. expression help for 'md') + - default for plot range + + refactor func+op registration so that registered object can be const (assemble typed function list prior to registration) @@ -63,11 +73,6 @@ Documentation: - explain resol, conv, pconv - more info on commands (in command shell and in manual?) -dialog generics - - restore ask callback help for lists (prompt for list, not for string) - - restore help on "?" (e.g. expression help for 'md') - - default for plot range - When commands have become programmable: - review history - latest action on pX should be part of history diff --git a/pub/lib/edif.cpp b/pub/lib/edif.cpp index dff8dfb3..212e2464 100644 --- a/pub/lib/edif.cpp +++ b/pub/lib/edif.cpp @@ -206,7 +206,7 @@ void NEdif::edit_fnam() //! Modify coordinate names and units. void NEdif::edit_coord( string which ) -{ +{ // EMBEDDED_DIALOG CVar var( which ); NOlm::IterateO fiter; diff --git a/pub/lib/file_out.cpp b/pub/lib/file_out.cpp index 1fa8dd80..8b96e956 100644 --- a/pub/lib/file_out.cpp +++ b/pub/lib/file_out.cpp @@ -33,7 +33,7 @@ namespace NFileOut { //! Queries file names, and writes files. void NFileOut::save( string fmt, bool allow_overwrite ) -{ +{ // EMBEDDED_DIALOG string outfnam; NOlm::IterateO iter; while( POlo f=iter() ) { diff --git a/pub/lib/import.cpp b/pub/lib/import.cpp index 13161d36..835394c3 100644 --- a/pub/lib/import.cpp +++ b/pub/lib/import.cpp @@ -25,7 +25,7 @@ //! Create a new online file from interactive input. void NImport::read_in() -{ +{ // EMBEDDED_DIALOG POld fout; // *** set file name and coordinates *** @@ -300,7 +300,7 @@ store: //! Create a new online file from table. void NImport::read_tab( string qualif ) -{ +{ // EMBEDDED_DIALOG // ** parse qualif ** if( qualif.find_first_not_of("hvcsmd")!=string::npos ) throw S("ReadTab: invalid qualifier"); diff --git a/pub/lib/jsel.cpp b/pub/lib/jsel.cpp index 4387309c..712df981 100644 --- a/pub/lib/jsel.cpp +++ b/pub/lib/jsel.cpp @@ -24,7 +24,7 @@ //! Interactive spectrum selection. void JSelAsk( string quest, vector<int>& jLis ) -{ +{ // EMBEDDED_DIALOG NOlm::IterateO fiter; int nJmax = 0; while ( POlo f=fiter() ) diff --git a/pub/lib/manip.cpp b/pub/lib/manip.cpp index 54271683..b74f1bb8 100644 --- a/pub/lib/manip.cpp +++ b/pub/lib/manip.cpp @@ -777,7 +777,7 @@ void NManip::slices_sort_by_z() //! Change order of z coordinates. void NManip::zcoords_reorder() -{ +{ // EMBEDDED_DIALOG NOlm::IterateO fiter; int nzmin, nzmax = 0; char mod; @@ -1074,9 +1074,6 @@ void NManip::files_merge( const string& opts ) static int callNo=0; fnam = str( format( "merge%03u" ) % callNo++ ); } - //fnam = wask("Joined file name", fnam); - //if (fnam=="") - // return; fout->name = fnam; // doc lines: diff --git a/pub/lib/olf.cpp b/pub/lib/olf.cpp index e995774f..b1dce655 100644 --- a/pub/lib/olf.cpp +++ b/pub/lib/olf.cpp @@ -343,7 +343,7 @@ COlc::TWgt COlc::name2wgt( string name ) //! Prompt for curve description, and initialize things. void COlc::curve_query( const string& quest ) -{ +{ // EMBEDDED_DIALOG ask_again: string resp = sask( quest+" (or e(c|i)(r|w); h for help)" ); if ( resp=="h" ) { diff --git a/pub/lib/opr.cpp b/pub/lib/opr.cpp index 402f8269..fa0b5ea0 100644 --- a/pub/lib/opr.cpp +++ b/pub/lib/opr.cpp @@ -324,7 +324,7 @@ void NOperate::Integral() //! Integral operations to generate not only new y, but also new x. void NOperate::IntXY( string mode ) -{ +{ // EMBEDDED_DIALOG NOlm::IterateD fiter; bool with_d; -- GitLab