KAME: C++ program for laboratory measurement
Main Page
Related Pages
Classes
Files
File List
modules
motor
usermotor.h
1
/***************************************************************************
2
Copyright (C) 2002-2015 Kentaro Kitagawa
3
kitagawa@phys.s.u-tokyo.ac.jp
4
5
This program is free software; you can redistribute it and/or
6
modify it under the terms of the GNU Library General Public
7
License as published by the Free Software Foundation; either
8
version 2 of the License, or (at your option) any later version.
9
10
You should have received a copy of the GNU Library General
11
Public License and a list of authors along with this program;
12
see the files COPYING and AUTHORS.
13
***************************************************************************/
14
15
#ifndef USERMOTOR_H_
16
#define USERMOTOR_H_
17
18
#include "motor.h"
19
#include "modbusrtuinterface.h"
20
#include "chardevicedriver.h"
21
22
//ORIENTAL MOTOR FLEX CRK series.
23
class
XFlexCRK
:
public
XModbusRTUDriver
<XMotorDriver> {
24
public
:
25
XFlexCRK
(
const
char
*name,
bool
runtime,
26
Transaction
&tr_meas,
const
shared_ptr<XMeasure> &meas);
27
virtual
~
XFlexCRK
() {}
28
protected
:
29
protected
:
30
virtual
void
getStatus(
const
Snapshot
&shot,
double
*
position
,
bool
*slipping,
bool
*ready);
31
virtual
void
changeConditions(
const
Snapshot
&shot);
32
virtual
void
getConditions(
Transaction
&tr);
33
virtual
void
setTarget(
const
Snapshot
&shot,
double
target
);
34
virtual
void
setActive(
bool
active);
35
virtual
void
setAUXBits(
unsigned
int
bits);
36
virtual
void
setForward
();
//!< continuous rotation.
37
virtual
void
setReverse
();
//!< continuous rotation.
38
virtual
void
stopRotation
();
//!< stops motor and waits for deceleration.
39
//! stores current settings to the NV memory of the instrumeMotornt.
40
virtual
void
storeToROM
();
41
virtual
void
clearPosition();
42
private
:
43
void
sendStopSignal(
bool
wait);
44
};
45
46
//ORIENTAL MOTOR FLEX AR/DG2 series.
47
class
XFlexAR
:
public
XFlexCRK
{
48
public
:
49
XFlexAR
(
const
char
*name,
bool
runtime,
50
Transaction
&tr_meas,
const
shared_ptr<XMeasure> &meas) :
XFlexCRK
(name, runtime, ref(tr_meas), meas) {}
51
virtual
~
XFlexAR
() {}
52
protected
:
53
protected
:
54
virtual
void
getStatus(
const
Snapshot
&shot,
double
*
position
,
bool
*slipping,
bool
*ready);
55
virtual
void
changeConditions(
const
Snapshot
&shot);
56
virtual
void
getConditions(
Transaction
&tr);
57
virtual
void
setTarget(
const
Snapshot
&shot,
double
target
);
58
virtual
void
setActive(
bool
active);
59
virtual
void
setAUXBits(
unsigned
int
bits);
60
virtual
void
setForward
();
//!< continuous rotation.
61
virtual
void
setReverse
();
//!< continuous rotation.
62
virtual
void
stopRotation
();
//!< stops motor and waits for deceleration.
63
//! stores current settings to the NV memory of the instrument.
64
virtual
void
storeToROM
();
65
virtual
void
clearPosition();
66
private
:
67
void
sendStopSignal(
bool
wait);
68
};
69
70
//ORIENTAL MOTOR EMP401.
71
class
XEMP401
:
public
XCharDeviceDriver
<XMotorDriver> {
72
public
:
73
XEMP401
(
const
char
*name,
bool
runtime,
74
Transaction
&tr_meas,
const
shared_ptr<XMeasure> &meas);
75
virtual
~
XEMP401
() {}
76
protected
:
77
protected
:
78
virtual
void
getStatus(
const
Snapshot
&shot,
double
*
position
,
bool
*slipping,
bool
*ready);
79
virtual
void
changeConditions(
const
Snapshot
&shot);
80
virtual
void
getConditions(
Transaction
&tr);
81
virtual
void
setTarget(
const
Snapshot
&shot,
double
target
);
82
virtual
void
setActive(
bool
active);
83
virtual
void
setAUXBits(
unsigned
int
bits);
84
virtual
void
setForward
();
//!< continuous rotation.
85
virtual
void
setReverse
();
//!< continuous rotation.
86
virtual
void
stopRotation
();
//!< stops motor and waits for deceleration.
87
//! stores current settings to the NV memory of the instrumeMotornt.
88
virtual
void
storeToROM
();
89
virtual
void
clearPosition();
90
private
:
91
void
waitForCursor();
92
};
93
94
#endif
/* USERMOTOR_H_ */
Generated for
KAME4
by
1.8.3