Skip to content

Commit 2a8eda8

Browse files
LOGO added
1 parent 14931db commit 2a8eda8

3 files changed

Lines changed: 36 additions & 12 deletions

File tree

Keithley_2400_Keithley_2182/IV_Sweep_Keithley_2182_Frontend_V1.py

Whitespace-only changes.

Keithley_2400_Keithley_2182/IV_Sweep_Keithley_2400_2182_Frontend_V1.py

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -------------------------------------------------------------------------------
22
# Name: IV Sweep GUI for Keithley 2400/2182
3-
# Purpose: Provide a professional GUI for performing IV sweeps using a
3+
# Purpose: Provide a professional GUI for performing I-V sweeps using a
44
# Keithley 2400 as a current source and a Keithley 2182
55
# as a nanovoltmeter.
66
# Author: Prathamesh Deshmukh
@@ -9,7 +9,7 @@
99
# -------------------------------------------------------------------------------
1010

1111
# --- GUI and Plotting Packages ---
12-
import tkinter as tk
12+
import tkinter as tk; from tkinter import Canvas
1313
from tkinter import ttk, filedialog, messagebox, scrolledtext
1414
import numpy as np
1515
import os
@@ -21,6 +21,13 @@
2121
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
2222
import matplotlib as mpl
2323

24+
# --- Pillow for Logo Image ---
25+
try:
26+
from PIL import Image, ImageTk
27+
PIL_AVAILABLE = True
28+
except ImportError:
29+
PIL_AVAILABLE = False
30+
2431
# --- Instrument Control Packages ---
2532
try:
2633
import pyvisa
@@ -95,20 +102,21 @@ def shutdown(self):
95102
# --- FRONT END (GUI) ---
96103
# -------------------------------------------------------------------------------
97104
class IV_GUI:
98-
PROGRAM_VERSION = "1.0"
105+
PROGRAM_VERSION = "1.1"
99106
CLR_BG = '#2B3D4F'; CLR_HEADER = '#3A506B'; CLR_FG = '#EDF2F4'
100107
CLR_FRAME_BG = '#3A506B'; CLR_INPUT_BG = '#4C566A'
101108
CLR_ACCENT_GREEN, CLR_ACCENT_RED, CLR_ACCENT_BLUE = '#A7C957', '#E74C3C', '#8D99AE'
102109
CLR_ACCENT_GOLD = '#FFC107'; CLR_CONSOLE_BG = '#1E2B38'
103110
FONT_BASE = ('Segoe UI', 11); FONT_TITLE = ('Segoe UI', 13, 'bold')
104-
111+
105112
def __init__(self, root):
106113
self.root = root
107114
self.root.title("I-V Sweep (K2400 + K2182)")
108115
self.root.geometry("1600x950")
109116
self.root.minsize(1400, 800)
110117
self.root.configure(bg=self.CLR_BG)
111118
self.is_running = False
119+
self.logo_image = None
112120
self.backend = IV_Backend()
113121
self.data_storage = {'current': [], 'voltage': []}
114122
self.setup_styles()
@@ -140,10 +148,31 @@ def create_widgets(self):
140148
right_panel = self._create_right_panel(main_pane); main_pane.add(right_panel, weight=3)
141149

142150
def _create_left_panel(self, parent):
143-
panel = ttk.Frame(parent, padding=5); panel.grid_columnconfigure(0, weight=1); panel.grid_rowconfigure(2, weight=1)
144-
self._create_params_panel(panel, 0); self._create_control_panel(panel, 1); self._create_console_panel(panel, 2)
151+
panel = ttk.Frame(parent, padding=5); panel.grid_columnconfigure(0, weight=1); panel.grid_rowconfigure(3, weight=1)
152+
self._create_info_panel(panel, 0)
153+
self._create_params_panel(panel, 1); self._create_control_panel(panel, 2); self._create_console_panel(panel, 3)
145154
return panel
146155

156+
def _create_info_panel(self, parent, grid_row):
157+
frame = ttk.LabelFrame(parent, text='Information'); frame.grid(row=grid_row, column=0, sticky='new', pady=5)
158+
frame.grid_columnconfigure(1, weight=1)
159+
logo_canvas = Canvas(frame, width=80, height=80, bg=self.CLR_FRAME_BG, highlightthickness=0)
160+
logo_canvas.grid(row=0, column=0, rowspan=2, padx=10, pady=10)
161+
try:
162+
script_dir = os.path.dirname(os.path.abspath(__file__))
163+
logo_path = os.path.join(script_dir, "..", "_assets", "LOGO", "UGC_DAE_CSR.jpeg")
164+
if PIL_AVAILABLE and os.path.exists(logo_path):
165+
img = Image.open(logo_path).resize((80, 80), Image.Resampling.LANCZOS)
166+
self.logo_image = ImageTk.PhotoImage(img)
167+
logo_canvas.create_image(40, 40, image=self.logo_image)
168+
except Exception as e:
169+
self.log(f"Warning: Could not load logo. {e}")
170+
171+
info_text = ("Institute: UGC DAE CSR, Mumbai\n"
172+
"Measurement: I-V Sweep (4-Probe)\n"
173+
"Instruments: K2400 & K2182")
174+
ttk.Label(frame, text=info_text, justify='left').grid(row=0, column=1, rowspan=2, sticky='w', padx=5)
175+
147176
def _create_right_panel(self, parent):
148177
panel = ttk.Frame(parent, padding=5)
149178
container = ttk.LabelFrame(panel, text='Live I-V Curve'); container.pack(fill='both', expand=True)

Keithley_2400_Keithley_2182/VT_Sweep_Keithley_2400_2182_Frontend_V1.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
# -------------------------------------------------------------------------------
22
# Name: V-T Sweep Frontend for K2400/2182 & LS350
3-
# Purpose: Provide a professional GUI for performing automated V-T sweeps.
43
# Purpose: Provide a professional GUI for performing automated V vs T sweeps.
54
# A constant current is sourced, and voltage is measured as a
65
# function of temperature.
7-
# Author: Prathamesh Deshmukh (GUI by Gemini)
6+
# Author: Prathamesh Deshmukh
87
# Created: 04/10/2025
98
# Version: 1.0
109
# -------------------------------------------------------------------------------
1110

1211
# --- GUI and Plotting Packages ---
1312
import tkinter as tk
14-
from tkinter import ttk, filedialog, messagebox, scrolledtext
1513
from tkinter import ttk, filedialog, messagebox, scrolledtext, Canvas
1614
import numpy as np
1715
import os
@@ -104,7 +102,6 @@ def shutdown(self):
104102
# --- FRONT END (GUI) ---
105103
# -------------------------------------------------------------------------------
106104
class VT_GUI:
107-
PROGRAM_VERSION = "1.0"
108105
PROGRAM_VERSION = "1.1"
109106
CLR_BG = '#2B3D4F'; CLR_HEADER = '#3A506B'; CLR_FG = '#EDF2F4'
110107
CLR_FRAME_BG = '#3A506B'; CLR_INPUT_BG = '#4C566A'
@@ -144,8 +141,6 @@ def create_widgets(self):
144141
right_panel = self._create_right_panel(main_pane); main_pane.add(right_panel, weight=3)
145142

146143
def _create_left_panel(self, parent):
147-
panel = ttk.Frame(parent, padding=5); panel.grid_columnconfigure(0, weight=1); panel.grid_rowconfigure(2, weight=1)
148-
self._create_params_panel(panel, 0); self._create_control_panel(panel, 1); self._create_console_panel(panel, 2)
149144
panel = ttk.Frame(parent, padding=5); panel.grid_columnconfigure(0, weight=1); panel.grid_rowconfigure(3, weight=1)
150145
self._create_info_panel(panel, 0)
151146
self._create_params_panel(panel, 1); self._create_control_panel(panel, 2); self._create_console_panel(panel, 3)

0 commit comments

Comments
 (0)