Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions pymodmon.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## @package pymodmon
# Python Modbus Monitor
# a small program that uses the pymodbus package to retrieve and
# display modbus slave data.
# display modbus subordinate data.
# requires: Python 2.7, pymodbus, docopt
#
# Date created: 2016-05-04
Expand Down Expand Up @@ -435,13 +435,13 @@ def printConfig(self):
## class that contains all GUI specifics
#
class Gui:
def __init__(self,master):
def __init__(self,main):

## configure app window
master.title('Python Modbus Monitor')
master.minsize(width=550, height=450)
master.geometry("550x550") ## scale window a bit bigger for more data lines
self.settingscanvas = Canvas(master,bg="yellow",highlightthickness=0)
main.title('Python Modbus Monitor')
main.minsize(width=550, height=450)
main.geometry("550x550") ## scale window a bit bigger for more data lines
self.settingscanvas = Canvas(main,bg="yellow",highlightthickness=0)
self.settingscanvas.pack(side='top',anchor='nw',expand=False,fill='x')

## make the contents of settingscanvas fit the window width
Expand All @@ -463,7 +463,7 @@ def __init__(self,master):
controlframe.grid(sticky = 'EW')

## create Menu
menubar = Menu(master)
menubar = Menu(main)
filemenu = Menu(menubar, tearoff=0)
filemenu.add_command(label='Import Configuration File…',command=self.selectImportFile)
filemenu.add_command(label='Export Configuration File…',command=self.selectExportFile)
Expand All @@ -481,7 +481,7 @@ def __init__(self,master):
menubar.add_cascade(label='File', menu=filemenu)
menubar.add_cascade(label='Tools', menu=toolmenu)
menubar.add_cascade(label='Help', menu=helpmenu)
master.config(menu=menubar)
main.config(menu=menubar)

## add GUI elements

Expand Down Expand Up @@ -580,7 +580,7 @@ def __init__(self,master):
self.checkManageData.grid(row=3,column=0,columnspan=3)

## canvas for displaying monitored data
self.datacanvas = Canvas(master,bd=1,bg="green",highlightthickness=0)
self.datacanvas = Canvas(main,bd=1,bg="green",highlightthickness=0)
self.datacanvas.pack(anchor='sw',side='top',expand=True,fill='both')
## frame that holds all data to display. the static data table and the polled data
self.dataframe = Frame(self.datacanvas)
Expand Down Expand Up @@ -876,7 +876,7 @@ def addNewDataset(self):
#
def aboutDialog(self):
showinfo('About Python Modbus Monitor'\
,'This is a program that acts as a modbus slave to receive data from modbus masters like SMA solar inverters. \nYou can choose the data to be received via the GUI and see the live data. \nYou can also call the programm from the command line with a configuration file given for the data to be retrieved. \nThe configuration file can be generated using the GUI command \"File\"→\"Export Configuration\"')
,'This is a program that acts as a modbus subordinate to receive data from modbus mains like SMA solar inverters. \nYou can choose the data to be received via the GUI and see the live data. \nYou can also call the programm from the command line with a configuration file given for the data to be retrieved. \nThe configuration file can be generated using the GUI command \"File\"→\"Export Configuration\"')

## function for closing the program window
#
Expand Down
20 changes: 10 additions & 10 deletions pymodmon_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## @package pymodmon
# Python Modbus Monitor
# a small program that uses the pymodbus package to retrieve and
# display modbus slave data.
# display modbus subordinate data.
# requires: Python 3.7, pymodbus, docopt
#
# Date created: 2019-02-25
Expand Down Expand Up @@ -438,13 +438,13 @@ def printConfig(self):
## class that contains all GUI specifics
#
class Gui:
def __init__(self,master):
def __init__(self,main):

## configure app window
master.title('Python Modbus Monitor')
master.minsize(width=550, height=450)
master.geometry("550x550") ## scale window a bit bigger for more data lines
self.settingscanvas = Canvas(master,bg="yellow",highlightthickness=0)
main.title('Python Modbus Monitor')
main.minsize(width=550, height=450)
main.geometry("550x550") ## scale window a bit bigger for more data lines
self.settingscanvas = Canvas(main,bg="yellow",highlightthickness=0)
self.settingscanvas.pack(side='top',anchor='nw',expand=False,fill='x')

## make the contents of settingscanvas fit the window width
Expand All @@ -466,7 +466,7 @@ def __init__(self,master):
controlframe.grid(sticky = 'EW')

## create Menu
menubar = Menu(master)
menubar = Menu(main)
filemenu = Menu(menubar, tearoff=0)
filemenu.add_command(label='Import Configuration File…',command=self.selectImportFile)
filemenu.add_command(label='Export Configuration File…',command=self.selectExportFile)
Expand All @@ -484,7 +484,7 @@ def __init__(self,master):
menubar.add_cascade(label='File', menu=filemenu)
menubar.add_cascade(label='Tools', menu=toolmenu)
menubar.add_cascade(label='Help', menu=helpmenu)
master.config(menu=menubar)
main.config(menu=menubar)

## add GUI elements

Expand Down Expand Up @@ -583,7 +583,7 @@ def __init__(self,master):
self.checkManageData.grid(row=3,column=0,columnspan=3)

## canvas for displaying monitored data
self.datacanvas = Canvas(master,bd=1,bg="green",highlightthickness=0)
self.datacanvas = Canvas(main,bd=1,bg="green",highlightthickness=0)
self.datacanvas.pack(anchor='sw',side='top',expand=True,fill='both')
## frame that holds all data to display. the static data table and the polled data
self.dataframe = Frame(self.datacanvas)
Expand Down Expand Up @@ -879,7 +879,7 @@ def addNewDataset(self):
#
def aboutDialog(self):
messagebox.showinfo('About Python Modbus Monitor'\
,'This is a program that acts as a modbus slave to receive data from modbus masters like SMA solar inverters. \nYou can choose the data to be received via the GUI and see the live data. \nYou can also call the programm from the command line with a configuration file given for the data to be retrieved. \nThe configuration file can be generated using the GUI command \"File\"→\"Export Configuration\"')
,'This is a program that acts as a modbus subordinate to receive data from modbus mains like SMA solar inverters. \nYou can choose the data to be received via the GUI and see the live data. \nYou can also call the programm from the command line with a configuration file given for the data to be retrieved. \nThe configuration file can be generated using the GUI command \"File\"→\"Export Configuration\"')

## function for closing the program window
#
Expand Down