<NME> ControlSetController.h
<BEF> #ifndef OPENSIM_CONTROL_SET_CONTROLLER_H_
#define OPENSIM_CONTROL_SET_CONTROLLER_H_

/* -------------------------------------------------------------------------- *
 *                      OpenSim:  ControlSetController.h                      *
 * -------------------------------------------------------------------------- *
 * The OpenSim API is a toolkit for musculoskeletal modeling and simulation.  *
 * See http://opensim.stanford.edu and the NOTICE file for more information.  *
 * OpenSim is developed at Stanford University and supported by the US        *
 * National Institutes of Health (U54 GM072970, R24 HD065690) and by DARPA    *
 * through the Warrior Web program.                                           *
 *                                                                            *
 * Copyright (c) 2005-2017 Stanford University and the Authors                *
 * Author(s): Jack Middleton, Ajay Seth                                       *
 *                                                                            *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may    *
 * not use this file except in compliance with the License. You may obtain a  *
 * copy of the License at http://www.apache.org/licenses/LICENSE-2.0.         *
 *                                                                            *
 * Unless required by applicable law or agreed to in writing, software        *
 * distributed under the License is distributed on an "AS IS" BASIS,          *
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   *
 * See the License for the specific language governing permissions and        *
 * limitations under the License.                                             *
 * -------------------------------------------------------------------------- */


//============================================================================
// INCLUDE
//============================================================================
// These files contain declarations and definitions of variables and methods
// that will be used by the Controller class.
#include "Controller.h"
#include <OpenSim/Common/PropertyStr.h>

//=============================================================================
//=============================================================================
namespace OpenSim { 

class ControlSet;

/**
 * ControlSetController that simply assigns controls from a ControlSet
 * @author Jack Middleton, Ajay Seth 
 * @version 1.0
 */
class OSIMSIMULATION_API ControlSetController : public Controller {
OpenSim_DECLARE_CONCRETE_OBJECT(ControlSetController, Controller);

//=============================================================================
// DATA
//=============================================================================
protected:
    ControlSet* _controlSet;

    /** Name of the controls file. */
    PropertyStr _controlsFileNameProp;
    std::string &_controlsFileName;

//=============================================================================
// METHODS
//=============================================================================
    //--------------------------------------------------------------------------
    // CONSTRUCTION AND DESTRUCTION
    //--------------------------------------------------------------------------
public:
    ControlSetController();

    /**
     * Copy constructor.  This constructor is called by any code that contains
     * a command of the form "Controller newController(oldController);".
     * @param aController The controller to be copied.
     */
    ControlSetController(const ControlSetController &aController);

    /**
     * Destructor.  This method should be a member of any subclass of the
     * Controller class.  It will be called automatically whenever an
     * instance of the subclass is deleted from memory.
     */
    virtual ~ControlSetController();

    const ControlSet *getControlSet() {return _controlSet;} 
    ControlSet *updControlSet() {return _controlSet;}

    void setControlSet(ControlSet *aControlSet) {_controlSet = aControlSet;}


    
private:
    // A "private" method is one that can be called only by this class,
    // and not even by subclasses of this class.

    void setNull();

protected:

    /**
     * Connect properties to local pointers.  
     */
    virtual void setupProperties();

    /**
     * Copy the member variables of the specified controller.  This method is
     * called by the copy constructor of the Controller class.
     *
     * @param aController The controller whose data is to be copied.
     */
    void copyData(const ControlSetController &aController);

    /// read in ControlSet and update Controller's actuator list
    void extendFinalizeFromProperties() override;

    //--------------------------------------------------------------------------
    // OPERATORS

	// for any post XML deserialization intialization
    void finalizeFromProperties() override;
    
    // connect this Controller to the model
    void connectToModel(Model& model) override;

	// for adding any Controller elements to the underlying system
	void addToSystem( SimTK::MultibodySystem& system) const override; 

	// for any intialization requiring a state or the complete system 
	void initStateFromProperties( SimTK::State& s) const override;

	//--------------------------------------------------------------------------
	// OPERATORS
     * Assignment operator.  
     */
    ControlSetController& operator=(const ControlSetController &aController);

#endif

    //--------------------------------------------------------------------------
    // CONTROL
    //--------------------------------------------------------------------------
    /**
     * Compute the control values for all actuators under the control of this
     * Controller
     *
     * @param s         system state 
     * @param controls  return control values 
     */
    void computeControls(const SimTK::State& s, SimTK::Vector& controls) const override;

    virtual void setControlSetFileName( const std::string&  controlSetFileName );
    const std::string& getControlSetFileName() const {
        return _controlsFileName;
    }

   /** 
    *   return the min an max times that a controller knows how to supply controls for 
    */ 
   double getFirstTime() const;
   double getLastTime() const;

//=============================================================================
};  // END of class ControlSetController

}; //namespace
//=============================================================================
//=============================================================================

#endif // OPENSIM_CONTROL_SET_CONTROLLER_H_

<MSG> Eliminated overrides with just Super::<do>.

<DFF> @@ -116,15 +116,6 @@ protected:
 
 	// for any post XML deserialization intialization
     void finalizeFromProperties() override;
-    
-    // connect this Controller to the model
-    void connectToModel(Model& model) override;
-
-	// for adding any Controller elements to the underlying system
-	void addToSystem( SimTK::MultibodySystem& system) const override; 
-
-	// for any intialization requiring a state or the complete system 
-	void initStateFromProperties( SimTK::State& s) const override;
 
 	//--------------------------------------------------------------------------
 	// OPERATORS

{'commit': 'diff --git a/OpenSim/Simulation/Control/ControlSetController.cpp b/OpenSim/Simulation/Control/ControlSetController.cpp\nindex 3814a6478..a5b1484a6 100644\n--- a/OpenSim/Simulation/Control/ControlSetController.cpp\n+++ b/OpenSim/Simulation/Control/ControlSetController.cpp\n@@ -242,23 +242,3 @@ void ControlSetController::finalizeFromProperties()\n     Super::finalizeFromProperties();\n }\n \n-// for any post XML deserialization intialization\n-void ControlSetController::connectToModel(Model& model)  \n-{\n-    // Controller::connectToModel() calls setActuators() with actuators in the\n-    // _actuatorNameList so call connectToModel() after the _controlSet \n-    // constructor has been called\n-\tSuper::connectToModel(model);\n-}\n-\n-// for adding any components to the model\n-void ControlSetController::addToSystem( SimTK::MultibodySystem& system ) const\n-{\n-\tSuper::addToSystem(system);\n-}\n-\n-// for any intialization requiring a state or the complete system \n-void ControlSetController::initStateFromProperties( SimTK::State& s)  const\n-{\n-\tSuper::initStateFromProperties(s);\n-}\ndiff --git a/OpenSim/Simulation/Control/ControlSetController.h b/OpenSim/Simulation/Control/ControlSetController.h\nindex 44447a907..fed842934 100644\n--- a/OpenSim/Simulation/Control/ControlSetController.h\n+++ b/OpenSim/Simulation/Control/ControlSetController.h\n@@ -116,15 +116,6 @@ protected:\n \n \t// for any post XML deserialization intialization\n     void finalizeFromProperties() override;\n-    \n-    // connect this Controller to the model\n-    void connectToModel(Model& model) override;\n-\n-\t// for adding any Controller elements to the underlying system\n-\tvoid addToSystem( SimTK::MultibodySystem& system) const override; \n-\n-\t// for any intialization requiring a state or the complete system \n-\tvoid initStateFromProperties( SimTK::State& s) const override;\n \n \t//--------------------------------------------------------------------------\n \t// OPERATORS\n', 'commit_subject': 'Eliminated overrides with just Super::<do>.', 'repo_name': 'opensim-org/opensim-core', 'committer': {'name': 'Ajay Seth', 'email': 'b506629e4698a937c5166aa6069ad6008e969ba5@stanford.edu', 'time_sec': '1414448400', 'tz_offset': '-420', 'date': {'seconds': '1414448400'}}, 'commit_tree': '11d19c98d47bd023524a952340a7efbedffa1762', 'commit_message': 'Eliminated overrides with just Super::<do>.\n', 'language_name': 'Java', 'license': 'apache-2.0', 'hunks': '@@ -116,15 +116,6 @@ protected:\n \n \t// for any post XML deserialization intialization\n     void finalizeFromProperties() override;\n-    \n-    // connect this Controller to the model\n-    void connectToModel(Model& model) override;\n-\n-\t// for adding any Controller elements to the underlying system\n-\tvoid addToSystem( SimTK::MultibodySystem& system) const override; \n-\n-\t// for any intialization requiring a state or the complete system \n-\tvoid initStateFromProperties( SimTK::State& s) const override;\n \n \t//--------------------------------------------------------------------------\n \t// OPERATORS\n', 'addition_count': 0, 'deletion_count': 9, 'src_file': 'a/OpenSim/Simulation/Control/ControlSetController.h', 'tgt_file': 'b/OpenSim/Simulation/Control/ControlSetController.h', 'file_extension': '.h', 'before_file': '#ifndef OPENSIM_CONTROL_SET_CONTROLLER_H_\n#define OPENSIM_CONTROL_SET_CONTROLLER_H_\n\n/* -------------------------------------------------------------------------- *\n *                      OpenSim:  ControlSetController.h                      *\n * -------------------------------------------------------------------------- *\n * The OpenSim API is a toolkit for musculoskeletal modeling and simulation.  *\n * See http://opensim.stanford.edu and the NOTICE file for more information.  *\n * OpenSim is developed at Stanford University and supported by the US        *\n * National Institutes of Health (U54 GM072970, R24 HD065690) and by DARPA    *\n * through the Warrior Web program.                                           *\n *                                                                            *\n * Copyright (c) 2005-2017 Stanford University and the Authors                *\n * Author(s): Jack Middleton, Ajay Seth                                       *\n *                                                                            *\n * Licensed under the Apache License, Version 2.0 (the "License"); you may    *\n * not use this file except in compliance with the License. You may obtain a  *\n * copy of the License at http://www.apache.org/licenses/LICENSE-2.0.         *\n *                                                                            *\n * Unless required by applicable law or agreed to in writing, software        *\n * distributed under the License is distributed on an "AS IS" BASIS,          *\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   *\n * See the License for the specific language governing permissions and        *\n * limitations under the License.                                             *\n * -------------------------------------------------------------------------- */\n\n\n//============================================================================\n// INCLUDE\n//============================================================================\n// These files contain declarations and definitions of variables and methods\n// that will be used by the Controller class.\n#include "Controller.h"\n#include <OpenSim/Common/PropertyStr.h>\n\n//=============================================================================\n//=============================================================================\nnamespace OpenSim { \n\nclass ControlSet;\n\n/**\n * ControlSetController that simply assigns controls from a ControlSet\n * @author Jack Middleton, Ajay Seth \n * @version 1.0\n */\nclass OSIMSIMULATION_API ControlSetController : public Controller {\nOpenSim_DECLARE_CONCRETE_OBJECT(ControlSetController, Controller);\n\n//=============================================================================\n// DATA\n//=============================================================================\nprotected:\n    ControlSet* _controlSet;\n\n    /** Name of the controls file. */\n    PropertyStr _controlsFileNameProp;\n    std::string &_controlsFileName;\n\n//=============================================================================\n// METHODS\n//=============================================================================\n    //--------------------------------------------------------------------------\n    // CONSTRUCTION AND DESTRUCTION\n    //--------------------------------------------------------------------------\npublic:\n    ControlSetController();\n\n    /**\n     * Copy constructor.  This constructor is called by any code that contains\n     * a command of the form "Controller newController(oldController);".\n     * @param aController The controller to be copied.\n     */\n    ControlSetController(const ControlSetController &aController);\n\n    /**\n     * Destructor.  This method should be a member of any subclass of the\n     * Controller class.  It will be called automatically whenever an\n     * instance of the subclass is deleted from memory.\n     */\n    virtual ~ControlSetController();\n\n    const ControlSet *getControlSet() {return _controlSet;} \n    ControlSet *updControlSet() {return _controlSet;}\n\n    void setControlSet(ControlSet *aControlSet) {_controlSet = aControlSet;}\n\n\n    \nprivate:\n    // A "private" method is one that can be called only by this class,\n    // and not even by subclasses of this class.\n\n    void setNull();\n\nprotected:\n\n    /**\n     * Connect properties to local pointers.  \n     */\n    virtual void setupProperties();\n\n    /**\n     * Copy the member variables of the specified controller.  This method is\n     * called by the copy constructor of the Controller class.\n     *\n     * @param aController The controller whose data is to be copied.\n     */\n    void copyData(const ControlSetController &aController);\n\n    /// read in ControlSet and update Controller\'s actuator list\n    void extendFinalizeFromProperties() override;\n\n    //--------------------------------------------------------------------------\n    // OPERATORS\n\n\t// for any post XML deserialization intialization\n    void finalizeFromProperties() override;\n    \n    // connect this Controller to the model\n    void connectToModel(Model& model) override;\n\n\t// for adding any Controller elements to the underlying system\n\tvoid addToSystem( SimTK::MultibodySystem& system) const override; \n\n\t// for any intialization requiring a state or the complete system \n\tvoid initStateFromProperties( SimTK::State& s) const override;\n\n\t//--------------------------------------------------------------------------\n\t// OPERATORS\n     * Assignment operator.  \n     */\n    ControlSetController& operator=(const ControlSetController &aController);\n\n#endif\n\n    //--------------------------------------------------------------------------\n    // CONTROL\n    //--------------------------------------------------------------------------\n    /**\n     * Compute the control values for all actuators under the control of this\n     * Controller\n     *\n     * @param s         system state \n     * @param controls  return control values \n     */\n    void computeControls(const SimTK::State& s, SimTK::Vector& controls) const override;\n\n    virtual void setControlSetFileName( const std::string&  controlSetFileName );\n    const std::string& getControlSetFileName() const {\n        return _controlsFileName;\n    }\n\n   /** \n    *   return the min an max times that a controller knows how to supply controls for \n    */ \n   double getFirstTime() const;\n   double getLastTime() const;\n\n//=============================================================================\n};  // END of class ControlSetController\n\n}; //namespace\n//=============================================================================\n//=============================================================================\n\n#endif // OPENSIM_CONTROL_SET_CONTROLLER_H_\n', 'message': 'Eliminated overrides with just Super::<do>.\n', 'author_name': 'Ajay Seth', 'lang': 'h'}