/* * Nomad Instrument Control Software * * Copyright 2011 Institut Laue-Langevin * * Licensed under the EUPL, Version 1.1 only (the "License"); * You may not use this work except in compliance with the Licence. * You may obtain a copy of the Licence at: * * http://joinup.ec.europa.eu/software/page/eupl * * Unless required by applicable law or agreed to in writing, software * distributed under the Licence is distributed on an "AS IS" basis, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the Licence for the specific language governing permissions and * limitations under the Licence. */ #ifndef D22_AUTOCONFIG_H #define D22_AUTOCONFIG_H #include #include #include #include #include namespace d22 { class Apply : private controller::Command { public: Apply(ExperimentController * c) : controller::Command(c, "apply", &Apply::apply, this) { } virtual void apply() = 0; void applyCommand(bool logging = false) { command(logging, true); } }; class AutoConfig : public ExperimentController, public controller::Start, public Apply { public: //! Type of controller static const std::string TYPE; AutoConfig(const std::string& name); AutoConfig(const AutoConfig& controller); virtual ~AutoConfig(); virtual void postConfiguration(); virtual void start(); virtual void apply(); Property serverEndpoint; Property initialized; Property scatterModelType; Property sampleRadius; Property resultSize; DynamicProperty type; DynamicProperty distance; DynamicProperty wavelength; DynamicProperty collimation; Property wantedType; private: bool initApplication(); static const std::string REMOTE_APPLICATION; static const std::string RESPONDER; std::unique_ptr m_server; std::unique_ptr m_remoteApplication; ControllerPtr m_d22settings; DriverPtr m_driver; utilities::CountSpy* m_countSpy; }; } #endif