Ejemplo n.º 1
0
    def readConfig(self, filename):
        """Read the .hjson configuration file to set up the DAQ unit."""
        # Opens use file
        self.configFile = filename

        if self.verbose:
            print("IV.readConfig: Reading config file: ", self.configFile)
        newConfig = hjsonConfig.hjsonConfig(filename=filename, verbose=self.vverbose)
        if self.vverbose:
            print("IV.readConfig: Read config: ")
            pprint.pprint(newConfig)
        self.setConfig(newConfig)
Ejemplo n.º 2
0
    def readConfig(self, filename):
        """Read the .hjson configuration file to set up the DAQ unit."""
        # Opens use file
        self.configFile = filename

        if self.verbose:
            print("Reading config file: ", self.configFile)
        try:
            newConfig = hjsonConfig.hjsonConfig(filename=filename,
                                                verbose=self.vverbose)
            self.setConfig(newConfig)
        except OSError:
            if self.verbose:
                print("No DAQ config file found, using existing DAQ config.")
# creates a default configuration for a DAQ object

from LabEquipment.lib import hjsonConfig

from pkg_resources import resource_filename

verbose=False

filename = resource_filename("LabEquipment", "config/IVP_timestream-default.hjson")
if verbose:
    print("_default_IVP_timestream_config: Reading Default configFile: ", filename)
defaultConfig = hjsonConfig.hjsonConfig(filename=filename, verbose=verbose)