def body(self, master): self.prepareColumns(master) self.addTitleRow(master, "Power Curve Level Settings:") self.wind_speed = self.addEntry(master, "Wind Speed:", validation.ValidateNonNegativeFloat(master), self.item.wind_speed) self.power = self.addEntry(master, "Power:", validation.ValidateNonNegativeFloat(master), self.item.power) self.turbulence = self.addEntry(master, "Turbulence:", validation.ValidateNonNegativeFloat(master), self.item.turbulence)
def body(self, master): self.prepareColumns(master) self.addTitleRow(master, "Inner Range Dimension Settings:") self.parameter = self.addOption(master, "Parameter:", ['Hub Turbulence Intensity', 'Shear Exponent', 'Hub Density', 'Rotor Wind Speed Ratio'], self.item.parameter) self.lower_limit = self.addEntry(master, "Lower Limit:", validation.ValidateNonNegativeFloat(master), self.item.lower_limit) self.upper_limit = self.addEntry(master, "Upper Limit:", validation.ValidateNonNegativeFloat(master), self.item.upper_limit)
def add_power_curve(self, master): self.addTitleRow(master, "Power Curve Bins:") self.powerCurveFirstBin = self.addEntry( master, "First Bin Centre:", validation.ValidateNonNegativeFloat(master), self.config.powerCurveFirstBin) self.powerCurveLastBin = self.addEntry( master, "Last Bin Centre:", validation.ValidateNonNegativeFloat(master), self.config.powerCurveLastBin) self.powerCurveBinSize = self.addEntry( master, "Bin Size:", validation.ValidatePositiveFloat(master), self.config.powerCurveBinSize)
def addFormElements(self, master, path): self.name = self.addEntry(master, "Name:", None, self.config.name, width=60) self.density = self.addEntry( master, "Reference Density:", validation.ValidateNonNegativeFloat(master), self.config.density) self.power_curve_levels_grid_box = PowerCurveLevelsGridBox( master, self, self.row, self.inputColumn) self.power_curve_levels_grid_box.add_items( self.config.power_curve_levels) self.row += 1 self.validatedPowerCurveLevels = validation.ValidatePowerCurveLevels( master, self.power_curve_levels_grid_box) self.validations.append(self.validatedPowerCurveLevels) self.addPowerCurveLevelButton = tk.Button(master, text="Parse", command=self.parse_clipboard, width=5, height=1) self.addPowerCurveLevelButton.grid(row=self.row, sticky=tk.E + tk.S, column=self.secondButtonColumn, pady=30)
def add_inner_range(self, master): self.innerRangeLowerTurbulence = self.addEntry( master, "Inner Range Lower Turbulence:", validation.ValidateNonNegativeFloat(master), self.config.innerRangeLowerTurbulence) self.innerRangeUpperTurbulence = self.addEntry( master, "Inner Range Upper Turbulence:", validation.ValidateNonNegativeFloat(master), self.config.innerRangeUpperTurbulence) self.innerRangeLowerShear = self.addEntry( master, "Inner Range Lower Shear:", validation.ValidatePositiveFloat(master), self.config.innerRangeLowerShear) self.innerRangeUpperShear = self.addEntry( master, "Inner Range Upper Shear:", validation.ValidatePositiveFloat(master), self.config.innerRangeUpperShear)
def addFormElements(self, master, path): self.name = self.addEntry(master, "Name:", None, self.config.name, width=60) self.referenceDensity = self.addEntry( master, "Reference Density:", validation.ValidateNonNegativeFloat(master), self.config.powerCurveDensity) self.referenceTurbulence = self.addEntry( master, "Reference Turbulence:", validation.ValidateNonNegativeFloat(master), self.config.powerCurveTurbulence) tk.Label(master, text="Power Curve Levels:").grid(row=self.row, sticky=tk.W, column=self.titleColumn, columnspan=2) self.row += 1 self.powerCurveLevelsListBoxEntry = self.addListBox( master, "Power Curve Levels ListBox") for windSpeed in self.config.powerCurveDictionary: power = self.config.powerCurveDictionary[windSpeed] self.powerCurveLevelsListBoxEntry.listbox.insert( tk.END, encodePowerLevelValueAsText(windSpeed, power)) self.powerCurveLevelsListBoxEntry.listbox.grid(row=self.row, sticky=tk.W + tk.E + tk.N + tk.S, column=self.labelColumn, columnspan=2) self.validatedPowerCurveLevels = validation.ValidatePowerCurveLevels( master, self.powerCurveLevelsListBoxEntry.listbox) self.validations.append(self.validatedPowerCurveLevels) self.validatedPowerCurveLevels.messageLabel.grid( row=self.row, sticky=tk.W, column=self.messageColumn) self.addPowerCurveLevelButton = tk.Button( master, text="New", command=self.NewPowerCurveLevel, width=5, height=1) self.addPowerCurveLevelButton.grid(row=self.row, sticky=tk.E + tk.S, column=self.secondButtonColumn, pady=30) self.addPowerCurveLevelButton = tk.Button( master, text="Edit", command=self.EditPowerCurveLevel, width=5, height=1) self.addPowerCurveLevelButton.grid(row=self.row, sticky=tk.E + tk.S, column=self.secondButtonColumn) self.addPowerCurveLevelButton = tk.Button( master, text="Delete", command=self.removePowerCurveLevels, width=5, height=1) self.addPowerCurveLevelButton.grid(row=self.row, sticky=tk.E + tk.S, column=self.buttonColumn) self.addPowerCurveLevelButton = tk.Button(master, text="Parse", command=self.parse_clipboard, width=5, height=1) self.addPowerCurveLevelButton.grid(row=self.row, sticky=tk.E + tk.S, column=self.secondButtonColumn, pady=30)