mosca 2.0.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. mosca/__init__.py +11 -0
  2. mosca/common/__init__.py +9 -0
  3. mosca/common/enums.py +79 -0
  4. mosca/common/logger.py +139 -0
  5. mosca/common/threads.py +199 -0
  6. mosca/common/utils.py +70 -0
  7. mosca/control/__init__.py +4 -0
  8. mosca/control/buffer.py +526 -0
  9. mosca/control/controller.py +278 -0
  10. mosca/control/datahandler.py +261 -0
  11. mosca/control/detectors.py +116 -0
  12. mosca/control/mosca.py +693 -0
  13. mosca/control/spectra.py +36 -0
  14. mosca/control/stats.py +43 -0
  15. mosca/control/tasks/__init__.py +3 -0
  16. mosca/control/tasks/background.py +118 -0
  17. mosca/control/tasks/rois.py +466 -0
  18. mosca/control/tasks/saving.py +391 -0
  19. mosca/control/tasks/spectrasums.py +185 -0
  20. mosca/control/tasks/task.py +201 -0
  21. mosca/control/tasks/taskmanager.py +133 -0
  22. mosca/devices/__init__.py +28 -0
  23. mosca/devices/hamamatsu/__init__.py +0 -0
  24. mosca/devices/hamamatsu/hamamatsu.py +88 -0
  25. mosca/devices/hamamatsu/hamamatsuhw.py +1298 -0
  26. mosca/devices/oceanoptics/__init__.py +0 -0
  27. mosca/devices/oceanoptics/oceanoptics.py +59 -0
  28. mosca/devices/oceanoptics/oceanopticshw.py +379 -0
  29. mosca/devices/simulation/__init__.py +0 -0
  30. mosca/devices/simulation/dante/__init__.py +1 -0
  31. mosca/devices/simulation/dante/simdante.py +33 -0
  32. mosca/devices/simulation/dante/simdantehw.py +506 -0
  33. mosca/devices/simulation/dummy/__init__.py +1 -0
  34. mosca/devices/simulation/dummy/dummy.py +299 -0
  35. mosca/devices/simulation/generator.py +607 -0
  36. mosca/devices/simulation/xia/__init__.py +1 -0
  37. mosca/devices/simulation/xia/iniparser.py +99 -0
  38. mosca/devices/simulation/xia/simfalconx.py +26 -0
  39. mosca/devices/simulation/xia/simfalconxhw.py +599 -0
  40. mosca/devices/xglab/__init__.py +0 -0
  41. mosca/devices/xglab/dante.py +126 -0
  42. mosca/devices/xglab/dantehw.py +1178 -0
  43. mosca/devices/xia/__init__.py +0 -0
  44. mosca/devices/xia/falconx.py +232 -0
  45. mosca/devices/xia/handel/__init__.py +14 -0
  46. mosca/devices/xia/handel/_cffi.py +62 -0
  47. mosca/devices/xia/handel/error.py +272 -0
  48. mosca/devices/xia/handel/handel_inc/handel_constants.h +127 -0
  49. mosca/devices/xia/handel/handel_inc/handel_errors.h +254 -0
  50. mosca/devices/xia/handel/handel_inc/handel_generic.h +66 -0
  51. mosca/devices/xia/handel/interface.py +1025 -0
  52. mosca/devices/xia/handel/mapping.py +107 -0
  53. mosca/devices/xia/handel/parser.py +62 -0
  54. mosca/devices/xia/handel/stats.py +85 -0
  55. mosca/devices/xia/mercury.py +160 -0
  56. mosca/devices/xia/utils.py +47 -0
  57. mosca/devices/xia/xia.py +575 -0
  58. mosca/devices/xia/xiads.py +161 -0
  59. mosca/mosca.py +0 -0
  60. mosca/tango/__init__.py +2 -0
  61. mosca/tango/controller.py +80 -0
  62. mosca/tango/main.py +163 -0
  63. mosca/tango/mosca.py +513 -0
  64. mosca/tango/moscav1.py +408 -0
  65. mosca/tango/shared.py +23 -0
  66. mosca/tango/tasks/__init__.py +0 -0
  67. mosca/tango/tasks/background.py +55 -0
  68. mosca/tango/utils.py +109 -0
  69. mosca-2.0.2.dist-info/METADATA +32 -0
  70. mosca-2.0.2.dist-info/RECORD +73 -0
  71. mosca-2.0.2.dist-info/WHEEL +4 -0
  72. mosca-2.0.2.dist-info/entry_points.txt +2 -0
  73. mosca-2.0.2.dist-info/licenses/LICENSE +166 -0
@@ -0,0 +1,127 @@
1
+ /*
2
+ * Copyright (c) 2004 X-ray Instrumentation Associates
3
+ * 2005-2016 XIA LLC
4
+ * All rights reserved
5
+ *
6
+ * Redistribution and use in source and binary forms,
7
+ * with or without modification, are permitted provided
8
+ * that the following conditions are met:
9
+ *
10
+ * * Redistributions of source code must retain the above
11
+ * copyright notice, this list of conditions and the
12
+ * following disclaimer.
13
+ * * Redistributions in binary form must reproduce the
14
+ * above copyright notice, this list of conditions and the
15
+ * following disclaimer in the documentation and/or other
16
+ * materials provided with the distribution.
17
+ * * Neither the name of XIA LLC
18
+ * nor the names of its contributors may be used to endorse
19
+ * or promote products derived from this software without
20
+ * specific prior written permission.
21
+ *
22
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
23
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
24
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
25
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
26
+ * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
27
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
29
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
31
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
32
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
33
+ * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34
+ * SUCH DAMAGE.
35
+ */
36
+
37
+
38
+ #ifndef HANDEL_CONSTANTS_H
39
+ #define HANDEL_CONSTANTS_H
40
+
41
+ /* Preset Run Types */
42
+ #define XIA_PRESET_NONE 0.0 /**< Run until stopped by user. */
43
+ #define XIA_PRESET_FIXED_REAL 1.0 /**< Run for fixed real time. */
44
+ #define XIA_PRESET_FIXED_LIVE 2.0 /**< Run for fixed live time.
45
+ * Unimplemented for
46
+ * FalconXn. */
47
+ #define XIA_PRESET_FIXED_EVENTS 3.0 /**< Run until a given number of
48
+ * output pulses are counted. */
49
+ #define XIA_PRESET_FIXED_TRIGGERS 4.0 /**< Run until a given number of
50
+ * input triggers are counted. */
51
+
52
+ /* Module statistics */
53
+ #define XIA_NUM_MODULE_STATISTICS 9 /**< Number of statistics per
54
+ * channel in the module
55
+ * statistics block.
56
+ */
57
+
58
+ /* Preamplifier type */
59
+ #define XIA_PREAMP_RESET 0.0
60
+ #define XIA_PREAMP_RC 1.0
61
+
62
+ /* Peak mode **/
63
+ #define XIA_PEAK_SENSING_MODE 0
64
+ #define XIA_PEAK_SAMPLING_MODE 1
65
+
66
+ /* Mapping Mode Point Control Types */
67
+ #define XIA_MAPPING_CTL_USER 0.0
68
+ #define XIA_MAPPING_CTL_GATE 1.0
69
+ #define XIA_MAPPING_CTL_SYNC 2.0
70
+
71
+ /* GATE polarity */
72
+ #define XIA_GATE_COLLECT_HI 0
73
+ #define XIA_GATE_COLLECT_LO 1
74
+
75
+ /* Trigger and livetime signal output constants */
76
+ #define XIA_OUTPUT_DISABLED 0
77
+ #define XIA_OUTPUT_FASTFILTER 1
78
+ #define XIA_OUTPUT_BASELINEFILTER 2
79
+ #define XIA_OUTPUT_ENERGYFILTER 3
80
+ #define XIA_OUTPUT_ENERGYACTIVE 4
81
+
82
+ /* Old Test Constants */
83
+ #define XIA_HANDEL_TEST_MASK 0x1
84
+ #define XIA_HANDEL_DYN_MODULE_TEST_MASK 0x2
85
+ #define XIA_HANDEL_FILE_TEST_MASK 0x4
86
+ #define XIA_HANDEL_RUN_PARAMS_TEST_MASK 0x8
87
+ #define XIA_HANDEL_RUN_CONTROL_TEST_MASK 0x10
88
+ #define XIA_XERXES_TEST_MASK 0x20
89
+ #define XIA_HANDEL_SYSTEM_TEST_MASK 0x40
90
+
91
+ /* List mode variant */
92
+ #define XIA_LIST_MODE_SLOW_PIXEL 0.0
93
+ #define XIA_LIST_MODE_FAST_PIXEL 1.0
94
+ #define XIA_LIST_MODE_CLOCK 2.0
95
+
96
+ /* FalconXn detection filter */
97
+ #define XIA_FILTER_LOW_ENERGY 0 /**< Optimize for low energy pulses. */
98
+ #define XIA_FILTER_LOW_RATE 1 /**< Optimize for low rate pulses. */
99
+ #define XIA_FILTER_MID_RATE 2 /**< Optimize for mid rate pulses. */
100
+ #define XIA_FILTER_HIGH_RATE 3 /**< Optimize for high rate pulses. */
101
+ #define XIA_FILTER_MAX_THROUGHPUT 4 /**< Optimize for maximum throughput. */
102
+
103
+ /* FalconXn SCA trigger mode */
104
+ #define SCA_TRIGGER_OFF 0 /**< Do not generate SCA pulses. */
105
+ #define SCA_TRIGGER_HIGH 1 /**< Generate SCA pulses when the gate source is high. */
106
+ #define SCA_TRIGGER_LOW 2 /**< Generate SCA pulses when the gate source is low. */
107
+ #define SCA_TRIGGER_ALWAYS 3 /**< Generate SCA pulses always. */
108
+
109
+ /* FalconXn decay times */
110
+ #define XIA_DECAY_LONG 0.0
111
+ #define XIA_DECAY_MEDIUM 1.0
112
+ #define XIA_DECAY_SHORT 2.0
113
+ #define XIA_DECAY_VERY_SHORT 3.0
114
+
115
+ #define SCA_MAX_PULSER_DURATION 262140 /**< SCA generated pulse duration in nanoseconds. */
116
+
117
+ /* FalconXn SINC param readout string length */
118
+ #define XIA_DEBUG_PARAM_LEN 32
119
+
120
+ /* Supported board features returned by get_board_features board operations */
121
+ #define BOARD_SUPPORTS_NO_EXTRA_FEATURES 0x0
122
+ /* FalconX features 0x11 - 0x18 */
123
+ #define BOARD_SUPPORTS_TERMINATAION_50OHM 0x11 /* Support for "50ohm" for termination */
124
+ #define BOARD_SUPPORTS_ATTENUATION_GROUND 0x12 /* Support for "Ground" for attenuation */
125
+
126
+
127
+ #endif /* HANDEL_CONSTANTS_H */
@@ -0,0 +1,254 @@
1
+ /*
2
+ * Copyright (c) 2004 X-ray Instrumentation Associates
3
+ * 2005-2020 XIA LLC
4
+ * All rights reserved
5
+ *
6
+ * Redistribution and use in source and binary forms,
7
+ * with or without modification, are permitted provided
8
+ * that the following conditions are met:
9
+ *
10
+ * * Redistributions of source code must retain the above
11
+ * copyright notice, this list of conditions and the
12
+ * following disclaimer.
13
+ * * Redistributions in binary form must reproduce the
14
+ * above copyright notice, this list of conditions and the
15
+ * following disclaimer in the documentation and/or other
16
+ * materials provided with the distribution.
17
+ * * Neither the name of XIA LLC
18
+ * nor the names of its contributors may be used to endorse
19
+ * or promote products derived from this software without
20
+ * specific prior written permission.
21
+ *
22
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
23
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
24
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
25
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
26
+ * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
27
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
29
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
31
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
32
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
33
+ * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34
+ * SUCH DAMAGE.
35
+ */
36
+
37
+
38
+ #ifndef HANDEL_ERROR_H
39
+ #define HANDEL_ERROR_H
40
+
41
+ #include "handeldef.h"
42
+
43
+ #define XIA_SUCCESS 0 /* The routine succeeded. */
44
+
45
+ /* I/O level error codes 1-100 */
46
+ #define XIA_OPEN_FILE 1 /* Error opening file */
47
+ #define XIA_FILEERR 2 /* File related error */
48
+ #define XIA_NOSECTION 3 /* Unable to find section in ini file */
49
+ #define XIA_FORMAT_ERROR 4 /* Syntax error in ini file */
50
+ #define XIA_ILLEGAL_OPERATION 5 /* Attempted to configure options in an illegal order */
51
+ #define XIA_FILE_RA 6 /* File random access unable to find name-value pair */
52
+ #define XIA_SET_POS 7 /* Error getting file position. */
53
+ #define XIA_READ_ONLY 8 /* A write operation when read only. */
54
+ #define XIA_INVALID_VALUE 9 /* The value is invalid. */
55
+ #define XIA_NOT_IDLE 10 /* Handel is not idle so could not complete the request. */
56
+ #define XIA_NOT_ACTIVE 11 /* Handel is idle so could not complete the request. */
57
+ #define XIA_THREAD_ERROR 12 /* Thread related error. */
58
+ #define XIA_PROTOCOL_ERROR 13 /* Protocol related error. */
59
+ #define XIA_ALREADY_OPEN 14 /* Already open. */
60
+
61
+ /* Primitive level error codes (due to mdio failures) 101-200 */
62
+
63
+ /* DSP/FIPPI level error codes 201-300 */
64
+ #define XIA_UNKNOWN_DECIMATION 201 /* The decimation read from the hardware does not match a known value */
65
+ #define XIA_SLOWLEN_OOR 202 /* Calculated SLOWLEN value is out-of-range */
66
+ #define XIA_SLOWGAP_OOR 203 /* Calculated SLOWGAP value is out-of-range */
67
+ #define XIA_SLOWFILTER_OOR 204 /* Attempt to set the Peaking or Gap time s.t. P+G>31 */
68
+ #define XIA_FASTLEN_OOR 205 /* Calculated FASTLEN value is out-of-range */
69
+ #define XIA_FASTGAP_OOR 206 /* Calculated FASTGAP value is out-of-range */
70
+ #define XIA_FASTFILTER_OOR 207 /* Attempt to set the Peaking or Gap time s.t. P+G>31 */
71
+ #define XIA_BASELINE_OOR 208 /* Baseline filter length is out-of-range */
72
+
73
+ /* Configuration errors 301-400 */
74
+ #define XIA_INITIALIZE 301 /* Fatal error on initialization */
75
+ #define XIA_NO_ALIAS 302 /* A module, detector, or firmware item with the given alias is not defined. */
76
+ #define XIA_ALIAS_EXISTS 303 /* Trying to add a configuration item with existing alias */
77
+ #define XIA_BAD_VALUE 304 /* Out of range or invalid input value */
78
+ #define XIA_INFINITE_LOOP 305 /* Infinite loop detected */
79
+ #define XIA_BAD_NAME 306 /* Specified name is not valid */
80
+ #define XIA_BAD_PTRR 307 /* Specified PTRR is not valid for this alias */
81
+ #define XIA_ALIAS_SIZE 308 /* Alias name length exceeds #MAXALIAS_LEN */
82
+ #define XIA_NO_MODULE 309 /* Must define at least one module before */
83
+ #define XIA_BAD_INTERFACE 310 /* The specified interface does not exist */
84
+ #define XIA_NO_INTERFACE 311 /* An interface must defined before more information is specified */
85
+ #define XIA_WRONG_INTERFACE 312 /* Specified information doesn't apply to this interface */
86
+ #define XIA_NO_CHANNELS 313 /* Number of channels for this module is set to 0 */
87
+ #define XIA_BAD_CHANNEL 314 /* Specified channel index is invalid or out-of-range */
88
+ #define XIA_NO_MODIFY 315 /* Specified name cannot be modified once set */
89
+ #define XIA_INVALID_DETCHAN 316 /* Specified detChan value is invalid */
90
+ #define XIA_BAD_TYPE 317 /* The DetChanElement type specified is invalid */
91
+ #define XIA_WRONG_TYPE 318 /* This routine only operates on detChans that are sets */
92
+ #define XIA_UNKNOWN_BOARD 319 /* Board type is unknown */
93
+ #define XIA_NO_DETCHANS 320 /* No detChans are currently defined */
94
+ #define XIA_NOT_FOUND 321 /* Unable to locate the Acquisition value requested */
95
+ #define XIA_PTR_CHECK 322 /* Pointer is out of synch when it should be valid */
96
+ #define XIA_LOOKING_PTRR 323 /* FirmwareSet has a FDD file defined and this only works with PTRRs */
97
+ #define XIA_NO_FILENAME 324 /* Requested filename information is set to NULL */
98
+ #define XIA_BAD_INDEX 325 /* User specified an alias index that doesn't exist */
99
+ #define XIA_NULL_ALIAS 326 /* Null alias passed into function */
100
+ #define XIA_NULL_NAME 327 /* Null name passed into function */
101
+ #define XIA_NULL_VALUE 328 /* Null value passed into function */
102
+ #define XIA_NEEDS_BOARD_TYPE 329 /* Module needs board_type */
103
+ #define XIA_UNKNOWN_ITEM 330 /* Unknown item */
104
+ #define XIA_TYPE_REDIRECT 331 /* Module type can not be redefined once set */
105
+ #define XIA_NO_TMP_PATH 332 /* No FDD temporary path defined for this firmware. */
106
+ #define XIA_NULL_PATH 333 /* Specified path was NULL. */
107
+
108
+ /* Config errors found by xiaStartSystem(). 350-400 */
109
+ #define XIA_FIRM_BOTH 350 /* A FirmwareSet may not contain both an FDD and seperate Firmware definitions */
110
+ #define XIA_PTR_OVERLAP 351 /* Peaking time ranges in the Firmware definitions may not overlap */
111
+ #define XIA_MISSING_FIRM 352 /* Either the FiPPI or DSP file is missing from a Firmware element */
112
+ #define XIA_MISSING_POL 353 /* A polarity value is missing from a Detector element */
113
+ #define XIA_MISSING_GAIN 354 /* A gain value is missing from a Detector element */
114
+ #define XIA_MISSING_INTERFACE 355 /* The interface this channel requires is missing */
115
+ #define XIA_MISSING_ADDRESS 356 /* The epp_address information is missing for this channel */
116
+ #define XIA_INVALID_NUMCHANS 357 /* The wrong number of channels are assigned to this module */
117
+ #define XIA_INCOMPLETE_DEFAULTS 358 /* Some of the required defaults are missing */
118
+ #define XIA_BINS_OOR 359 /* There are too many or too few bins for this module type */
119
+ #define XIA_MISSING_TYPE 360 /* The type for the current detector is not specified properly */
120
+ #define XIA_NO_MMU 361 /* No MMU defined and/or required for this module */
121
+ #define XIA_NULL_FIRMWARE 362 /* No firmware set defined */
122
+ #define XIA_NO_FDD 363 /* No FDD defined in the firmware set */
123
+
124
+ /* Host machine error codes 401-500 */
125
+ #define XIA_NOMEM 401 /* Unable to allocate memory */
126
+ #define XIA_XERXES_DEPRECATED 402 /* XerXes returned an error. Check log error output. */
127
+ #define XIA_MD 403 /* MD layer returned an error */
128
+ #define XIA_EOF 404 /* EOF encountered */
129
+ #define XIA_BAD_FILE_READ 405 /* File read failed */
130
+ #define XIA_BAD_FILE_WRITE 406 /* File write failed */
131
+
132
+ /* Miscellaneous errors 501-600 */
133
+ #define XIA_UNKNOWN 501
134
+ #define XIA_LOG_LEVEL 506 /* Log level invalid */
135
+ #define XIA_FILE_TYPE 507 /* Improper file type specified */
136
+ #define XIA_END 508 /* There are no more instances of the name specified. Pos set to end */
137
+ #define XIA_INVALID_STR 509 /* Invalid string format */
138
+ #define XIA_UNIMPLEMENTED 510 /* The routine is unimplemented in this version */
139
+ #define XIA_PARAM_DEBUG_MISMATCH 511 /* A parameter mismatch was found with XIA_PARAM_DEBUG enabled. */
140
+
141
+ /* PSL errors 601-700 */
142
+ #define XIA_NOSUPPORT_FIRM 601 /* The specified firmware is not supported by this board type */
143
+ #define XIA_UNKNOWN_FIRM 602 /* The specified firmware type is unknown */
144
+ #define XIA_NOSUPPORT_VALUE 603 /* The specified acquisition value is not supported */
145
+ #define XIA_UNKNOWN_VALUE 604 /* The specified acquisition value is unknown */
146
+ #define XIA_PEAKINGTIME_OOR 605 /* The specified peaking time is out-of-range for this product */
147
+ #define XIA_NODEFINE_PTRR 606 /* The specified peaking time does not have a PTRR associated with it */
148
+ #define XIA_THRESH_OOR 607 /* The specified treshold is out-of-range */
149
+ #define XIA_ERROR_CACHE 608 /* The data in the values cache is out-of-sync */
150
+ #define XIA_GAIN_OOR 609 /* The specified gain is out-of-range for this produce */
151
+ #define XIA_TIMEOUT 610 /* Timeout waiting for BUSY */
152
+ #define XIA_BAD_SPECIAL 611 /* The specified special run is not supported for this module */
153
+ #define XIA_TRACE_OOR 612 /* The specified value of tracewait (in ns) is out-of-range */
154
+ #define XIA_DEFAULTS 613 /* The PSL layer encountered an error creating a Defaults element */
155
+ #define XIA_BAD_FILTER 614 /* Error loading filter info from either a FDD file or the Firmware configuration */
156
+ #define XIA_NO_REMOVE 615 /* Specified acquisition value is required for this product and can't be removed */
157
+ #define XIA_NO_GAIN_FOUND 616 /* Handel was unable to converge on a stable gain value */
158
+ #define XIA_UNDEFINED_RUN_TYPE 617 /* Handel does not recognize this run type */
159
+ #define XIA_INTERNAL_BUFFER_OVERRUN 618 /* Handel attempted to overrun an internal buffer boundry */
160
+ #define XIA_EVENT_BUFFER_OVERRUN 619 /* Handel attempted to overrun the event buffer boundry */
161
+ #define XIA_BAD_DATA_LENGTH 620 /* Handel was asked to set a Data length to zero for readout */
162
+ #define XIA_NO_LINEAR_FIT 621 /* Handel was unable to perform a linear fit to some data */
163
+ #define XIA_MISSING_PTRR 622 /* Required PTRR is missing */
164
+ #define XIA_PARSE_DSP 623 /* Error parsing DSP */
165
+ #define XIA_UDXPS 624
166
+ #define XIA_BIN_WIDTH 625 /* Specified bin width is out-of-range */
167
+ #define XIA_NO_VGA 626 /* An attempt was made to set the gaindac on a board that doesn't have a VGA */
168
+ #define XIA_TYPEVAL_OOR 627 /* Specified detector type value is out-of-range */
169
+ #define XIA_LOW_LIMIT_OOR 628 /* Specified low MCA limit is out-of-range */
170
+ #define XIA_BPB_OOR 629 /* bytes_per_bin is out-of-range */
171
+ #define XIA_FIP_OOR 630 /* Specified FiPPI is out-of-range */
172
+ #define XIA_MISSING_PARAM 631 /* Unable to find DSP parameter in list */
173
+ #define XIA_OPEN_XW 632 /* Error opening a handle in the XW library */
174
+ #define XIA_ADD_XW 633 /* Error adding to a handle in the XW library */
175
+ #define XIA_WRITE_XW 634 /* Error writing out a handle in the XW library */
176
+ #define XIA_VALUE_VERIFY 635 /* Returned value inconsistent with sent value */
177
+ #define XIA_POL_OOR 636 /* Specifed polarity is out-of-range */
178
+ #define XIA_SCA_OOR 637 /* Specified SCA number is out-of-range */
179
+ #define XIA_BIN_MISMATCH 638 /* Specified SCA bin is either too high or too low */
180
+ #define XIA_WIDTH_OOR 639 /* MCA bin width is out-of-range */
181
+ #define XIA_UNKNOWN_PRESET 640 /* Unknown PRESET run type specified */
182
+ #define XIA_GAIN_TRIM_OOR 641 /* Gain trim out-of-range */
183
+ #define XIA_GENSET_MISMATCH 642 /* Returned GENSET doesn't match the set GENSET */
184
+ #define XIA_NUM_MCA_OOR 643 /* The specified number of MCA bins is out of range */
185
+ #define XIA_PEAKINT_OOR 644 /* The specified value for PEAKINT is out of range. */
186
+ #define XIA_PEAKSAM_OOR 645 /* The specified value for PEAKSAM is out of range. */
187
+ #define XIA_MAXWIDTH_OOR 646 /* The specified value for MAXWIDTH is out of range. */
188
+ #define XIA_NULL_TYPE 647 /* A NULL file type was specified */
189
+ #define XIA_GAIN_SCALE 648 /* Gain scale factor is not valid */
190
+ #define XIA_NULL_INFO 649 /* The specified info array is NULL */
191
+ #define XIA_UNKNOWN_PARAM_DATA 650 /* Unknown parameter data type */
192
+ #define XIA_MAX_SCAS 651 /* The specified number of SCAs is more then the maximum allowed */
193
+ #define XIA_UNKNOWN_BUFFER 652 /* Requested buffer is unknown */
194
+ #define XIA_NO_MAPPING 653 /* Mapping mode is currently not installed/enabled */
195
+ #define XIA_CLRBUFFER_TIMEOUT 654 /* Time out waiting for buffer to clear */
196
+ #define XIA_UNKNOWN_PT_CTL 655 /* Unknown mapping point control. */
197
+ #define XIA_CLOCK_SPEED 656 /* The hardware is reporting an invalid clock speed. */
198
+ #define XIA_BAD_DECIMATION 657 /* Passed in decimation is invalid. */
199
+ #define XIA_BAD_SYNCH_RUN 658 /* Specified value for synchronous run is bad. */
200
+ #define XIA_PRESET_VALUE_OOR 659 /* Requested preset value is out-of-range. */
201
+ #define XIA_MEMORY_LENGTH 660 /* Memory length is invalid. */
202
+ #define XIA_UNKNOWN_PREAMP_TYPE 661 /* Preamp type is unknown. */
203
+ #define XIA_DAC_TARGET_OOR 662 /* The specified DAC target is out of range. */
204
+ #define XIA_DAC_TOL_OOR 663 /* The specified DAC tolerance is out of range. */
205
+ #define XIA_BAD_TRIGGER 664 /* Specified trigger setting is invalid. */
206
+ #define XIA_EVENT_LEN_OOR 665 /* The specified event length is out of range. */
207
+ #define XIA_PRE_BUF_LEN_OOR 666 /* The specified pre-buffer length is out of range. */
208
+ #define XIA_HV_OOR 667 /* The specified high voltage value is out of range. */
209
+ #define XIA_PEAKMODE_OOR 668 /* The specified peak mode is out of range. */
210
+ #define XIA_NOSUPPORTED_PREAMP_TYPE 669 /* The specified preamp type is not supported by current firmware. */
211
+ #define XIA_ENERGYCOEF_OOR 670 /* The calculated energy coefficient values are out of range. */
212
+ #define XIA_VETO_PULSE_STEP 671 /* The specified step value is too large for the Alpha pulser veto pulse. */
213
+ #define XIA_TRIGOUTPUT_OOR 672 /* The specified trigger signal output is out of range. */
214
+ #define XIA_LIVEOUTPUT_OOR 673 /* The specified livetime signal output is out of range. */
215
+ #define XIA_UNKNOWN_MAPPING 674 /* Unknown mapping mode value specified. */
216
+ #define XIA_UNKNOWN_LIST_MODE_VARIANT 675 /* Illegal list mode variant. */
217
+ #define XIA_MALFORMED_LENGTH 676 /* List mode upper length word is malformed. */
218
+ #define XIA_CLRBUFSIZE_LENGTH 677 /* Clear Buffer Size length is too large. */
219
+ #define XIA_BAD_ELECTRODE_SIZE 678 /* UltraLo electrode size is invalid. */
220
+ #define XIA_TILT_THRESHOLD_OOR 679 /* Specified threshold is out-of-range. */
221
+ #define XIA_USB_BUSY 680 /* Direct USB command failed due to busy USB. */
222
+ #define XIA_MALFORMED_MM_RESPONSE 681 /* UltraLo moisture meter response is malformed. */
223
+ #define XIA_MALFORMED_MM_STATUS 682 /* UltraLo moisture meter status is invalid. */
224
+ #define XIA_MALFORMED_MM_VALUE 683 /* UltraLo moisture meter value is invalid. */
225
+ #define XIA_NO_EVENTS 684 /* No events to retrieve from the event buffer. */
226
+ #define XIA_NOSUPPORT_RUNDATA 685 /* The specified run data is not supported */
227
+ #define XIA_PARAMETER_OOR 686 /* The parameter passed in is out of range. */
228
+ #define XIA_PASSTHROUGH 687 /* UART passthrough command error */
229
+ #define XIA_UNSUPPORTED 688 /* Feature unsupported by current hardware */
230
+
231
+ /* handel-sitoro errors 690-700 */
232
+ #define XIA_DAC_GAIN_OOR 690 /* SiToro DAC gain is out of range. */
233
+ #define XIA_NO_SPECTRUM 691 /* No spectrum has been received. */
234
+
235
+ /* XUP errors 701-800 */
236
+ #define XIA_XUP_VERSION 701 /* XUP version is not supported */
237
+ #define XIA_CHKSUM 702 /* checksum mismatch in the XUP */
238
+ #define XIA_SIZE_MISMATCH 704 /* Size read from file is incorrect */
239
+ #define XIA_NO_ACCESS 705 /* Specified access file isn't valid */
240
+ #define XIA_N_FILTER_BAD 706 /* The number of filter parameters in the FDD doesn't match the number requires for the hardware */
241
+
242
+ /* Additional PSL errors used in handel-sitoro 802-900 */
243
+ #define XIA_ACQ_OOR 802 /* Generic acquisition value conversion out of range. */
244
+ #define XIA_ENCODE 803 /* Base64 encoding error. */
245
+ #define XIA_DECODE 804 /* Base64 decoding error. */
246
+ #define XIA_BAD_PSL_ARGS 805 /* Bad call arguments to PSL function. */
247
+
248
+ /* FalconXN Error codes. */
249
+ #define XIA_FN_BASE_CODE (3000)
250
+
251
+ /* Xerxes Error codes */
252
+ #define XIA_XERXES_ERROR_BASE (4000)
253
+
254
+ #endif /* Endif for HANDEL_ERRORS_H */
@@ -0,0 +1,66 @@
1
+ /*
2
+ * Copyright (c) 2004 X-ray Instrumentation Associates
3
+ * 2005-2011 XIA LLC
4
+ * All rights reserved
5
+ *
6
+ * Redistribution and use in source and binary forms,
7
+ * with or without modification, are permitted provided
8
+ * that the following conditions are met:
9
+ *
10
+ * * Redistributions of source code must retain the above
11
+ * copyright notice, this list of conditions and the
12
+ * following disclaimer.
13
+ * * Redistributions in binary form must reproduce the
14
+ * above copyright notice, this list of conditions and the
15
+ * following disclaimer in the documentation and/or other
16
+ * materials provided with the distribution.
17
+ * * Neither the name of XIA LLC
18
+ * nor the names of its contributors may be used to endorse
19
+ * or promote products derived from this software without
20
+ * specific prior written permission.
21
+ *
22
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
23
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
24
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
25
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
26
+ * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
27
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
29
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
31
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
32
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
33
+ * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34
+ * SUCH DAMAGE.
35
+ */
36
+
37
+
38
+ #ifndef HANDEL_GENERIC_H
39
+ #define HANDEL_GENERIC_H
40
+
41
+ #include <string.h>
42
+ #include <math.h>
43
+
44
+ #include "xia_common.h"
45
+
46
+ /* Define some maximum lengths for strings and arrays */
47
+ #define MAXALIAS_LEN 200
48
+ #define MAXDETECTOR_CHANNELS 200
49
+ #define MAXFILENAME_LEN 200
50
+ #define MAX_NUM_VALUES 200
51
+ #define MAXITEM_LEN 200
52
+ #define MAX_PATH_LEN 1024
53
+
54
+ /* This is a little sketchy right now. I only added it to provide _some_
55
+ * mechanism for verifying the gain info. at the PSL layer. Should probably
56
+ * remove it and come up with a better way...
57
+ */
58
+ #define XIA_GAIN_MIN 0.0
59
+ #define XIA_GAIN_MAX 99.99
60
+
61
+ /* XiaDaqEntry states */
62
+ #define AV_STATE_UNKNOWN 0x01
63
+ #define AV_STATE_MODIFIED 0x02
64
+ #define AV_STATE_SYNCD 0x04
65
+
66
+ #endif /* HANDEL_GENERIC_H */