$Id: TODO 265 2007-03-02 18:41:10Z wojdyr $
[ TODO list and tentative development plan ]
[ // = done, but not tested/documented     ]

* build engine (everything but GUI/CLI interface) as a dynamic library
  with more or less documented API (in fityk.h).
    tentative basic API: 
      int dataset_count();
      string info(string const& s);
      Command::Status execute(string const& s);
      load_data(int slot, 
                vec double x, vec double y, vec double sigma, string title);
     callbacks:
      typedef void message_handler_func(OutputStyle style, string const& s);
      void message_handler(message_handler_func);
  GUI and CLI interfaces will use more than this API.

* python interface to the library

------------------ release 0.8.0

* embedding python scripts 

* rewrite crystallographic part in python
  [IMPORTANT]

------------------ release 0.8.1

* cfityk: -q -> not enter into interactive mode
          if argument starts with "=->", interpret it as command
            use case: cfityk -q *.rdf "=-> i min(x if y > 0) in @*" 

* BUG, parsing problem: "i $a*$a" => Syntax error; "i 0+$a*$a" => OK

* (?)exporting data with info "info @n () [range] > file"
  if not redirected, should display ... [1234 lines more] rather than all lines

* GUI: script editor: button to change directories in absolute filenames

* GUI: button 'lock/unlock' on variables pane

* (GUI) stopping fitting interactively (when user doesn't want to wait longer);
  use threads? or wxTimer?

* GUI: buttons on sidebar>functions that make hwhm and shape equal
  for all functions (F[hwhm]=...; F[shape]=...) or independent.
  buttons should be active only when it's possible
   should also affect graphical peak adding (all 3 ways)

* GUI: logarithmic x scale

* @n.wssr, @n.ssr, @n.dof (degrees of freedom)

* file paths: _EXECUTED_SCRIPT_DIR_[/\:] should be replaced with
   cwd or dir of executed script

* GUI: in script editor, "info ...> file" should be marked differently
  than not redirected info 
  paths of files to be read should be checked 

* GUI: menu and script editor: "create macro", 2-click access to scripts
   in .fityk/macro directory

* info+ version: compiler, date, compilation flags, boost::spirit version 

------------------ 

* GUI: when printing, everything is first rescaled and rounded(!) for
  plot window at the screen, and then rescaled to the paper size. 
  This rounding causes visible artefacts at the printout.
  (wxDC.GetSize instead of plot.GetClientSize() ?)

* unused variables should not slow down fitting

------------------ 

* [Infrastructure] Set up BuildBot or similar system for build tests

* GUI: transparent icons, but still embedded in code. (either second xpm file
  and wxImage::SetAlpha, or file generated by QEmbed) 

* GUI: menu file icons (16x15 or 16x16?)

* user defined functions:
      - more sophisticated simplifications of expressions and CSE(!)
      - calculating limits, width, area, etc. for UDF(!)

* un-strip background: what to do if active dataset is different than the one
  the background was removed for.

* EMG function: how to calculate it? Now there are some problems with
  this function. There must be smarter way to implement it...

* (GUI) plot horizontal/vertical lines (X/Y | pos=2.34 | 100%)
     can be used to show theoretical peak positions in XRD

* ? GUI: changing data point size and line separately for each dataset,

* data load, ascii: optimize, loading many datafiles is slow

* info -- more informations about error, confidence limits, etc.
  graphical interface Fit > Info

* (GUI) vertical scaling using mouse on main plot near to left edge of the plot 

* improve Voigt function (cut-tails, better approx.) 
  eg. http://portal.acm.org/citation.cfm?doid=77626.77629

* GUI: it should be possible to constrain two parameters of two peak,
     at least to make them equal.

* GUI: menu Functions:
  Functions > Peak-Find Info -> animation
  Functions > Multidata P-F Info -> window with list of parameters (Xview-like)

* Function: check_parameters_out_of_domain() ?  
             eg. in Pearson shape > 0.5 , shape < 1e9
	     called from fitting iteration?
	     what if parameter is out-of-domain? change? disable function?
	                                          change and freeze?
	     set fit-fix-parameters-times = 5
	    simple-var bounds?
	    ? $$simple = ~{min2(max2($simple, -1e9), 1e9)}

* GUI: Data Editor - left/right/top/bottom - magic keywords: user would be
       asked to select point/range/rectangle in plot

* cmd/GUI: plot peak-groups: ==> plot (%a+%b+%c)  

* (GUI) different peak-draft for sigmoids/steps (new function category), 
         and for other functions

* (GUI) where config files should be stored on MS Windows? Registry or file?

* auto-freezing of peaks at disactivated range

* loading data -- use Difdaf library (when it will be ready) for powder
  diffraction data import.
  other formats (from survey): .jdx JCAMP-DX (www.jcamp.org)
		         Galactic (GRAMS/32) SPC files (especially multifiles)
			 Vamas (vms), 
			 multipart Siemens .raw data files
			 uxd,udf
  perhaps OPJ with liborigin and XLS with another library

* (GUI) single dialog for configuring main plot (and also aux. plots) (?)
  data point size and other properties can be put on data pane(?)

* (GUI, BUG) in Configure axes / peak labels: fonts are changed event
  if Apply is not pressed

* automatic background substraction - what are good algorithms?

* more sophisticated algorithms for peak detection

* fitting: GA fitting options, 
  a way to "shake" parameters for L-M

* fitting:
	simulated annealing (it can replace LM shake_before option)
	perhaps also BFGS, conjugate gradients methods

* fitting: it should be separated even more from the rest of the program.
  Perhaps it fitting functions should be in extern library (COOOL,
  GAUL, WNLIB, netlib, OOL.sf.net, levmar)
  are there any other such libraries? 
  I haven't investigated the possibility of using mentioned libs yet. 
  Links: 
  http://coool.mines.edu/ 
  http://gaul.sourceforge.net/, 
  http://www.willnaylor.com/wnlib.html
  http://sal.jyu.fi/B/3/index.shtml, http://coin-or.org
  http://www-unix.mcs.anl.gov/otc/Guide/faq/nonlinear-programming-faq.html 
  http://www.ics.forth.gr/~lourakis/levmar/

* fitting: robust fit - other error distributions then Gaussian, 
  eg. Lorenzian...; so called 'maximum-likelihood method' -- using Poisson
  error distribution.

* Now only '.' is supported as a decimal separator. ',' should also
  be an option.

* investigate LLVM - can it be used for faster calculation of 
  user-defined functions?

* [BUG] (GUI) (MS Win) <br> does not work in vertical peak labels 

* exporting formulae in MathML (when option formula-export-style == mathml)

* [BUG]: program crashes (MS Win 9x) when data contains NaN (as a result
  of asin(x) x>1) and "Zoom all" is called.

