示例#1
0
    def save_pipette_values(self):
        """Save pipette values to otone_data/pipette_values.json
        """
        if debug == True: FileIO.log('head.save_pipette_values called')
        pipette_values = {}

        for axis in self.PIPETTES:
            pipette_values[axis] = {}
            for k, v in self.PIPETTES[axis].__dict__.items():
                pipette_values[axis][k] = v

            # should include:
            #  'top'
            #  'bottom'
            #  'blowout'
            #  'droptip'
            #  'volume'
            #  'theContainers'

        filetext = json.dumps(pipette_values,sort_keys=True,indent=4,separators=(',',': '))
        if debug == True: FileIO.log('filetext: ', filetext)
        
        filename = os.path.join(self.dir_par_par_path,'otone_data/pipette_calibrations.json')

        # save the pipette's values to a local file, to be loaded when the server restarts
        FileIO.writeFile(filename,filetext,lambda: FileIO.onError('\t\tError saving the file:\r\r'))      
示例#2
0
    def save_pipette_values(self):
        """Save pipette values to otone_data/pipette_values.json
        """
        logger.debug('head.save_pipette_values called')
        pipette_values = {}

        params_to_save = [
            'resting',
            'top',
            'bottom',
            'blowout',
            'droptip',
            'volume',
            'theContainers',
            'tip_racks',
            'trash_container',
            'tip_rack_origin'
        ]

        for axis in self.PIPETTES:
            pipette_values[axis] = {}
            for k, v in self.PIPETTES[axis].__dict__.items():
                # make sure we're only saving what we need from that pipette module
                if k in params_to_save:
                    pipette_values[axis][k] = v

            # should include:
            #  'top'
            #  'bottom'
            #  'blowout'
            #  'droptip'
            #  'volume'
            #  'theContainers'

        filetext = json.dumps(pipette_values,sort_keys=True,indent=4,separators=(',',': '))
        
        filename = os.path.join(self.dir_path,'otone_data/pipette_calibrations.json')

        # save the pipette's values to a local file, to be loaded when the server restarts
        FileIO.writeFile(filename,filetext,lambda: logger.debug('\t\tError saving the file:\r\r'))      
示例#3
0
    def save_pipette_values(self):
        """Save pipette values to otone_data/pipette_values.json
        """
        pipette_values = {}

        params_to_save = [
            'resting',
            'top',
            'bottom',
            'blowout',
            'droptip',
            'volume',
            'theContainers',
            'tip_racks',
            'trash_container',
            'tip_rack_origin'
        ]

        for axis in self.PIPETTES:
            pipette_values[axis] = {}
            for k, v in self.PIPETTES[axis].__dict__.items():
                # make sure we're only saving what we need from that pipette module
                if k in params_to_save:
                    pipette_values[axis][k] = v

            # should include:
            #  'top'
            #  'bottom'
            #  'blowout'
            #  'droptip'
            #  'volume'
            #  'theContainers'

        filetext = json.dumps(pipette_values,sort_keys=True,indent=4,separators=(',',': '))
        
        filename = os.path.join(self.dir_path,'otone_data/pipette_calibrations.json')

        # save the pipette's values to a local file, to be loaded when the server restarts
        FileIO.writeFile(filename,filetext,lambda: logger.debug('\t\tError saving the file:\r\r'))      
示例#4
0
 def save_containers(self, containers_data):
     containers_text = json.dumps(containers_data,sort_keys=True,indent=4,separators=(',',': '))
     filename = os.path.join(self.dir_path,'otone_data/containers.json')
     FileIO.writeFile(filename,container_text,lambda: FileIO.onError('\t\tError saving the file:\r\r'))              
示例#5
0
 def save_containers(self, containers_data):
     logger.debug('deck.save_containers called')
     containers_text = json.dumps(containers_data,sort_keys=True,indent=4,separators=(',',': '))
     logger.debug('containers_text: {}'.format(containers_text))
     filename = os.path.join(self.dir_path,'otone_data/containers.json')
     FileIO.writeFile(filename,container_text,lambda: FileIO.onError('\t\tError saving the file:\r\r'))