Skip to content
Snippets Groups Projects
Select Git revision
  • 6cbf9947a0629ed23e47d25fe77aa004cf368157
  • master default protected
  • ballinvoher protected
  • old-master
4 results

gqgmc.cc

Blame
  • user avatar
    Phil Gillaspy authored
    32d4616d
    History
    gqgmc.cc 55.88 KiB
    // **************************************************************************
    // File: gqgmc.cc
    //
    // Author:    Phil Gillaspy
    //
    // Last Modified: 04/26/2012
    //
    // Synopsis:
    //   Define the class and its methods describing the capabilities
    //   of the GQ Electronics LLC Geiger-Muller Counter (GQ GMC).
    //   this code applies to model 300 and later geiger counters.
    //
    // CONTINUATION OF DOCUMENTATION FROM gqgmc.hh
    //
    //
    // C++ includes
    #include <string>
    #include <sstream>
    #include <fstream>
    #include <iostream>
    #include <iomanip>
    #include <ios>
    using namespace std;
    
    // These are the C stdio includes needed for configuring the serial port.
    #include <unistd.h>
    #include <fcntl.h>
    #include <termios.h>
    #include <string.h>
    
    // These are GQ GMC project specific includes
    #include "gqgmc.hh"
    using namespace GQLLC;
    
    // LOCAL CONSTANTS
    //
    // GQ GMC COMMANDS
    /*
     Here we declare local constants which are the ASCII strings for the
     various commands to the GQ GMC. These are not declared as data
     members of the GQGMC class because there is just no need to do so.
     The user never need know the actual string commands because there
     is a dedicated public method for each command.
    
     All commands start with '<'. That is followed by ASCII text,
     followed by ">>". Commands which take binary data as parameters
     must be dynamically constructed within the command method.
    */
    
    static const string  get_serial_cmd        = "<GETSERIAL>>";
    static const string  get_version_cmd       = "<GETVER>>";
    static const string  get_voltage_cmd       = "<GETVOLT>>";
    static const string  get_cpm_cmd           = "<GETCPM>>";
    static const string  get_cps_cmd           = "<GETCPS>>";
    static const string  get_cfg_cmd           = "<GETCFG>>";
    static const string  erase_cfg_cmd         = "<ECFG>>";
    static const string  update_cfg_cmd        = "<CFGUPDATE>>";
    static const string  turn_on_cps_cmd       = "<HEARTBEAT1>>";
    static const string  turn_off_cps_cmd      = "<HEARTBEAT0>>";
    static const string  turn_off_pwr_cmd      = "<POWEROFF>>";
    // The get_history data command has to be formed dynamically since
    // the additional data are parameters of the command.
    // This is also true of the write configuration data command.
    // The send software key command also needs a extra data parameter
    // and so it needs to be formed dynamically.
    // The set time and set date commands also use a hexadecimal parameter
    // and so need to be formed dynamically.
    
    // FIRMWARE CONSTANT
    // Older firmware is any revision prior to 2.23. Not all commands will