diff --git a/easyDiffractionApp/Logic/Experiment.py b/easyDiffractionApp/Logic/Experiment.py index 345ebb4..f143676 100644 --- a/easyDiffractionApp/Logic/Experiment.py +++ b/easyDiffractionApp/Logic/Experiment.py @@ -280,16 +280,6 @@ def loadExperimentFromCifString(self, cifString="", job_name=""): self.defined = bool(len(self._dataBlocksNoMeas)) self._job.interface = self._interface - # FIXME: REMOVE HARDCODED CWL - self._dataBlocksNoMeas[0]['params']['_diffrn_radiation']['type'] = {} - self._dataBlocksNoMeas[0]['params']['_diffrn_radiation']['type']['value'] = 'cwl' - self._dataBlocksNoMeas[0]['params']['_diffrn_radiation']['type']['category'] = '_diffrn_radiation' - self._dataBlocksNoMeas[0]['params']['_diffrn_radiation']['type']['prettyCategory'] = 'radiation' - self._dataBlocksNoMeas[0]['params']['_diffrn_radiation']['type']['name'] = 'type' - self._dataBlocksNoMeas[0]['params']['_diffrn_radiation']['type']['prettyName'] = '' - self._dataBlocksNoMeas[0]['params']['_diffrn_radiation']['type']['fittable'] = False - self.dataBlocksChanged.emit() - def jobToBlock(self, job=None): ''' Convert a Job object to a list of data blocks, without the measured data @@ -316,6 +306,17 @@ def jobToBlock(self, job=None): url = url + category, cifDict = cifDict )) + name = 'type' + dataBlock[param][category][name] = dict(Parameter( + value = 'cwl', # This needs proper parsing in the library + permittedValues = ['cwl', 'tof'], + optional = True, + category = category, + name = name, + shortPrettyName = name, + url = url + category, + cifDict = cifDict + )) name = 'wavelength' category = '_diffrn_radiation_wavelength' prettyCategory = 'radiation'