##// END OF EJS Templates
GUI: Shows message when output path has not been defined.
Miguel Valdez -
r801:b5ee42833830
parent child
Show More
@@ -4,4 +4,4 Created on Feb 7, 2012
4 @author $Author$
4 @author $Author$
5 @version $Id$
5 @version $Id$
6 '''
6 '''
7 __version__ = "2.2.3.2" No newline at end of file
7 __version__ = "2.2.3.3" No newline at end of file
@@ -5327,23 +5327,18 class BasicWindow(QMainWindow, Ui_BasicWindow):
5327 output_path = str(self.specHeisOutputPath.text())
5327 output_path = str(self.specHeisOutputPath.text())
5328 blocksperfile = str(self.specHeisOutputblocksperfile.text())
5328 blocksperfile = str(self.specHeisOutputblocksperfile.text())
5329 metadata_file = str(self.specHeisOutputMetada.text())
5329 metadata_file = str(self.specHeisOutputMetada.text())
5330
5330
5331 if output_path == '':
5331 message = ''
5332 outputstr = 'Outputpath is empty'
5333 self.console.append(outputstr)
5334 parms_ok = False
5335
5332
5336 if not os.path.isdir(output_path):
5333 if not os.path.isdir(output_path):
5337 outputstr = 'OutputPath:%s does not exist' % output_path
5334 message += 'OutputPath:%s does not exist\n' % output_path
5338 self.console.append(outputstr)
5339 parms_ok = False
5335 parms_ok = False
5340
5336
5341 try:
5337 try:
5342 profilesperblock = int(profilesperblock)
5338 profilesperblock = int(profilesperblock)
5343 except:
5339 except:
5344 if datatype == "Voltage":
5340 if datatype == "Voltage":
5345 outputstr = 'Profilesperblock: %s, this must be a integer number' % str(self.volOutputprofilesperblock.text())
5341 message += 'Profilesperblock: %s, this must be a integer number\n' % str(self.volOutputprofilesperblock.text())
5346 self.console.append(outputstr)
5347 parms_ok = False
5342 parms_ok = False
5348 profilesperblock = None
5343 profilesperblock = None
5349
5344
@@ -5351,23 +5346,24 class BasicWindow(QMainWindow, Ui_BasicWindow):
5351 blocksperfile = int(blocksperfile)
5346 blocksperfile = int(blocksperfile)
5352 except:
5347 except:
5353 if datatype == "Voltage":
5348 if datatype == "Voltage":
5354 outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.volOutputblocksperfile.text())
5349 message += 'Blocksperfile: %s, this must be a integer number\n' % str(self.volOutputblocksperfile.text())
5355 elif datatype == "Spectra":
5350 elif datatype == "Spectra":
5356 outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.specOutputblocksperfile.text())
5351 message += 'Blocksperfile: %s, this must be a integer number\n' % str(self.specOutputblocksperfile.text())
5357 elif datatype == "SpectraHeis":
5352 elif datatype == "SpectraHeis":
5358 outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.specHeisOutputblocksperfile.text())
5353 message += 'Blocksperfile: %s, this must be a integer number\n' % str(self.specHeisOutputblocksperfile.text())
5359
5354
5360 self.console.append(outputstr)
5361 parms_ok = False
5355 parms_ok = False
5362 blocksperfile = None
5356 blocksperfile = None
5363
5357
5364 if datatype == "SpectraHeis":
5358 if datatype == "SpectraHeis":
5365 if metadata_file != '':
5359 if metadata_file != '':
5366 if not os.path.isfile(metadata_file):
5360 if not os.path.isfile(metadata_file):
5367 outputstr = 'Metadata file %s does not exist' % metadata_file
5361 message += 'Metadata file %s does not exist\n' % metadata_file
5368 self.console.append(outputstr)
5369 parms_ok = False
5362 parms_ok = False
5370
5363
5364 if str.strip(output_path) != '':
5365 self.console.append(message)
5366
5371 if datatype == "Voltage":
5367 if datatype == "Voltage":
5372 return parms_ok, output_path, blocksperfile, profilesperblock
5368 return parms_ok, output_path, blocksperfile, profilesperblock
5373
5369
General Comments 0
You need to be logged in to leave comments. Login now