-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add start of ability to modify PID settings
- Loading branch information
Showing
9 changed files
with
200 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
__pycache__/* | ||
logs/*.log | ||
logs/*.log* | ||
xchg/* | ||
simple_pid.py | ||
webserver/__pycache__/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
#!/usr/bin/python3 | ||
|
||
# Import 3rd party libraries ---------------------------------------- | ||
import tkinter as tk | ||
import tkinter.font as font | ||
|
||
# Import standard libraries ----------------------------------------- | ||
# import logging | ||
|
||
# Import application libraries -------------------------------------- | ||
import colors | ||
import paths | ||
|
||
from xchg import XchgData | ||
|
||
|
||
# ------------------------------------------------------------------- | ||
# Associate attached sensors to beer, chamber, or ambient temps | ||
# ------------------------------------------------------------------- | ||
class gBPID(tk.Frame): | ||
def __init__(self, master=None): | ||
super().__init__(master) | ||
self.master = master | ||
|
||
self.create_widgets() | ||
|
||
self.xd = XchgData() # read only for now | ||
|
||
self.visible = False | ||
self.populate_widgets() | ||
|
||
def populate_widgets(self): | ||
self.beer_P['text'] = 'P ' + str(self.master.beer_kp) | ||
|
||
def create_widgets(self): | ||
self.button_font = font.Font(family='TkTextFont', size=-60, weight='bold') | ||
|
||
self.plus_P = tk.Button( | ||
self.master.values_box, | ||
text="+", | ||
command=self.increase_P, | ||
foreground=colors.background, | ||
background=colors.normal50, | ||
borderwidth=0, | ||
highlightthickness=0, | ||
font=self.button_font, | ||
activebackground=colors.normal_button, | ||
highlightbackground=colors.normal_button, | ||
highlightcolor=colors.normal_button, | ||
relief=tk.FLAT | ||
) | ||
|
||
self.minus_P = tk.Button( | ||
self.master.values_box, | ||
text="-", | ||
command=self.decrease_P, | ||
foreground=colors.background, | ||
background=colors.normal50, | ||
borderwidth=0, | ||
highlightthickness=0, | ||
font=self.button_font, | ||
activebackground=colors.normal_button, | ||
highlightbackground=colors.normal_button, | ||
highlightcolor=colors.normal_button, | ||
relief=tk.FLAT | ||
) | ||
|
||
self.default_P = tk.Button( | ||
self.master.values_box, | ||
text="@", | ||
command=self.default_P, | ||
foreground=colors.background, | ||
background=colors.normal50, | ||
borderwidth=0, | ||
highlightthickness=0, | ||
font=self.button_font, | ||
activebackground=colors.normal_button, | ||
highlightbackground=colors.normal_button, | ||
highlightcolor=colors.normal_button, | ||
relief=tk.FLAT | ||
) | ||
|
||
self.beer_P = tk.Label(self.master.values_box, | ||
text="P ?.?", | ||
background=colors.background, | ||
fg=colors.normal50, | ||
font=self.button_font | ||
) | ||
|
||
def increase_P(self): | ||
self.master.beer_kp += 0.1 | ||
self.populate_widgets() | ||
|
||
def decrease_P(self): | ||
self.master.beer_kp -= 0.1 | ||
self.populate_widgets() | ||
|
||
def default_P(self): | ||
self.master.beer_kp = paths.default_beerP | ||
self.populate_widgets() | ||
|
||
def hide(self): | ||
self.visible = False | ||
self.plus_P.place(x=0, y=0, height=0, width=0) | ||
self.minus_P.place(x=0, y=0, height=0, width=0) | ||
self.beer_P.place(x=0, y=0, height=0, width=0) | ||
self.default_P.place(x=0, y=0, height=0, width=0) | ||
|
||
def show(self): | ||
self.visible = True | ||
self.populate_widgets() | ||
|
||
self.plus_P.place(x=160, y=60, height=80, width=80) | ||
self.minus_P.place(x=260, y=60, height=80, width=80) | ||
self.beer_P.place(x=360, y=60, height=80, width=240) | ||
self.default_P.place(x=700, y=60, height=80, width=80) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/python3 | ||
|
||
# Import 3rd party libraries ---------------------------------------- | ||
import tkinter as tk | ||
import tkinter.font as font | ||
|
||
# Import standard libraries ----------------------------------------- | ||
import logging | ||
|
||
# Import application libraries -------------------------------------- | ||
# import colors | ||
# import paths | ||
|
||
from xchg import XchgData | ||
|
||
|
||
# ------------------------------------------------------------------- | ||
# Associate attached sensors to beer, chamber, or ambient temps | ||
# ------------------------------------------------------------------- | ||
class gCPID(tk.Frame): | ||
def __init__(self, master=None): | ||
super().__init__(master) | ||
self.master = master | ||
|
||
self.create_widgets() | ||
|
||
self.xd = XchgData() # read only for now | ||
|
||
self.visible = False | ||
self.populate_widgets() | ||
|
||
def populate_widgets(self): | ||
logging.debug("populate_widgets") | ||
|
||
def create_widgets(self): | ||
normal_font = font.Font(family='DejaVu Sans Mono', size=-36) # , weight='bold') | ||
|
||
def hide(self): | ||
logging.debug("gPBID hide") | ||
self.visible = False | ||
|
||
def show(self): | ||
self.visible = True | ||
self.populate_widgets() | ||
logging.debug("gBIPD show") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters