Skip to content

Commit

Permalink
added config file to store info such as version number, added automat…
Browse files Browse the repository at this point in the history
…ically changing version number to header
  • Loading branch information
JymBone5 committed Jul 18, 2024
1 parent e101546 commit f583b1c
Show file tree
Hide file tree
Showing 17 changed files with 58 additions and 23 deletions.
4 changes: 4 additions & 0 deletions app/SiEPIC_TestCreator/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

class MYAPP:
version = '0.1.16'
pypi_token = 'pypi-AgEIcHlwaS5vcmcCJGU5ZWI5NWZiLTIzODUtNDMyNi05NGQ3LWNhZWU5NWI3ZWYzMwACGlsxLFsic2llcGljLXRlc3RjcmVhdG9yIl1dAAIsWzIsWyIzNDFlYzM3OC1jYmE2LTQxMzYtYjhhZi1mN2U4ZDE5MjEzNjAiXV0AAAYgsgF4EVG7qeB7ED0QsM1jeZxjHJxBEGU39NHJaAlyQZk'
23 changes: 21 additions & 2 deletions app/SiEPIC_TestCreator/sequencecreator.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
QMessageBox,
QCheckBox,
QComboBox,
QSpacerItem,
QSizePolicy
)
from PyQt5.QtCore import Qt, pyqtSignal, QObject
from PyQt5.QtWidgets import QLabel, QLineEdit, QVBoxLayout, QWidget, QFormLayout
Expand All @@ -30,6 +32,7 @@
from watchdog.events import FileSystemEventHandler
import logging
from SiEPIC_TestCreator.yamlcheck import yaml_check
from SiEPIC_TestCreator.config import MYAPP

def launch():
app = QApplication([])
Expand All @@ -39,7 +42,7 @@ def launch():
class GUI(QWidget):
def __init__(self):
super().__init__()
self.setWindowTitle("SiEPIC TestCreator")
self.setWindowTitle("SiEPIC TestCreator" + ' (' + str(MYAPP.version) + ')')
self.custom_sequences_store = dict()
self.branch = 'IDA'
self.runtime_max = 100000
Expand Down Expand Up @@ -71,8 +74,15 @@ def __init__(self):

def setup_outputlog(self):
# Set up the output log
horlayout = QHBoxLayout()
self.outputtitle = QLabel("Output Log")
self.layout.addWidget(self.outputtitle)
self.clear_output_btn = QPushButton("Clear Output Log")

horlayout.addWidget(self.outputtitle)
horlayout.addItem(QSpacerItem(20, 40, QSizePolicy.Expanding, QSizePolicy.Minimum))
horlayout.addWidget(self.clear_output_btn)

self.layout.addLayout(horlayout)

# Log Viewer

Expand Down Expand Up @@ -106,6 +116,15 @@ def setup_outputlog(self):

# self.layout.addWidget(self.textEdit)

self.clear_output_btn.clicked.connect(self.clear_output_log)

def clear_output_log(self):
# Get the underlying QTextEdit widget from the QTextEditLogger
log_text_edit = self.logTextBox.widget

# Clear the contents of the QTextEdit
log_text_edit.clear()

def setup_file_selection(self):
self.file_title = QLabel("Upload coordinates file or Yaml file")
self.file_label = QLineEdit("No file selected")
Expand Down
2 changes: 1 addition & 1 deletion app/SiEPIC_TestCreator/sequences/DREAM/current_sweep.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from siepic_testcreator.sequences.core.smu_sweep import SmuSweep
from SiEPIC_TestCreator.sequences.core.smu_sweep import SmuSweep

class CurrentSweep(SmuSweep):
"""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from siepic_testcreator.sequences.core.laser_sweep import LaserSweep
from SiEPIC_TestCreator.sequences.core.laser_sweep import LaserSweep

class SetCurrentWavelengthSweep(LaserSweep):
"""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from siepic_testcreator.sequences.core.laser_sweep import LaserSweep
from SiEPIC_TestCreator.sequences.core.laser_sweep import LaserSweep

class SetVoltageWavelengthSweep(LaserSweep):
"""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from siepic_testcreator.sequences.core.smu_sweep import SmuSweep
from SiEPIC_TestCreator.sequences.core.smu_sweep import SmuSweep
import time

class SetWavelengthCurrentSweep(SmuSweep):
"""
Expand Down Expand Up @@ -40,9 +41,18 @@ def __init__(self, ps):
'Sweeptype': 'current',
'Sweeptype_info': 'Please enter sweep type',
'Sweeptype_options': ['current'],
'Upper Limit': 5,
'Upper Limit_info': 'Please enter upper limit value',
'Upper Limit_bounds': [0, 100],
'Trans_col': False,
'Trans_col_info': 'Please enter trans_col value',
'Trans_col_options': ['True', 'False'],
'Wavelengths': [1480, 1500, 1580],
'Wavelengths_info': 'Please enter wavelengths value',
'Wavelengths_bounds': [[1270, 1480], [1350, 1580]]
'Wavelengths_bounds': [[1270, 1480], [1350, 1580]],
'Power': 1,
'Power_info': 'Please enter power (dBm) value',
'Power_bounds': [-70, 100]
}
self.results_info = {
'num_plots': 1,
Expand All @@ -62,22 +72,23 @@ def __init__(self, ps):
'pkl': False
}

super().__init__(variable=self.variables, resultsinfo=self.resultsinfo, type='current', ps=ps)
super().__init__(variables=self.variables, resultsinfo=self.resultsinfo, sweeptype='current', ps=ps)

def run(self, routine=False):
self.set_results(variables=self.variables, resultsinfo = self.resultsinfo, routine=routine)

settings = self.ps.get_settings(self.verbose)

for wav in self.wavelengths:
for wav in self.variables['wavelengths']:
self.ps.optprobe.laser.set_wavl(wav)
self.ps.optprobe.laser.set_pwr_unit('dBm')
self.ps.optprobe.laser.set_pwr(self.pwr)
self.ps.optprobe.laser.set_pwr(self.variables['pwr'])
self.ps.optprobe.laser.set_pwr_unit('mW')
self.ps.optprobe.laser.set_output(True)
time.sleep(3)

self.execute()

self.tls.set_output(False)
self.ps.optprobe.laser.set_output(False)

self.ps.set_settings(settings)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from siepic_testcreator.sequences.core.smu_sweep import SmuSweep
from SiEPIC_TestCreator.sequences.core.smu_sweep import SmuSweep
import time

class SetWavelengthVoltageSweep(SmuSweep):
Expand Down
2 changes: 1 addition & 1 deletion app/SiEPIC_TestCreator/sequences/DREAM/voltage_sweep.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from siepic_testcreator.sequences.core.smu_sweep import SmuSweep
from SiEPIC_TestCreator.sequences.core.smu_sweep import SmuSweep

class VoltageSweep(SmuSweep):
"""
Expand Down
2 changes: 1 addition & 1 deletion app/SiEPIC_TestCreator/sequences/DREAM/wavelength_sweep.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from siepic_testcreator.sequences.core.laser_sweep import LaserSweep
from SiEPIC_TestCreator.sequences.core.laser_sweep import LaserSweep

class WavelengthSweep(LaserSweep):
"""
Expand Down
2 changes: 1 addition & 1 deletion app/SiEPIC_TestCreator/sequences/IDA/current_sweep_ida.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from siepic_testcreator.sequences.core.smu_sweep import SmuSweep
from SiEPIC_TestCreator.sequences.core.smu_sweep import SmuSweep

class CurrentSweepIda(SmuSweep):
"""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from siepic_testcreator.sequences.core.laser_sweep import LaserSweep
from SiEPIC_TestCreator.sequences.core.laser_sweep import LaserSweep

class SetCurrentWavelengthSweepIda(LaserSweep):
"""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from siepic_testcreator.sequences.core.laser_sweep import LaserSweep
from SiEPIC_TestCreator.sequences.core.laser_sweep import LaserSweep

class SetVoltageWavelengthSweepIda(LaserSweep):
"""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from siepic_testcreator.sequences.core.smu_sweep import SmuSweep
from SiEPIC_TestCreator.sequences.core.smu_sweep import SmuSweep

class SetWavelengthCurrentSweepIda(SmuSweep):
"""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from siepic_testcreator.sequences.core.smu_sweep import SmuSweep
from SiEPIC_TestCreator.sequences.core.smu_sweep import SmuSweep
import time

class SetWavelengthVoltageSweepIda(SmuSweep):
Expand Down
2 changes: 1 addition & 1 deletion app/SiEPIC_TestCreator/sequences/IDA/voltage_sweep_ida.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from siepic_testcreator.sequences.core.smu_sweep import SmuSweep
from SiEPIC_TestCreator.sequences.core.smu_sweep import SmuSweep

class VoltageSweepIda(SmuSweep):
"""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from siepic_testcreator.sequences.core.laser_sweep import LaserSweep
from SiEPIC_TestCreator.sequences.core.laser_sweep import LaserSweep

class WavelengthSweepIda(LaserSweep):
"""
Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
from setuptools import find_packages, setup
from app.SiEPIC_TestCreator.config import MYAPP

with open("app/README.md", "r") as f:
long_description = f.read()


setup(
name = "SiEPIC_TestCreator",
version = "0.1.8",
version = MYAPP.version,
description = "A tool for creating YAML files for use in Dream Photonics and edx course",
package_dir = {"": "app"},
packages = find_packages(where="app"),
entry_points={
'console_scripts': [
'siepic_testcreator=siepic_testcreator.__main__:main'
'siepic_testcreator=SiEPIC_TestCreator.__main__:main'
]
},
long_description = long_description,
Expand Down

0 comments on commit f583b1c

Please sign in to comment.