def add_turbine(self, master): self.cutInWindSpeed = self.addEntry(master, "Cut In Wind Speed:", validation.ValidatePositiveFloat(master), self.config.cutInWindSpeed) self.cutOutWindSpeed = self.addEntry(master, "Cut Out Wind Speed:", validation.ValidatePositiveFloat(master), self.config.cutOutWindSpeed) self.ratedPower = self.addEntry(master, "Rated Power:", validation.ValidatePositiveFloat(master), self.config.ratedPower) self.hubHeight = self.addEntry(master, "Hub Height:", validation.ValidatePositiveFloat(master), self.config.hubHeight) self.diameter = self.addEntry(master, "Diameter:", validation.ValidatePositiveFloat(master), self.config.diameter) self.rotor_tilt = self.addEntry(master, "Tilt:", validation.ValidateOptionalFloat(master), self.config.rotor_tilt)
def body(self, master): self.prepareColumns(master) self.addTitleRow(master, "Power Deviation Matrix Dimension Settings:") self.parameter = self.addOption(master, "Parameter:", [ 'Hub Wind Speed', 'Hub Turbulence Intensity', 'Rotor Wind Speed Ratio', 'Normalised Hub Wind Speed' ], self.item.parameter) self.index = self.addEntry(master, "Index:", validation.ValidatePositiveInteger(master), self.item.index) self.center_of_first_bin = self.addEntry( master, "Center of First Bin:", validation.ValidateFloat(master), self.item.centerOfFirstBin) self.bin_width = self.addEntry( master, "Bin Width:", validation.ValidatePositiveFloat(master), self.item.binWidth) self.number_of_bins = self.addEntry( master, "Number of Bins:", validation.ValidatePositiveInteger(master), self.item.numberOfBins) self.center_of_last_bin = self.addEntry(master, "Center of Last Bin:", None, self.item.centerOfLastBin, read_only=True) self.center_of_first_bin.variable.trace('w', self.update_last) self.bin_width.variable.trace('w', self.update_last) self.number_of_bins.variable.trace('w', self.update_last)
def add_rews(self, master): self.rewsCorrectionActive = self.addCheckBox(master, "REWS Active", self.config.rewsActive) self.rewsVeer = self.addCheckBox(master, "REWS Veer", self.config.rewsVeer) self.rewsUpflow = self.addCheckBox(master, "REWS Upflow", self.config.rewsUpflow) self.rewsExponent = self.addEntry(master, "REWS Exponent:", validation.ValidatePositiveFloat(master), self.config.rewsExponent)
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 body(self, master): self.prepareColumns(master) self.addTitleRow(master, "Shear measurement:") self.height = self.addEntry(master, "Height:", validation.ValidatePositiveFloat(master), self.item.height) self.windSpeed = self.addPickerEntry(master, "Wind Speed:", validation.ValidateNotBlank(master), self.item.wind_speed_column, width = 60) #dummy label to indent controls tk.Label(master, text=" " * 5).grid(row = (self.row-1), sticky=tk.W, column=self.titleColumn)
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 body(self, master): self.prepareColumns(master) self.addTitleRow(master, "REWS Level Settings:") self.height = self.addEntry(master, "Height:", validation.ValidatePositiveFloat(master), self.item.height) parse_button = tk.Button(master, text="Parse", command = self.parse_height, width=3, height=1) parse_button.grid(row=(self.row-1), sticky=tk.N, column=self.inputColumn, padx = 160) self.windSpeed = self.addPickerEntry(master, "Wind Speed:", validation.ValidateNotBlank(master), self.item.wind_speed_column, width = 60) self.windDirection = self.addPickerEntry(master, "Wind Direction:", None, self.item.wind_direction_column, width = 60) self.upflow = self.addPickerEntry(master, "Upflow:", None, self.item.upflow_column, width = 60) #dummy label to indent controls tk.Label(master, text=" " * 5).grid(row = (self.row-1), sticky=tk.W, column=self.titleColumn)
def body(self, master): self.prepareColumns(master) if not self.isNew: items = self.text.split("|") windSpeed = float(items[0]) power = float(items[1].strip()) else: windSpeed = 0.0 power = 0.0 self.addTitleRow(master, "Power Curve Level Settings:") self.windSpeed = self.addEntry( master, "Wind Speed:", validation.ValidatePositiveFloat(master), windSpeed) self.power = self.addEntry(master, "Power:", validation.ValidateFloat(master), power) #dummy label to indent controls tk.Label(master, text=" " * 5).grid(row=(self.row - 1), sticky=tk.W, column=self.titleColumn)