Wed 28 Aug 21:38:52 CEST 2024
This commit is contained in:
		
							parent
							
								
									81db81a36d
								
							
						
					
					
						commit
						3faa75064c
					
				
							
								
								
									
										38
									
								
								src/SimNDT/gui/newScenarioController.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								src/SimNDT/gui/newScenarioController.py
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,38 @@ | ||||||
|  | __author__ = 'Miguel Molero' | ||||||
|  | 
 | ||||||
|  | from PySide.QtCore import * | ||||||
|  | from PySide.QtGui import * | ||||||
|  | 
 | ||||||
|  | from SimNDT.gui import resources_rc | ||||||
|  | from SimNDT.gui.ui_newscenario import Ui_NewModel | ||||||
|  | from SimNDT.gui.Warnings import WarningParms | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | class NewScenario(QDialog, Ui_NewModel): | ||||||
|  | 	def __init__(self, parent = None): | ||||||
|  | 		super(NewScenario,self).__init__(parent) | ||||||
|  | 		self.setupUi(self) | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 	def accept(self): | ||||||
|  | 		try: | ||||||
|  | 			self.width = float(self.widthLineEdit.text()) | ||||||
|  | 			self.height = float(self.heightLineEdit.text()) | ||||||
|  | 			self.pixel  = float(self.pixelLineEdit.text()) | ||||||
|  | 			self.label = int(self.labelSpinBox.value()) | ||||||
|  | 
 | ||||||
|  | 		except: | ||||||
|  | 			msgBox = WarningParms() | ||||||
|  | 			msgBox.exec_() | ||||||
|  | 			return | ||||||
|  | 
 | ||||||
|  | 		QDialog.accept(self) | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | if __name__ == '__main__': | ||||||
|  | 	import sys | ||||||
|  | 	app = QApplication(sys.argv) | ||||||
|  | 	dialog = NewScenario() | ||||||
|  | 	dialog.exec_() | ||||||
|  | 	app.exec_() | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user