Skip to content

Commit

Permalink
set power with percentage (#104)
Browse files Browse the repository at this point in the history
* set power with percentage

* set power with value or percentage

---------

Co-authored-by: Damien Albisson <UF205DAL@net.elsys-design.com>
  • Loading branch information
Darcraytore1 and Damien Albisson authored Jun 26, 2024
1 parent 6a3c1d9 commit 8b787c8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions panduza/interfaces/blc.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,15 @@ def set_mode_constant_power(self):
def set_mode_constant_current(self):
self.mode.value.set("constant_current")

# Set power value
def set_power_goal_point(self, value):
# Set power value directly with value
def set_power_value(self, value):
self.power.value.set(value)

# Set power value with percentage (0% to 100%)
def set_power_with_percentage(self, percentage):
value_with_percentage = (1/100) * percentage * self.power.max.get()
self.power.value.set(value_with_percentage)

def get_power_min_value(self):
return self.power.min.get()

Expand Down

0 comments on commit 8b787c8

Please sign in to comment.