00001 /** 00002 * @file MotionControlSelector.h 00003 * 00004 * Declaration of class MotionControlSelector 00005 * 00006 * @author Martin Lötzsch 00007 */ 00008 00009 #ifndef __MotionControlSelector_h_ 00010 #define __MotionControlSelector_h_ 00011 00012 #include "Tools/Module/ModuleSelector.h" 00013 #include "GT2005MotionControl.h" 00014 #include "DebugMotionControl.h" 00015 00016 /** 00017 * @class MotionControlSelector 00018 * 00019 * A module selector for motion control modules 00020 * 00021 * @author Martin Lötzsch 00022 */ 00023 class MotionControlSelector : public ModuleSelector, public MotionControlInterfaces 00024 { 00025 public: 00026 /** 00027 * Constructor. 00028 * @param handler The module handler of the process. 00029 * @param interfaces The paramters of the MotionControl module. 00030 */ 00031 MotionControlSelector(ModuleHandler &handler, const MotionControlInterfaces& interfaces) 00032 : ModuleSelector(SolutionRequest::motionControl), 00033 MotionControlInterfaces(interfaces), 00034 moduleHandler(handler) 00035 { 00036 handler.setModuleSelector(SolutionRequest::motionControl,this); 00037 } 00038 00039 /** 00040 * Is called on start and when the selected solution changes 00041 * to create a specific solution. 00042 * @param id The id of the solution to create 00043 * @return The created solution or 0 00044 */ 00045 Module* createSolution(SolutionRequest::ModuleSolutionID id) 00046 { 00047 switch (id) 00048 { 00049 case SolutionRequest::gt2005MotionControl: 00050 return new GT2005MotionControl(moduleHandler,*this); 00051 case SolutionRequest::debugMotionControl: 00052 return new DebugMotionControl(*this); 00053 default: 00054 return 0; 00055 } 00056 } 00057 00058 /** 00059 * A reference to the ModuleHandler of the process, needed to create 00060 * the submodules of DefaultMotionControl 00061 */ 00062 ModuleHandler& moduleHandler; 00063 }; 00064 00065 #endif //__MotionControlSelector_h_
1.3.6