next up previous contents 5
Next: CVS software projects Up: Adding new hardware support Previous: Adding new hardware support   Contents

Example: Adding MAR CCD support

The following example lists the basic steps that were used to add support for a MAR CCD using the 'standard' DHS.

  1. The MAR CCD protocol was studied and it was determined to be most similar to the existing Quantum 315 protocol. Therefore, it was decided to use the 'standard' DHS as a baseline.

  2. The 'standard' DHS uses the mysql database to acquire its configuration. Thus, the following table was created to store a MAR CCD's configuration. At the mysql prompt:

    CREATE TABLE MARCCD (
      ControllerID int(11) NOT NULL,
      serialNumber varchar(30) NOT NULL default '0',
      HostName varchar(30) default NULL,
      CommandPort int(11) default NULL,
      DarkRefreshTime int(11) default NULL,
      BeamCenterX double(16,4) default NULL,
      BeamCenterY double(16,4) default NULL,
      darkExposureTolerance float(10,2) NOT NULL default '0.10',
      writeRawImages char(1) default NULL,
      PRIMARY KEY  (ControllerID)
    ) TYPE=MyISAM;
    

  3. After the table was created, a sample configuration was inserted into the table:

    INSERT INTO MARCCD VALUES (1,'0','marpc',3000,180,94.0000,94.0000,0.10,'Y');
    

  4. The dhs_config.cc file was modified to look at the MAR CCD table when determining its configuration.

    diff -c -r1.8 dhs_config.cc
    *** dhs_config.cc	8 Nov 2002 19:52:38 -0000	1.8
    --- dhs_config.cc	13 Dec 2002 18:01:53 -0000
    ***************
    *** 70,75 ****
    --- 70,76 ----
      XOS_THREAD_ROUTINE Quantum315Thread (void * parameter );
      XOS_THREAD_ROUTINE MAR345 (void * parameter );
      XOS_THREAD_ROUTINE ASYNC2100 (void * parameter );
    + XOS_THREAD_ROUTINE MARCCDThread(void * paramater);
      #ifdef WITH_CAMERA_SUPPORT
      XOS_THREAD_ROUTINE DHS_Camera (void * parameter );
      #endif
    ***************
    *** 213,218 ****
    --- 214,220 ----
      	deviceTables["MAR345"] = (XOS_THREAD_ROUTINE_PTR)MAR345;
      	deviceTables["CCD"] = (XOS_THREAD_ROUTINE_PTR)Quantum4Thread; //i.e. Quantum4
      	deviceTables["Quantum315"] = (XOS_THREAD_ROUTINE_PTR)Quantum315Thread;
    + 	deviceTables["MARCCD"] = (XOS_THREAD_ROUTINE_PTR)MARCCDThread;
      #endif
    

  5. The dhs_Quantum315.cc file was copied to dhs_MARCCD.cc and the Quantum315Thread procedure was modified to MARCCDThread.

  6. The final step involved coding handles for each operation command and appropriately controlled the MAR CCD.


next up previous contents 5
Next: CVS software projects Up: Adding new hardware support Previous: Adding new hardware support   Contents
Scott McPhillips 2011-07-06