Skip to content

Commit

Permalink
GUI_V0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
user committed Feb 3, 2023
1 parent b52c834 commit 94a2b34
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 9 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
# Source-Meter-PyMeasure
Keithley SourceMeter using PyMeasure

- `console_user_interface.py` is the initial program
- `current_to_voltage.py` apples a Current and measures a Voltage
- `voltage_to_current.py` apples a Voltage and measures a Current

Additional there are some draft/test codes ignore them.
31 changes: 22 additions & 9 deletions console_user_interface.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,36 @@
import tkinter as tk


class MyGUI:
def __init__ (self):
fields = ['Text Label 1', 'Text Label 2']

self.root = tk.Tk()
self.root.geometry("1500x600")
self.root.title("Keithley Console")

self.label = tk.Label(self.root, text="Insert the Keithley2400 Parameters", font=('Arial', 16))
self.label.pack(padx=50, pady=20)
row_num = 0
# this will create a label widget
self.label_1 = tk.Label(self.root, text="Label 1", font=('Arial', 16))
# grid method to arrange label respective to row number
self.label_1.grid(row = row_num, column = 0, sticky = tk.W, pady = 2)
# entry widgets, used to take the entry
self.entry_1 = tk.Entry(self.root)
# this will arrange entry widget respective to row number
self.entry_1.grid(row = row_num, column = 1, pady = 2)

self.myentry = tk.Entry(self.root)
self.myentry.pack()

self.button = tk.Button(self.root, text="Start Measure", font=('Arial', 16), command=self.start_keithley)
self.button.pack(padx=50, pady=20)
row_num = 1
# this will create a label widget
self.label_2 = tk.Label(self.root, text="Label 2", font=('Arial', 16))
# grid method to arrange label respective to row number
self.label_2.grid(row = row_num, column = 0, sticky = tk.W, pady = 2)
# entry widgets, used to take the entry
self.entry_2 = tk.Entry(self.root)
# this will arrange entry widget respective to row number
self.entry_2.grid(row = row_num, column = 1, pady = 2)

self.root.mainloop()

def start_keithley(self):
print("Keithley Starts..")
self.root.mainloop()

MyGUI()
File renamed without changes.
File renamed without changes.
11 changes: 11 additions & 0 deletions test_code_arrays.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import numpy as np

min_voltage = 10
max_voltage = 10
data_points = 10
voltages = np.linspace(min_voltage, max_voltage, num=data_points)
currents = np.zeros_like(voltages)
current_stds = np.zeros_like(voltages)
print("Init Voltages:",voltages)
print("Init Currents:",currents)
print("Init stds Currents:",current_stds)
28 changes: 28 additions & 0 deletions test_code_tkinter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import tkinter as tk


class MyGUI:
def __init__ (self):

self.root = tk.Tk()
self.root.geometry("1500x600")
self.root.title("Keithley Console")

self.label = tk.Label(self.root, text="Insert the Keithley2400 Parameters", font=('Arial', 16))
self.label.pack(padx=50, pady=20)

self.myentry = tk.Entry(self.root)
self.myentry.pack()

self.button = tk.Button(self.root, text="Start Measure", font=('Arial', 16), command=self.start_keithley)
self.button.pack(padx=50, pady=20)

self.root.mainloop()

def start_keithley(self):
print("Keithley Starts..")
entry_string = self.myentry.get()
print(entry_string)
self.label.configure(text=entry_string)

MyGUI()
File renamed without changes.

0 comments on commit 94a2b34

Please sign in to comment.