Changeset 2eded3e for src/Parameters


Ignore:
Timestamp:
Jun 19, 2017, 8:24:16 AM (8 years ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
Action_Thermostats, Add_AtomRandomPerturbation, Add_SelectAtomByNameAction, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_StructOpt_integration_tests, AutomationFragmentation_failures, Candidate_v1.6.1, ChangeBugEmailaddress, ChemicalSpaceEvaluator, EmpiricalPotential_contain_HomologyGraph_documentation, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, Fix_Verbose_Codepatterns, ForceAnnealing_oldresults, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, GeometryObjects, Gui_displays_atomic_force_velocity, IndependentFragmentGrids_IntegrationTest, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, StoppableMakroAction, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps
Children:
f79d65
Parents:
6d78b6f
git-author:
Frederik Heber <heber@…> (03/29/17 10:19:35)
git-committer:
Frederik Heber <frederik.heber@…> (06/19/17 08:24:16)
Message:

Added specific Value and Parameter implemenations for Vector.

  • for the CommandLineParser the values are get parsed immediately (prior to executing any Action). Hence, names of geometry objects that first need to be created by an action cannot yet be present in the registry and thus the Action will fail.
  • we need to postpone the replacement of the geometry name by its stored vector components until the Parameter<>::get() call. This is possible as the value is validated only on get(), not on set(), i.e. giving illegal values is ok, only the Action will fail.
  • therefore, we override the specialize the template Value for Vector to allow storing of a string instead of a Vector and to allow putting the actual parsing of the string in front.
  • the Parameter overriding becomes necessary in order to override clone() and copy cstor(), there using string setters.
  • ContinuousValueTest now needs lib..Parameters, lib..Geometry.
  • static functions parseAsVector and setFromVector for convenience, e.g. QtUI needs to convert from string and to Vector.
  • TESTS: Marked dryrun store-session again as XFAIL, removed XFAIL from load- session python.
Location:
src/Parameters
Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • src/Parameters/Makefile.am

    r6d78b6f r2eded3e  
    44
    55PARAMETERSOURCE = \
     6        Parameters/Specifics/Parameter_vector.cpp \
    67        Parameters/Specifics/Value_atom.cpp \
    78        Parameters/Specifics/Value_element.cpp \
     
    910        Parameters/Specifics/Value_molecule.cpp \
    1011        Parameters/Specifics/Value_string.cpp \
     12        Parameters/Specifics/Value_vector.cpp \
    1113        Parameters/Validators/Specific/ActionNameValidator.cpp \
    1214        Parameters/Validators/Specific/AtomDataValidator.cpp \
     
    4749        Parameters/ValueInterface.hpp \
    4850        Parameters/Specifics/KeyValuePair.hpp \
     51        Parameters/Specifics/Parameter_vector.hpp \
    4952        Parameters/Specifics/Value_atom.hpp \
    5053        Parameters/Specifics/Value_element.hpp \
     
    5255        Parameters/Specifics/Value_molecule.hpp \
    5356        Parameters/Specifics/Value_string.hpp \
     57        Parameters/Specifics/Value_vector.hpp \
    5458        Parameters/Validators/DiscreteValidator.hpp \
    5559        Parameters/Validators/DiscreteValidator_impl.hpp \
  • src/Parameters/Parameter.hpp

    r6d78b6f r2eded3e  
    2525class ParameterValueException;
    2626
    27 /** This class encapsulates a clonable, continuous value.
     27/** This class encapsulates a cloneable, continuous value.
    2828 *
    2929 */
     
    7979};
    8080
     81#include "Parameters/Specifics/Parameter_vector.hpp"
     82
    8183#include "Parameter_impl.hpp"
    8284
  • src/Parameters/Value.hpp

    r6d78b6f r2eded3e  
    124124#include "Specifics/Value_molecule.hpp"
    125125#include "Specifics/Value_string.hpp"
     126#include "Specifics/Value_vector.hpp"
    126127
    127128#include "Value_impl.hpp"
  • src/Parameters/unittests/Makefile.am

    r6d78b6f r2eded3e  
    4747        ../Parameters/ValueInterface.hpp
    4848ContinuousValueTest_LDADD = \
     49        ../libMolecuilderParameters.la \
     50        ../libMolecuilderGeometry.la \
    4951        $(PARAMETERSLIBS)
    5052 
Note: See TracChangeset for help on using the changeset viewer.