nqontrol.general package¶
Submodules¶
nqontrol.general.errors module¶
Error classes for NQontrol.
-
exception
nqontrol.general.errors.
NQontrolError
(message)[source]¶ Bases:
Exception
Base Error Class.
-
exception
nqontrol.general.errors.
ConfigurationError
(message)[source]¶ Bases:
nqontrol.general.errors.NQontrolError
Errors due to misconfiguration.
-
exception
nqontrol.general.errors.
UserInputError
(message)[source]¶ Bases:
nqontrol.general.errors.NQontrolError
Wrong user input.
-
exception
nqontrol.general.errors.
Bug
(message)[source]¶ Bases:
nqontrol.general.errors.NQontrolError
Found a bug.
-
exception
nqontrol.general.errors.
DeviceError
(message)[source]¶ Bases:
nqontrol.general.errors.NQontrolError
The ADwin device shows unexpected behaviour.
-
exception
nqontrol.general.errors.
AutoLockError
(message)[source]¶ Bases:
nqontrol.general.errors.NQontrolError
Exceptions regarding the autolock.
-
exception
nqontrol.general.errors.
AutoLockAnalysisError
(message)[source]¶ Bases:
nqontrol.general.errors.AutoLockError
Analysis was not successful.
nqontrol.general.helpers module¶
-
nqontrol.general.helpers.
convertVolt2Float
(value: Union[list, numpy.number, numpy.ndarray], mode: int = 0, signed=False) → Union[float, numpy.ndarray][source]¶ Converts a volt scala value (in case of ADwin e.g. volt range from -10 to 10, because the outputs are limited) to a Float value. The supported range is divided onto the whole 16-bit float, so -10 Volt would e.g. correspond with 0, 10 V with 65535 for unsigned or -32768 to 32767 when signed.
- Parameters
value (
list
,numpy.number
,numpy.ndarray
) – The value(s) to be converted.mode (
int
) – Integer from 0 to 3, sensitivity mode. Decides how the bins are divided. Seenqontrol.servo.inputSensitivity
or auxSensitivity for more info.signed (
bool
) – Whether the Integer is supposed to have a sign or not, see above.
- Returns
Converted value. Exact type depends on input type.
- Return type
-
nqontrol.general.helpers.
convertVolt2Int
(value: Union[list, numpy.number, numpy.ndarray], mode: int = 0, signed=False) → Union[int, numpy.ndarray][source]¶ [DEPRECATED] Converts a volt scala value (in case of ADwin e.g. volt range from -10 to 10, because the outputs are limited) to an Integer value. There is an equivalent function for Floats. The supported range is divided onto the whole 16-bit integer, so -10 Volt would e.g. correspond with 0, 10 V with 65535 for unsigned or -32768 to 32767 when signed.
- Parameters
value (
list
,numpy.number
,numpy.ndarray
) – The value(s) to be converted.mode (
int
) – Integer from 0 to 3, sensitivity mode. Decides how the bins are divided. Seenqontrol.servo.inputSensitivity
or auxSensitivity for more info.signed (
bool
) – Whether the Integer is supposed to have a sign or not, see above.
- Returns
Converted value. Exact type depends on input type.
- Return type
-
nqontrol.general.helpers.
convertFloat2Volt
(value: Union[List[float], numpy.array, float], mode: int = 0, signed=False) → Union[float, numpy.ndarray][source]¶ Convert float to volt.
For details see
convertVolt2Float
.
nqontrol.general.mockAdwin module¶
-
class
nqontrol.general.mockAdwin.
MockADwin
(DeviceNo=0, raiseError=False)[source]¶ Bases:
object
Mock class for testing and demonstration of nqontrol
-
NUM_SERVOS
= 8¶
-