Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

CamacModtest.cpp

Go to the documentation of this file.
00001 #include <CCrateController.h>
00002 #include <CBD8210.h>
00003 #include <CCamacNimout.h>
00004 #include <SpectroFramework.h>
00005 #include <CTimedEvent.h>
00006 #include <CTimer.h>
00007 #include <iostream.h>
00008 //
00009 // Test program to see if the CAMAC stuff works.
00010 //
00011 
00012 class CamacTestThread : public CTimedEvent
00013 {
00014   CBD8210         m_Branch;
00015   CCrateController m_Crate;
00016   CCamacNimout     m_Module;
00017   unsigned         m_nValue;
00018 public:
00019   CamacTestThread(int nms, int b, int c, int n) :
00020     CTimedEvent(nms),
00021     m_Branch(b),
00022     m_Crate(b,c),
00023     m_Module(b,c,n),
00024     m_nValue(0)
00025   {
00026     m_Branch.InitBranch();
00027     m_Crate.InitializeCrate();
00028   }
00029   virtual void operator()();
00030 };
00031 
00032 void
00033 CamacTestThread::operator()()
00034 {
00035   m_Module.WriteMask(m_nValue);
00036   m_nValue++;
00037 }
00038 
00039 
00040 class MyApp : public DAQROCNode
00041 {
00042   int operator()(int argc, char** argv);
00043 };
00044 
00045 MyApp app;
00046 
00047 
00048 int
00049 MyApp::operator()(int argc, char** argv)
00050 {
00051   CTimer Sched;
00052   CamacTestThread TheTest(100, 0, 2, 18); // Cycle every 100ms.
00053 
00054   Sched.EstablishEvent(TheTest);
00055   Sched.Start(100);
00056 
00057   string input;
00058 
00059   cin >> input;
00060 
00061   exit(0);
00062  
00063 }

Generated on Fri Nov 8 13:36:43 2002 for Event Readout system. by doxygen1.2.16