def setup(self): self.jig_attrs = self.grid_plane.copyable_attrs_dict( ) # Save the jig's attributes in case of Cancel. # Border color self.border_color = RGBf_to_QColor( self.grid_plane.normcolor ) # Used as default color by Color Chooser # Grid color self.grid_color = RGBf_to_QColor( self.grid_plane.grid_color ) # Used as default color by Color Chooser self.grid_color_pixmap = get_widget_with_color_palette( self.grid_color_pixmap, self.grid_color) self.border_color_pixmap = get_widget_with_color_palette( self.border_color_pixmap, self.border_color) self.name_linedit.setText(self.grid_plane.name) self.width_spinbox.setValue(self.grid_plane.width) self.height_spinbox.setValue(self.grid_plane.height) self.x_spacing_spinbox.setValue(self.grid_plane.x_spacing) self.y_spacing_spinbox.setValue(self.grid_plane.y_spacing) self.grid_type_combox.setCurrentIndex(self.grid_plane.grid_type) self.line_type_combox.setCurrentIndex(self.grid_plane.line_type) self._set_xyspacing_enabled(self.grid_plane.grid_type)
def setup(self): self.jig_attrs = self.grid_plane.copyable_attrs_dict() # Save the jig's attributes in case of Cancel. # Border color self.border_color = RGBf_to_QColor(self.grid_plane.normcolor) # Used as default color by Color Chooser # Grid color self.grid_color = RGBf_to_QColor(self.grid_plane.grid_color) # Used as default color by Color Chooser self.grid_color_pixmap = get_widget_with_color_palette( self.grid_color_pixmap, self.grid_color) self.border_color_pixmap = get_widget_with_color_palette( self.border_color_pixmap,self.border_color) self.name_linedit.setText(self.grid_plane.name) self.width_spinbox.setValue(self.grid_plane.width) self.height_spinbox.setValue(self.grid_plane.height) self.x_spacing_spinbox.setValue(self.grid_plane.x_spacing) self.y_spacing_spinbox.setValue(self.grid_plane.y_spacing) self.grid_type_combox.setCurrentIndex(self.grid_plane.grid_type) self.line_type_combox.setCurrentIndex(self.grid_plane.line_type) self._set_xyspacing_enabled(self.grid_plane.grid_type)
def change_jig_color(self): """Slot method to change the jig's color.""" color = QColorDialog.getColor(self.jig_QColor, self) if color.isValid(): self.jig_QColor = color self.jig_color_pixmap = get_widget_with_color_palette(self.jig_color_pixmap, self.jig_QColor) self.jig.color = self.jig.normcolor = QColor_to_RGBf(color) self.glpane.gl_update()
def change_grid_color(self): '''Slot method to change grid color.''' color = QColorDialog.getColor(self.grid_color, self) if color.isValid(): self.grid_color = color self.grid_color_pixmap = get_widget_with_color_palette( self.grid_color_pixmap, self.grid_color) self.grid_plane.grid_color = QColor_to_RGBf(color) self.glpane.gl_update()
def change_jig_color(self): '''Slot method to change the jig's color.''' color = QColorDialog.getColor(self.jig_QColor, self) if color.isValid(): self.jig_QColor = color self.jig_color_pixmap = get_widget_with_color_palette( self.jig_color_pixmap, self.jig_QColor) self.jig.color = self.jig.normcolor = QColor_to_RGBf(color) self.glpane.gl_update()
def change_border_color(self): '''Slot method change border color.''' color = QColorDialog.getColor(self.border_color, self) if color.isValid(): self.border_color = color self.border_color_pixmap = get_widget_with_color_palette( self.border_color_pixmap,self.border_color) self.grid_plane.color = self.grid_plane.normcolor = QColor_to_RGBf(color) self.glpane.gl_update()
def change_border_color(self): '''Slot method change border color.''' color = QColorDialog.getColor(self.border_color, self) if color.isValid(): self.border_color = color self.border_color_pixmap = get_widget_with_color_palette( self.border_color_pixmap, self.border_color) self.grid_plane.color = self.grid_plane.normcolor = QColor_to_RGBf( color) self.glpane.gl_update()
def setup(self): #Default state for atoms selection self.selected = False self.jig_attrs = self.jig.copyable_attrs_dict( ) # Save the jig's attributes in case of Cancel. # Jig color self.fill_QColor = RGBf_to_QColor( self.jig.fill_color) # Used as default color by Color Chooser self.border_QColor = RGBf_to_QColor( self.jig.normcolor) # Used as default color by Color Chooser self.fill_color_pixmap = get_widget_with_color_palette( self.fill_color_pixmap, self.fill_QColor) self.border_color_pixmap = get_widget_with_color_palette( self.border_color_pixmap, self.border_QColor) self.name_linedit.setText(self.jig.name) self.width_linedit.setText(str(self.jig.width)) self.image_offset_linedit.setText(str(self.jig.image_offset)) self.edge_offset_linedit.setText(str(self.jig.edge_offset)) self.resolution_spinbox.setValue(self.jig.resolution) self.show_esp_bbox_checkbox.setChecked(self.jig.show_esp_bbox) opacity = '%1.2f ' % self.jig.opacity self.opacity_linedit.setText(opacity) self.opacity_slider.setValue(int(self.jig.opacity * 100)) self.highlight_atoms_in_bbox_checkbox.setChecked( self.jig.highlightChecked) self._updateSelectButtonText() self.xaxis_spinbox.setValue(self.jig.xaxis_orient) self.yaxis_spinbox.setValue(self.jig.yaxis_orient) self.png_fname_linedit.setText(self.jig.espimage_file)
def change_fill_color(self): """ Slot method to change fill color. """ color = QColorDialog.getColor(self.fill_QColor, self) if color.isValid(): self.fill_QColor = color self.fill_color_pixmap = get_widget_with_color_palette( self.fill_color_pixmap, self.fill_QColor) self.jig.fill_color = QColor_to_RGBf(color) self.glpane.gl_update()
def setup(self): self.jig_attrs = self.jig.copyable_attrs_dict() # Save the jig's attributes in case of Cancel. # Jig color self.jig_QColor = RGBf_to_QColor(self.jig.normcolor) # Used as default color by Color Chooser self.jig_color_pixmap = get_widget_with_color_palette( self.jig_color_pixmap, self.jig_QColor) # Jig name self.nameLineEdit.setText(self.jig.name) self.molnameLineEdit.setText(self.jig.atoms[0].molecule.name)
def setup(self): #Default state for atoms selection self.selected = False self.jig_attrs = self.jig.copyable_attrs_dict() # Save the jig's attributes in case of Cancel. # Jig color self.fill_QColor = RGBf_to_QColor(self.jig.fill_color) # Used as default color by Color Chooser self.border_QColor = RGBf_to_QColor(self.jig.normcolor) # Used as default color by Color Chooser self.fill_color_pixmap = get_widget_with_color_palette( self.fill_color_pixmap, self.fill_QColor) self.border_color_pixmap = get_widget_with_color_palette( self.border_color_pixmap,self.border_QColor) self.name_linedit.setText(self.jig.name) self.width_linedit.setText(str(self.jig.width)) self.image_offset_linedit.setText(str(self.jig.image_offset)) self.edge_offset_linedit.setText(str(self.jig.edge_offset)) self.resolution_spinbox.setValue(self.jig.resolution) self.show_esp_bbox_checkbox.setChecked(self.jig.show_esp_bbox) opacity = '%1.2f ' % self.jig.opacity self.opacity_linedit.setText(opacity) self.opacity_slider.setValue(int (self.jig.opacity * 100)) self.highlight_atoms_in_bbox_checkbox.setChecked(self.jig.highlightChecked) self._updateSelectButtonText() self.xaxis_spinbox.setValue(self.jig.xaxis_orient) self.yaxis_spinbox.setValue(self.jig.yaxis_orient) self.png_fname_linedit.setText(self.jig.espimage_file)
def setup(self): self.jig_attrs = self.jig.copyable_attrs_dict() # Save the jig's attributes in case of Cancel. # Jig color self.jig_QColor = RGBf_to_QColor(self.jig.normcolor) # Used as default color by Color Chooser self.jig_color_pixmap = get_widget_with_color_palette( self.jig_color_pixmap, self.jig_QColor) self.nameLineEdit.setText(self.jig.name) self.stiffnessLineEdit.setText(str(self.jig.stiffness)) self.forceLineEdit.setText(str(self.jig.force)) self.lengthLineEdit.setText(str(self.jig.length)) self.widthLineEdit.setText(str(self.jig.width)) self.sradiusLineEdit.setText(str(self.jig.sradius)) # spoke radius self.enable_minimize_checkbox.setChecked(self.jig.enable_minimize)
def setup(self): """ Initializes the dialog and it's widgets """ # Save the jig's attributes in case of Cancel. self.jig_attrs = self.jig.copyable_attrs_dict() # Jig color # Used as default color by Color Chooser self.jig_QColor = RGBf_to_QColor(self.jig.normcolor) self.jig_color_pixmap = get_widget_with_color_palette( self.jig_color_pixmap, self.jig_QColor) # Jig name self.nameLineEdit.setText(self.jig.name)
def setup(self): self.jig_attrs = self.jig.copyable_attrs_dict() # Save the jig's attributes in case of Cancel. # Jig color self.jig_QColor = RGBf_to_QColor(self.jig.normcolor) # Used as default color by Color Chooser self.jig_color_pixmap = get_widget_with_color_palette(self.jig_color_pixmap, self.jig_QColor) self.nameLineEdit.setText(self.jig.name) self.torqueLineEdit.setText(str(self.jig.torque)) self.initialSpeedLineEdit.setText(str(self.jig.initial_speed)) self.speedLineEdit.setText(str(self.jig.speed)) self.lengthLineEdit.setText(str(self.jig.length)) self.radiusLineEdit.setText(str(self.jig.radius)) self.sradiusLineEdit.setText(str(self.jig.sradius)) # spoke radius self.enable_minimize_checkbox.setChecked(self.jig.enable_minimize) self.dampers_checkbox.setChecked(self.jig.dampers_enabled) # mark & bruce 060421
def setup(self): self.jig_attrs = self.jig.copyable_attrs_dict( ) # Save the jig's attributes in case of Cancel. # Jig color self.jig_QColor = RGBf_to_QColor( self.jig.normcolor) # Used as default color by Color Chooser self.jig_color_pixmap = get_widget_with_color_palette( self.jig_color_pixmap, self.jig_QColor) self.nameLineEdit.setText(self.jig.name) self.torqueLineEdit.setText(str(self.jig.torque)) self.initialSpeedLineEdit.setText(str(self.jig.initial_speed)) self.speedLineEdit.setText(str(self.jig.speed)) self.lengthLineEdit.setText(str(self.jig.length)) self.radiusLineEdit.setText(str(self.jig.radius)) self.sradiusLineEdit.setText(str(self.jig.sradius)) # spoke radius self.enable_minimize_checkbox.setChecked(self.jig.enable_minimize) self.dampers_checkbox.setChecked( self.jig.dampers_enabled) # mark & bruce 060421
def _setup(self): """ Setup widgets to initial (default or defined) values. Return True on error. """ #To fix bug 684 #if gamess.is_disabled(): # self.run_job_btn.setEnabled(False) #else: # self.run_job_btn.setEnabled(True) self.jig_attrs = self.gamessJig.copyable_attrs_dict( ) # Save the jig's attributes in case of Cancel. # Jig color self.original_normcolor = self.gamessJig.normcolor self.jig_QColor = RGBf_to_QColor( self.gamessJig.normcolor) # Used as default color by Color Chooser self.jig_color_pixmap = get_widget_with_color_palette( self.jig_color_pixmap, self.jig_QColor) # Init the top widgets (name, runtyp drop box, comment) self.name_linedit.setText(self.gamessJig.name) self.runtyp_combox.setCurrentIndex(self.pset.ui.runtyp) # RUNTYP self.calculate_changed(self.pset.ui.runtyp) self.comment_linedit.setText(self.pset.ui.comment) # Electronic Structure Properties section. btn = self.scftyp_btngrp.button( self.pset.ui.scftyp) # RHF, UHF, or ROHF btn.setChecked(True) self.icharg_spinbox.setValue(self.pset.ui.icharg) # Charge self.multi_combox.setCurrentIndex(self.pset.ui.mult) # Multiplicity # Disable RHF if multiplicity is not the first item. if self.pset.ui.mult == 0: self.rhf_radiobtn.setEnabled(1) # Enable RHF else: self.rhf_radiobtn.setEnabled(0) # Disable RHF # System Memory and Usage self.dirscf_checkbox.setChecked(self.pset.ui.dirscf) # DIRSCF self.memory_spinbox.setValue(self.pset.ui.memory) # Memory # Electron Correlation Method and Basis Set ecm = self.pset.ui.ecm btn = self.ecm_btngrp.button(self.pset.ui.ecm) # None, DFT or MP2 btn.setChecked(True) self.set_ecmethod(self.pset.ui.ecm) # None, DFT or MP2 self.gbasis_combox.setCurrentIndex(self.pset.ui.gbasis) # Basis set # Load the combo box with all the valid DFT functions. self._load_dfttyp_combox() self.dfttyp_combox.setCurrentIndex( self.pset.ui.dfttyp) # DFT Functional self.gridsize_combox.setCurrentIndex( self.pset.ui.gridsize) # Grid Size self.core_electrons_checkbox.setChecked( self.pset.ui.ncore) # Include core electrons # Convergence Criteria self.density_conv_combox.setCurrentIndex( self.pset.ui.conv) # Density Convergence self.rmsd_combox.setCurrentIndex( self.pset.ui.rmsdconv) # RMSD Convergence self.iterations_spinbox.setValue(self.pset.ui.iterations) # Iterations # These have been removed per discussions with Damian. # Mark 050628 # self.extrap_checkbox.setChecked(self.pset.ui.extrap) # EXTRAP # self.damp_checkbox.setChecked(self.pset.ui.damp) # DAMP # self.diis_checkbox.setChecked(self.pset.ui.diis) # DIIS # self.shift_checkbox.setChecked(self.pset.ui.shift) # SHIFT # self.soscf_checkbox.setChecked(self.pset.ui.soscf) # SOSCF # self.rstrct_checkbox.setChecked(self.pset.ui.rstrct) # RSTRCT # Load the server combo box #self._reloadServerList() # Not used in A6. Mark. # If there is an error, return 1. NIY. return 0
def _setup(self): """ Setup widgets to initial (default or defined) values. Return True on error. """ #To fix bug 684 #if gamess.is_disabled(): # self.run_job_btn.setEnabled(False) #else: # self.run_job_btn.setEnabled(True) self.jig_attrs = self.gamessJig.copyable_attrs_dict() # Save the jig's attributes in case of Cancel. # Jig color self.original_normcolor = self.gamessJig.normcolor self.jig_QColor = RGBf_to_QColor(self.gamessJig.normcolor) # Used as default color by Color Chooser self.jig_color_pixmap = get_widget_with_color_palette( self.jig_color_pixmap, self.jig_QColor) # Init the top widgets (name, runtyp drop box, comment) self.name_linedit.setText(self.gamessJig.name) self.runtyp_combox.setCurrentIndex(self.pset.ui.runtyp) # RUNTYP self.calculate_changed(self.pset.ui.runtyp) self.comment_linedit.setText(self.pset.ui.comment) # Electronic Structure Properties section. btn = self.scftyp_btngrp.button(self.pset.ui.scftyp)# RHF, UHF, or ROHF btn.setChecked(True) self.icharg_spinbox.setValue(self.pset.ui.icharg) # Charge self.multi_combox.setCurrentIndex(self.pset.ui.mult) # Multiplicity # Disable RHF if multiplicity is not the first item. if self.pset.ui.mult == 0: self.rhf_radiobtn.setEnabled(1) # Enable RHF else: self.rhf_radiobtn.setEnabled(0) # Disable RHF # System Memory and Usage self.dirscf_checkbox.setChecked(self.pset.ui.dirscf) # DIRSCF self.memory_spinbox.setValue(self.pset.ui.memory) # Memory # Electron Correlation Method and Basis Set ecm = self.pset.ui.ecm btn = self.ecm_btngrp.button(self.pset.ui.ecm)# None, DFT or MP2 btn.setChecked(True) self.set_ecmethod(self.pset.ui.ecm) # None, DFT or MP2 self.gbasis_combox.setCurrentIndex(self.pset.ui.gbasis) # Basis set # Load the combo box with all the valid DFT functions. self._load_dfttyp_combox() self.dfttyp_combox.setCurrentIndex(self.pset.ui.dfttyp) # DFT Functional self.gridsize_combox.setCurrentIndex(self.pset.ui.gridsize) # Grid Size self.core_electrons_checkbox.setChecked(self.pset.ui.ncore) # Include core electrons # Convergence Criteria self.density_conv_combox.setCurrentIndex(self.pset.ui.conv) # Density Convergence self.rmsd_combox.setCurrentIndex(self.pset.ui.rmsdconv) # RMSD Convergence self.iterations_spinbox.setValue(self.pset.ui.iterations) # Iterations # These have been removed per discussions with Damian. # Mark 050628 # self.extrap_checkbox.setChecked(self.pset.ui.extrap) # EXTRAP # self.damp_checkbox.setChecked(self.pset.ui.damp) # DAMP # self.diis_checkbox.setChecked(self.pset.ui.diis) # DIIS # self.shift_checkbox.setChecked(self.pset.ui.shift) # SHIFT # self.soscf_checkbox.setChecked(self.pset.ui.soscf) # SOSCF # self.rstrct_checkbox.setChecked(self.pset.ui.rstrct) # RSTRCT # Load the server combo box #self._reloadServerList() # Not used in A6. Mark. # If there is an error, return 1. NIY. return 0