Load previsouly saved input values, and load them to GUI widgets

        :param fname: file path where stashed input values are stored
        :type fname: str

def loadInputs(self, fname):
        """Load previsouly saved input values, and load them to GUI widgets

        :param fname: file path where stashed input values are stored
        :type fname: str
        """
        inputsfname = os.path.join(systools.get_appdir(), fname)
        try:
            with open(inputsfname, 'r') as jf:
                inputsdict = json.load(jf)
        except:
            logger = logging.getLogger('main')
            logger.warning("Unable to load app data from file: {}".format(inputsfname))
            inputsdict = {}

        # self.display.spiketracePlot.setThreshold(inputsdict.get('threshold', 0.5))
        self._thesholds = inputsdict.get('threshold', {})
        self.stashedAisr = inputsdict.get('aifs', 100000)
        self.ui.aifsSpnbx.setValue(self.stashedAisr)
        self.ui.windowszSpnbx.setValue(inputsdict.get('windowsz', 0.1))
        self.ui.binszSpnbx.setValue(inputsdict.get('binsz', 0.005))        
        self.saveformat = inputsdict.get('saveformat', 'hdf5')
        self.ui.exploreStimEditor.setReps((inputsdict.get('ex_nreps', 5)))
        self.ui.reprateSpnbx.setValue(inputsdict.get('reprate', 1))
        # self.display.spiketracePlot.setRasterBounds(inputsdict.get('raster_bounds', (0.5,1)))
        self.specArgs = inputsdict.get('specargs',{u'nfft':512, u'window':u'hanning', u'overlap':90, 'colormap':{'lut':None, 'state':None, 'levels':None}})
        # self.display.setSpecArgs(**self.specArgs)  
        SpecWidget.setSpecArgs(**self.specArgs)
        self.viewSettings = inputsdict.get('viewSettings', {'fontsz': 10, 'display_attributes':{}})
        self.ui.stimDetails.setDisplayAttributes(self.viewSettings['display_attributes'])
        font = QtGui.QFont()
        font.setPointSize(self.viewSettings['fontsz'])
        QtGui.QApplication.setFont(font)
        self.ui.calibrationWidget.ui.nrepsSpnbx.setValue(inputsdict.get('calreps', 5))
        self.calvals = inputsdict.get('calvals', {'calf':20000, 'caldb':100, 
                                      'calv':0.1, 'use_calfile':False, 
                                      'frange':(5000, 1e5), 'calname': ''})
        self.calvals['use_calfile'] = False
        self.calvals['calname'] = ''
        self.ui.refDbSpnbx.setValue(self.calvals['caldb'])
        self.ui.mphoneSensSpnbx.setValue(inputsdict.get('mphonesens', 0.004))
        self.ui.mphoneDBSpnbx.setValue(MPHONE_CALDB)
        # self.ui.mphoneDBSpnbx.setValue(inputsdict.get('mphonedb', 94))
        Vocalization.paths = inputsdict.get('vocalpaths', [])

        # load the previous sessions scaling
        self.tscale = inputsdict.get('tscale', SmartSpinBox.MilliSeconds)
        self.fscale = inputsdict.get('fscale', SmartSpinBox.kHz)
        try:
            self.updateUnitLabels(self.tscale, self.fscale)
        except:
            self.tscale = 'ms'
            self.fscale = 'kHz'
            self.updateUnitLabels(self.tscale, self.fscale)

        cal_template = inputsdict.get('calparams', None)
        if cal_template is not None:
            try:
                self.acqmodel.load_calibration_template(cal_template)
            except:
                logger = logging.getLogger('main')
                logger.exception("Unable to load previous calibration settings")
        else:
            logger = logging.getLogger('main')
            logger.debug('No saved calibration stimului inputs')

        if 'explorestims' in inputsdict:
            self.ui.exploreStimEditor.loadTemplate(inputsdict['explorestims'])
        else:
            logger = logging.getLogger('main')
            logger.debug('No saved explore stimului inputs')

        # load the previous session's Tuning Curve defaults
        TCFactory.defaultInputs.update(inputsdict.get('tuning_curve', TCFactory.defaultInputs))

        # set defaults then merge
        self.advanced_options = {'device_name':'', 
                                 'max_voltage':1.5,
                                 'device_max_voltage': 10.0,
                                 'volt_amp_conversion': 0.1,
                                 'use_attenuator': False }
        if 'advanced_options' in inputsdict:
            self.advanced_options.update(inputsdict['advanced_options'])
        StimulusModel.setMaxVoltage(self.advanced_options['max_voltage'], self.advanced_options['device_max_voltage'])
        self.display.setAmpConversionFactor(self.advanced_options['volt_amp_conversion'])
        if self.advanced_options['use_attenuator']:
            self.acqmodel.attenuator_connection(True)
        else:
            self.acqmodel.attenuator_connection(False)
        self._aichans = inputsdict.get('aichans', [])
        self._aichan_details = inputsdict.get('aichan_details', {})
        for name, deets in self._aichan_details.items():
            # make sure all field as present in details for each channel
            self._aichan_details[name]['threshold'] = deets.get('threshold', 5)
            self._aichan_details[name]['polarity'] = deets.get('polarity', 1)
            self._aichan_details[name]['raster_bounds'] = deets.get('raster_bounds', (0.5,0.9))
            self._aichan_details[name]['abs'] = deets.get('abs', True)

        self.reset_device_channels()

        stim_defaults = inputsdict.get('stim_view_defaults', {})
        for name, state in stim_defaults.items():
            StimulusView.updateDefaults(name, state)