00001 #ifndef __CCAENV830MODULE_H 00002 #define __CCAENV830MODULE_H 00003 00004 /* 00005 GNU GENERAL PUBLIC LICENSE 00006 Version 2, June 1991 00007 00008 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 00009 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00010 Everyone is permitted to copy and distribute verbatim copies 00011 of this license document, but changing it is not allowed. 00012 00013 Preamble 00014 00015 The licenses for most software are designed to take away your 00016 freedom to share and change it. By contrast, the GNU General Public 00017 License is intended to guarantee your freedom to share and change free 00018 software--to make sure the software is free for all its users. This 00019 General Public License applies to most of the Free Software 00020 Foundation's software and to any other program whose authors commit to 00021 using it. (Some other Free Software Foundation software is covered by 00022 the GNU Library General Public License instead.) You can apply it to 00023 your programs, too. 00024 00025 When we speak of free software, we are referring to freedom, not 00026 price. Our General Public Licenses are designed to make sure that you 00027 have the freedom to distribute copies of free software (and charge for 00028 this service if you wish), that you receive source code or can get it 00029 if you want it, that you can change the software or use pieces of it 00030 in new free programs; and that you know you can do these things. 00031 00032 To protect your rights, we need to make restrictions that forbid 00033 anyone to deny you these rights or to ask you to surrender the rights. 00034 These restrictions translate to certain responsibilities for you if you 00035 distribute copies of the software, or if you modify it. 00036 00037 For example, if you distribute copies of such a program, whether 00038 gratis or for a fee, you must give the recipients all the rights that 00039 you have. You must make sure that they, too, receive or can get the 00040 source code. And you must show them these terms so they know their 00041 rights. 00042 00043 We protect your rights with two steps: (1) copyright the software, and 00044 (2) offer you this license which gives you legal permission to copy, 00045 distribute and/or modify the software. 00046 00047 Also, for each author's protection and ours, we want to make certain 00048 that everyone understands that there is no warranty for this free 00049 software. If the software is modified by someone else and passed on, we 00050 want its recipients to know that what they have is not the original, so 00051 that any problems introduced by others will not reflect on the original 00052 authors' reputations. 00053 00054 Finally, any free program is threatened constantly by software 00055 patents. We wish to avoid the danger that redistributors of a free 00056 program will individually obtain patent licenses, in effect making the 00057 program proprietary. To prevent this, we have made it clear that any 00058 patent must be licensed for everyone's free use or not licensed at all. 00059 00060 The precise terms and conditions for copying, distribution and 00061 modification follow. 00062 00063 GNU GENERAL PUBLIC LICENSE 00064 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 00065 00066 0. This License applies to any program or other work which contains 00067 a notice placed by the copyright holder saying it may be distributed 00068 under the terms of this General Public License. The "Program", below, 00069 refers to any such program or work, and a "work based on the Program" 00070 means either the Program or any derivative work under copyright law: 00071 that is to say, a work containing the Program or a portion of it, 00072 either verbatim or with modifications and/or translated into another 00073 language. (Hereinafter, translation is included without limitation in 00074 the term "modification".) Each licensee is addressed as "you". 00075 00076 Activities other than copying, distribution and modification are not 00077 covered by this License; they are outside its scope. The act of 00078 running the Program is not restricted, and the output from the Program 00079 is covered only if its contents constitute a work based on the 00080 Program (independent of having been made by running the Program). 00081 Whether that is true depends on what the Program does. 00082 00083 1. You may copy and distribute verbatim copies of the Program's 00084 source code as you receive it, in any medium, provided that you 00085 conspicuously and appropriately publish on each copy an appropriate 00086 copyright notice and disclaimer of warranty; keep intact all the 00087 notices that refer to this License and to the absence of any warranty; 00088 and give any other recipients of the Program a copy of this License 00089 along with the Program. 00090 00091 You may charge a fee for the physical act of transferring a copy, and 00092 you may at your option offer warranty protection in exchange for a fee. 00093 00094 2. You may modify your copy or copies of the Program or any portion 00095 of it, thus forming a work based on the Program, and copy and 00096 distribute such modifications or work under the terms of Section 1 00097 above, provided that you also meet all of these conditions: 00098 00099 a) You must cause the modified files to carry prominent notices 00100 stating that you changed the files and the date of any change. 00101 00102 b) You must cause any work that you distribute or publish, that in 00103 whole or in part contains or is derived from the Program or any 00104 part thereof, to be licensed as a whole at no charge to all third 00105 parties under the terms of this License. 00106 00107 c) If the modified program normally reads commands interactively 00108 when run, you must cause it, when started running for such 00109 interactive use in the most ordinary way, to print or display an 00110 announcement including an appropriate copyright notice and a 00111 notice that there is no warranty (or else, saying that you provide 00112 a warranty) and that users may redistribute the program under 00113 these conditions, and telling the user how to view a copy of this 00114 License. (Exception: if the Program itself is interactive but 00115 does not normally print such an announcement, your work based on 00116 the Program is not required to print an announcement.) 00117 00118 These requirements apply to the modified work as a whole. If 00119 identifiable sections of that work are not derived from the Program, 00120 and can be reasonably considered independent and separate works in 00121 themselves, then this License, and its terms, do not apply to those 00122 sections when you distribute them as separate works. But when you 00123 distribute the same sections as part of a whole which is a work based 00124 on the Program, the distribution of the whole must be on the terms of 00125 this License, whose permissions for other licensees extend to the 00126 entire whole, and thus to each and every part regardless of who wrote it. 00127 00128 Thus, it is not the intent of this section to claim rights or contest 00129 your rights to work written entirely by you; rather, the intent is to 00130 exercise the right to control the distribution of derivative or 00131 collective works based on the Program. 00132 00133 In addition, mere aggregation of another work not based on the Program 00134 with the Program (or with a work based on the Program) on a volume of 00135 a storage or distribution medium does not bring the other work under 00136 the scope of this License. 00137 00138 3. You may copy and distribute the Program (or a work based on it, 00139 under Section 2) in object code or executable form under the terms of 00140 Sections 1 and 2 above provided that you also do one of the following: 00141 00142 a) Accompany it with the complete corresponding machine-readable 00143 source code, which must be distributed under the terms of Sections 00144 1 and 2 above on a medium customarily used for software interchange; or, 00145 00146 b) Accompany it with a written offer, valid for at least three 00147 years, to give any third party, for a charge no more than your 00148 cost of physically performing source distribution, a complete 00149 machine-readable copy of the corresponding source code, to be 00150 distributed under the terms of Sections 1 and 2 above on a medium 00151 customarily used for software interchange; or, 00152 00153 c) Accompany it with the information you received as to the offer 00154 to distribute corresponding source code. (This alternative is 00155 allowed only for noncommercial distribution and only if you 00156 received the program in object code or executable form with such 00157 an offer, in accord with Subsection b above.) 00158 00159 The source code for a work means the preferred form of the work for 00160 making modifications to it. For an executable work, complete source 00161 code means all the source code for all modules it contains, plus any 00162 associated interface definition files, plus the scripts used to 00163 control compilation and installation of the executable. However, as a 00164 special exception, the source code distributed need not include 00165 anything that is normally distributed (in either source or binary 00166 form) with the major components (compiler, kernel, and so on) of the 00167 operating system on which the executable runs, unless that component 00168 itself accompanies the executable. 00169 00170 If distribution of executable or object code is made by offering 00171 access to copy from a designated place, then offering equivalent 00172 access to copy the source code from the same place counts as 00173 distribution of the source code, even though third parties are not 00174 compelled to copy the source along with the object code. 00175 00176 4. You may not copy, modify, sublicense, or distribute the Program 00177 except as expressly provided under this License. Any attempt 00178 otherwise to copy, modify, sublicense or distribute the Program is 00179 void, and will automatically terminate your rights under this License. 00180 However, parties who have received copies, or rights, from you under 00181 this License will not have their licenses terminated so long as such 00182 parties remain in full compliance. 00183 00184 5. You are not required to accept this License, since you have not 00185 signed it. However, nothing else grants you permission to modify or 00186 distribute the Program or its derivative works. These actions are 00187 prohibited by law if you do not accept this License. Therefore, by 00188 modifying or distributing the Program (or any work based on the 00189 Program), you indicate your acceptance of this License to do so, and 00190 all its terms and conditions for copying, distributing or modifying 00191 the Program or works based on it. 00192 00193 6. Each time you redistribute the Program (or any work based on the 00194 Program), the recipient automatically receives a license from the 00195 original licensor to copy, distribute or modify the Program subject to 00196 these terms and conditions. You may not impose any further 00197 restrictions on the recipients' exercise of the rights granted herein. 00198 You are not responsible for enforcing compliance by third parties to 00199 this License. 00200 00201 7. If, as a consequence of a court judgment or allegation of patent 00202 infringement or for any other reason (not limited to patent issues), 00203 conditions are imposed on you (whether by court order, agreement or 00204 otherwise) that contradict the conditions of this License, they do not 00205 excuse you from the conditions of this License. If you cannot 00206 distribute so as to satisfy simultaneously your obligations under this 00207 License and any other pertinent obligations, then as a consequence you 00208 may not distribute the Program at all. For example, if a patent 00209 license would not permit royalty-free redistribution of the Program by 00210 all those who receive copies directly or indirectly through you, then 00211 the only way you could satisfy both it and this License would be to 00212 refrain entirely from distribution of the Program. 00213 00214 If any portion of this section is held invalid or unenforceable under 00215 any particular circumstance, the balance of the section is intended to 00216 apply and the section as a whole is intended to apply in other 00217 circumstances. 00218 00219 It is not the purpose of this section to induce you to infringe any 00220 patents or other property right claims or to contest validity of any 00221 such claims; this section has the sole purpose of protecting the 00222 integrity of the free software distribution system, which is 00223 implemented by public license practices. Many people have made 00224 generous contributions to the wide range of software distributed 00225 through that system in reliance on consistent application of that 00226 system; it is up to the author/donor to decide if he or she is willing 00227 to distribute software through any other system and a licensee cannot 00228 impose that choice. 00229 00230 This section is intended to make thoroughly clear what is believed to 00231 be a consequence of the rest of this License. 00232 00233 8. If the distribution and/or use of the Program is restricted in 00234 certain countries either by patents or by copyrighted interfaces, the 00235 original copyright holder who places the Program under this License 00236 may add an explicit geographical distribution limitation excluding 00237 those countries, so that distribution is permitted only in or among 00238 countries not thus excluded. In such case, this License incorporates 00239 the limitation as if written in the body of this License. 00240 00241 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. 00242 00243 Each version is given a distinguishing version number. If the Program 00244 specifies a version number of this License which applies to it and "any 00245 later version", you have the option of following the terms and conditions 00246 either of that version or of any later version published by the Free Software 00247 Foundation. If the Program does not specify a version number of this License, 00248 you may choose any version ever published by the Free Software Foundation. 00249 00250 10. If you wish to incorporate parts of the Program into other free 00251 programs whose distribution conditions are different, write to the author to 00252 ask for permission. For software which is copyrighted by the Free Software 00253 Foundation, write to the Free Software Foundation; we sometimes make 00254 exceptions for this. Our decision will be guided by the two goals of 00255 preserving the free status of all derivatives of our free software and of 00256 promoting the sharing and reuse of software generally. 00257 00258 NO WARRANTY 00259 00260 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR 00261 THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 00262 OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE 00263 THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, 00264 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 00265 FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND 00266 PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, 00267 YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 00268 00269 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 00270 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 00271 REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 00272 INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 00273 OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO 00274 LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR 00275 THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 00276 EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 00277 DAMAGES. 00278 00279 END OF TERMS AND CONDITIONS 00280 */ 00281 00282 00283 #ifndef __CDIGITIZERMODULE_H 00284 #include "CDigitizerModule.h" 00285 #endif 00286 00287 #ifndef __SPECTRODAQ_H 00288 #include <spectrodaq.h> 00289 #define __SPECTRODAQ_H 00290 #endif 00291 00292 00293 // Forward Class Definitions: 00294 00295 class CCAENV830; 00296 00364 class CCAENV830Module : public CDigitizerModule 00365 { 00366 // Data: 00367 00368 CCAENV830* m_pModule; 00369 int m_nId; 00370 bool m_fHeader; 00371 bool m_fWide; 00372 bool m_fManualClear; 00373 bool m_fPacketize; 00374 bool m_fVmeTrigger; 00375 unsigned long m_lEnables; 00376 int m_nCrate; 00377 int m_nSlot; 00378 00379 public: 00380 // Constructors and other canonicals: 00381 00382 CCAENV830Module(const string& rName, CTCLInterpreter& rInterp); 00383 virtual ~CCAENV830Module(); 00384 private: 00385 CCAENV830Module(const CCAENV830Module& rhs); 00386 CCAENV830Module& operator= (const CCAENV830Module& rhs); 00387 int operator!=(const CCAENV830Module& rhs); 00388 int operator==(const CCAENV830Module& rhs); 00389 public: 00390 00391 // class operations: 00392 00393 public: 00394 00395 virtual void Initialize(); 00396 virtual void Prepare(); 00397 virtual void Read(DAQWordBufferPtr& rBuffer); 00398 virtual int Read(void* pBuffer); 00399 virtual void Clear(); 00400 virtual string getType() const { 00401 return string("caenv830"); 00402 } 00403 00404 }; 00405 00406 00407 00408 #endif