VEXPController.h 3.26 KB
Newer Older
legoc's avatar
legoc committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/*
 * 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 VEXP_VEXPCONTROLLER_H
#define VEXP_VEXPCONTROLLER_H

#include "controllers/tas/common/TasSettings.h"
#include "controllers/tas/common/Scattering.h"
#include "controllers/tas/common/Sample.h"
#include "controllers/tas/common/IncidentBeam.h"
#include "controllers/tas/common/TasScatteredBeam.h"
legoc's avatar
legoc committed
27
28
29
30
#include <boost/thread/thread.hpp>
#include <boost/thread/condition.hpp>
#include <boost/thread/mutex.hpp>
#include <memory>
legoc's avatar
legoc committed
31
32
33
34
35
36
37
38
39
40

namespace vexp {

class VEXPController : public ExperimentController {

public:
	//! Type of controller
	static const std::string TYPE;

	VEXPController(const std::string& name);
legoc's avatar
legoc committed
41
	VEXPController(const VEXPController& controller);
legoc's avatar
legoc committed
42
43
	virtual ~VEXPController();

legoc's avatar
legoc committed
44
45
46
	void updateUMatrix();
	void updateBMatrix();

ics's avatar
ics committed
47
	void refreshCalcParameters(const std::string& value);
legoc's avatar
legoc committed
48
	void refreshFloat64Property(SimpleProperty<float64>& property, float64 value);
49
	void refreshFloat64PropertyToMoveModel(SimpleProperty<float64>& property, float64 value);
50

ics's avatar
ics committed
51
52
	void updateProperties();

legoc's avatar
legoc committed
53
54
	virtual void postConfiguration();

ics's avatar
ics committed
55
56
	void calculate(float64 ki, float64 kf, float64 qh, float64 qk, float64 ql);

legoc's avatar
legoc committed
57
58
59
60
61
62
63
64
65
66
67
68
	Property<float64> as;
	Property<float64> bs;
	Property<float64> cs;
	Property<float64> aa;
	Property<float64> bb;
	Property<float64> cc;
	Property<float64> ax;
	Property<float64> ay;
	Property<float64> az;
	Property<float64> bx;
	Property<float64> by;
	Property<float64> bz;
legoc's avatar
legoc committed
69

legoc's avatar
legoc committed
70
71
	ArrayProperty<float64> u;
	ArrayProperty<float64> b;
legoc's avatar
legoc committed
72

ics's avatar
ics committed
73
	// Real properties.
legoc's avatar
legoc committed
74
75
76
77
78
79
	Property<float64> qh;
	Property<float64> qk;
	Property<float64> ql;
	Property<float64> en;
	Property<float64> qm;

legoc's avatar
legoc committed
80
81
82
83
84
85
86
87
88
89
	Property<float64> ki;
	Property<float64> kf;

	Property<float64> a1;
	Property<float64> a2;
	Property<float64> a3;
	Property<float64> a4;
	Property<float64> a5;
	Property<float64> a6;

ics's avatar
ics committed
90
91
92
93
94
95
96
97
98
99
	// JSON String property containing the calculated properties. Use it or the direct properties.
	Property<std::string> calcvalues;

	Property<float64> calca1;
	Property<float64> calca2;
	Property<float64> calca3;
	Property<float64> calca4;
	Property<float64> calca5;
	Property<float64> calca6;

100
	StatusProperty calculationStatus;
legoc's avatar
legoc committed
101
	Property<std::string> errorMessage;
102
	Property<bool> moveModel;
legoc's avatar
legoc committed
103

legoc's avatar
legoc committed
104
105
106
107
108
	ControllerPtr<tas::TasSettings> tasSettings;
	ControllerPtr<tas::Sample> sample;
	ControllerPtr<tas::Scattering> scattering;
	ControllerPtr<tas::IncidentBeam> incidentBeam;
	ControllerPtr<tas::TasScatteredBeam> scatteredBeam;
legoc's avatar
legoc committed
109
110
111
112
113
114
115

	ControllerPtr<axis::AxisController> a1Controller;
	ControllerPtr<axis::AxisController> a2Controller;
	ControllerPtr<axis::AxisController> a3Controller;
	ControllerPtr<axis::AxisController> a4Controller;
	ControllerPtr<axis::AxisController> a5Controller;
	ControllerPtr<axis::AxisController> a6Controller;
legoc's avatar
legoc committed
116
117
118
119
120
};

}

#endif