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
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ pillow==10.4.0
pycodestyle==2.5.0
pyflakes==2.1.1
pyparsing==3.1.4
PyQt5==5.15.7
PyQt5-Qt5==5.15.17
PyQt5_sip==12.15.0
PyQt6>=6.5.0
PyQt6-Qt6>=6.5.0
PyQt6-sip>=13.5.0
python-dateutil==2.9.0.post0
scipy==1.10.1
six==1.17.0
Expand Down
2 changes: 1 addition & 1 deletion src/browser/UserManual.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from PyQt5 import QtWidgets
from PyQt6 import QtWidgets
import subprocess
import os

Expand Down
4 changes: 2 additions & 2 deletions src/browser/Welcome.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from PyQt5 import QtCore, QtWidgets
from PyQt6 import QtCore, QtWidgets
import os


Expand All @@ -21,7 +21,7 @@ def __init__(self):
init_path + "library/browser/welcome.html")
)
self.browser.setOpenExternalLinks(True)
self.browser.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
self.browser.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarPolicy.ScrollBarAlwaysOff)

self.vlayout.addWidget(self.browser)
self.setLayout(self.vlayout)
Expand Down
2 changes: 1 addition & 1 deletion src/configuration/Appconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# REVISION: Thursday 29 June 2023
# =========================================================================

from PyQt5 import QtWidgets
from PyQt6 import QtWidgets
import os
import json
from configparser import ConfigParser
Expand Down
28 changes: 14 additions & 14 deletions src/converter/LtspiceLibConverter.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os
import subprocess
from PyQt5.QtWidgets import QMessageBox
from PyQt6.QtWidgets import QMessageBox

class LTspiceLibConverter:
def __init__(self, parent):
Expand Down Expand Up @@ -38,7 +38,7 @@ def convert(self, file_path):

# Message box with the conversion success message
msg_box = QMessageBox()
msg_box.setIcon(QMessageBox.Information)
msg_box.setIcon(QMessageBox.Icon.Information)
msg_box.setWindowTitle("Conversion Successful")
msg_box.setText("The file has been converted successfully.")
msg_box.exec()
Expand All @@ -50,44 +50,44 @@ def convert(self, file_path):
print("File is empty. Cannot perform conversion.")
# A message box indicating that the file is empty
msg_box = QMessageBox()
msg_box.setIcon(QMessageBox.Warning)
msg_box.setIcon(QMessageBox.Icon.Warning)
msg_box.setWindowTitle("Empty File")
msg_box.setText("The selected file is empty. Conversion cannot be performed.")
msg_box.setStandardButtons(QMessageBox.Ok)
msg_box.exec_()
msg_box.setStandardButtons(QMessageBox.StandardButton.Ok)
msg_box.exec()

def upload_file_LTspice(self, file_path):
if file_path:
# Check if the file path contains spaces
if ' ' in file_path:
# Show a message box indicating that spaces are not allowed
msg_box = QMessageBox()
msg_box.setIcon(QMessageBox.Warning)
msg_box.setIcon(QMessageBox.Icon.Warning)
msg_box.setWindowTitle("Invalid File Path")
msg_box.setText("Spaces are not allowed in the file path.")
msg_box.setStandardButtons(QMessageBox.Ok)
msg_box.exec_()
msg_box.setStandardButtons(QMessageBox.StandardButton.Ok)
msg_box.exec()
return

if ".asy" in file_path:
print(file_path)
self.convert(file_path)
else:
msg_box = QMessageBox()
msg_box.setIcon(QMessageBox.Warning)
msg_box.setIcon(QMessageBox.Icon.Warning)
msg_box.setWindowTitle("Invalid File Path")
msg_box.setText("Only .asy file can be converted.")
msg_box.setStandardButtons(QMessageBox.Ok)
msg_box.exec_()
msg_box.setStandardButtons(QMessageBox.StandardButton.Ok)
msg_box.exec()
return

else:
print("No file selected.")

# Message box indicating that no file is selected
msg_box = QMessageBox()
msg_box.setIcon(QMessageBox.Warning)
msg_box.setIcon(QMessageBox.Icon.Warning)
msg_box.setWindowTitle("No File Selected")
msg_box.setText("Please select a file before uploading.")
msg_box.setStandardButtons(QMessageBox.Ok)
msg_box.exec_()
msg_box.setStandardButtons(QMessageBox.StandardButton.Ok)
msg_box.exec()
4 changes: 2 additions & 2 deletions src/converter/browseSchematic.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from PyQt5.QtWidgets import QFileDialog
from PyQt6.QtWidgets import QFileDialog

def browse_path(self, text_box):
file_dialog = QFileDialog() # a dialog that allows the user to select files or directories
file_dialog.setFileMode(QFileDialog.AnyFile)
file_dialog.setNameFilter("Supported Files (*.sch *.asc *.slb *.asy);;ASY Files (*.asy)") # Include all supported extensions
file_dialog.exec_() # Execute the dialog
file_dialog.exec() # Execute the dialog

selected_files = file_dialog.selectedFiles() # Get the selected file(s)
if selected_files:
Expand Down
28 changes: 14 additions & 14 deletions src/converter/libConverter.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os
import subprocess
from PyQt5.QtWidgets import QMessageBox
from PyQt6.QtWidgets import QMessageBox

class PspiceLibConverter:
def __init__(self, parent):
Expand Down Expand Up @@ -34,7 +34,7 @@ def convert(self, file_path):
subprocess.run(command, check=True, cwd=parser_path)
# Message box with the conversion success message
msg_box = QMessageBox()
msg_box.setIcon(QMessageBox.Information)
msg_box.setIcon(QMessageBox.Icon.Information)
msg_box.setWindowTitle("Conversion Successful")
msg_box.setText("The file has been converted successfully.")
msg_box.exec()
Expand All @@ -46,44 +46,44 @@ def convert(self, file_path):
print("File is empty. Cannot perform conversion.")
# A message box indicating that the file is empty
msg_box = QMessageBox()
msg_box.setIcon(QMessageBox.Warning)
msg_box.setIcon(QMessageBox.Icon.Warning)
msg_box.setWindowTitle("Empty File")
msg_box.setText("The selected file is empty. Conversion cannot be performed.")
msg_box.setStandardButtons(QMessageBox.Ok)
msg_box.exec_()
msg_box.setStandardButtons(QMessageBox.StandardButton.Ok)
msg_box.exec()

def upload_file_Pspice(self, file_path):
if file_path:
# Check if the file path contains spaces
if ' ' in file_path:
# Show a message box indicating that spaces are not allowed
msg_box = QMessageBox()
msg_box.setIcon(QMessageBox.Warning)
msg_box.setIcon(QMessageBox.Icon.Warning)
msg_box.setWindowTitle("Invalid File Path")
msg_box.setText("Spaces are not allowed in the file path.")
msg_box.setStandardButtons(QMessageBox.Ok)
msg_box.exec_()
msg_box.setStandardButtons(QMessageBox.StandardButton.Ok)
msg_box.exec()
return

if ".slb" in file_path:
print(file_path)
self.convert(file_path)
else:
msg_box = QMessageBox()
msg_box.setIcon(QMessageBox.Warning)
msg_box.setIcon(QMessageBox.Icon.Warning)
msg_box.setWindowTitle("Invalid File Path")
msg_box.setText("Only .slb file can be converted.")
msg_box.setStandardButtons(QMessageBox.Ok)
msg_box.exec_()
msg_box.setStandardButtons(QMessageBox.StandardButton.Ok)
msg_box.exec()
return

else:
print("No file selected.")

# Message box indicating that no file is selected
msg_box = QMessageBox()
msg_box.setIcon(QMessageBox.Warning)
msg_box.setIcon(QMessageBox.Icon.Warning)
msg_box.setWindowTitle("No File Selected")
msg_box.setText("Please select a file before uploading.")
msg_box.setStandardButtons(QMessageBox.Ok)
msg_box.exec_()
msg_box.setStandardButtons(QMessageBox.StandardButton.Ok)
msg_box.exec()
30 changes: 15 additions & 15 deletions src/converter/ltspiceToKicad.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import subprocess
import shutil
from PyQt5.QtWidgets import QMessageBox
from PyQt6.QtWidgets import QMessageBox

class LTspiceConverter:
def __init__(self, parent):
Expand Down Expand Up @@ -50,7 +50,7 @@ def convert(self, file_path):
subprocess.run(command, check=True, cwd=conPath)
# Message box with the conversion success message
msg_box = QMessageBox()
msg_box.setIcon(QMessageBox.Information)
msg_box.setIcon(QMessageBox.Icon.Information)
msg_box.setWindowTitle("Conversion Successful")
newFile = str(conPath + "/LTspice_" + filename)
workspace_directory = self.get_workspace_directory()
Expand All @@ -61,7 +61,7 @@ def convert(self, file_path):
print("File added under the project explorer.")
else:
print("Workspace directory not found.")
result = msg_box.exec_()
result = msg_box.exec()
print("Conversion of LTspice to eSim schematic Successful")


Expand All @@ -71,47 +71,47 @@ def convert(self, file_path):
print("File is empty. Cannot perform conversion.")
# A message box indicating that the file is empty
msg_box = QMessageBox()
msg_box.setIcon(QMessageBox.Warning)
msg_box.setIcon(QMessageBox.Icon.Warning)
msg_box.setWindowTitle("Empty File")
msg_box.setText("The selected file is empty. Conversion cannot be performed.")
msg_box.setStandardButtons(QMessageBox.Ok)
msg_box.exec_()
msg_box.setStandardButtons(QMessageBox.StandardButton.Ok)
msg_box.exec()

def upload_file_LTspice(self, file_path):
if file_path:
# Check if the file path contains spaces
if ' ' in file_path:
# Show a message box indicating that spaces are not allowed
msg_box = QMessageBox()
msg_box.setIcon(QMessageBox.Warning)
msg_box.setIcon(QMessageBox.Icon.Warning)
msg_box.setWindowTitle("Invalid File Path")
msg_box.setText("Spaces are not allowed in the file path.")
msg_box.setStandardButtons(QMessageBox.Ok)
msg_box.exec_()
msg_box.setStandardButtons(QMessageBox.StandardButton.Ok)
msg_box.exec()
return

if ".asc" in file_path:
print(file_path)
self.convert(file_path)
else:
msg_box = QMessageBox()
msg_box.setIcon(QMessageBox.Warning)
msg_box.setIcon(QMessageBox.Icon.Warning)
msg_box.setWindowTitle("Invalid File Path")
msg_box.setText("Only .asc file can be converted.")
msg_box.setStandardButtons(QMessageBox.Ok)
msg_box.exec_()
msg_box.setStandardButtons(QMessageBox.StandardButton.Ok)
msg_box.exec()
return

else:
print("No file selected.")

# Message box indicating that no file is selected
msg_box = QMessageBox()
msg_box.setIcon(QMessageBox.Warning)
msg_box.setIcon(QMessageBox.Icon.Warning)
msg_box.setWindowTitle("No File Selected")
msg_box.setText("Please select a file before uploading.")
msg_box.setStandardButtons(QMessageBox.Ok)
msg_box.exec_()
msg_box.setStandardButtons(QMessageBox.StandardButton.Ok)
msg_box.exec()

def find_workspace_directory(target_directory_name):
for root, dirs, files in os.walk("/"):
Expand Down
30 changes: 15 additions & 15 deletions src/converter/pspiceToKicad.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import subprocess
import shutil
from PyQt5.QtWidgets import QMessageBox
from PyQt6.QtWidgets import QMessageBox
from frontEnd import ProjectExplorer

class PspiceConverter:
Expand Down Expand Up @@ -44,7 +44,7 @@ def convert(self, file_path):
subprocess.run(command, shell=True, check=True)
# Message box with the conversion success message
msg_box = QMessageBox()
msg_box.setIcon(QMessageBox.Information)
msg_box.setIcon(QMessageBox.Icon.Information)
msg_box.setWindowTitle("Conversion Successful")
newFile = str(conPath + "/" + filename)
workspace_directory = self.get_workspace_directory()
Expand All @@ -57,7 +57,7 @@ def convert(self, file_path):
print("File added under the project explorer.")
else:
print("Workspace directory not found.")
result = msg_box.exec_()
result = msg_box.exec()
print("Conversion of Pspice to eSim schematic Successful")

except subprocess.CalledProcessError as e:
Expand All @@ -66,47 +66,47 @@ def convert(self, file_path):
print("File is empty. Cannot perform conversion.")
# A message box indicating that the file is empty
msg_box = QMessageBox()
msg_box.setIcon(QMessageBox.Warning)
msg_box.setIcon(QMessageBox.Icon.Warning)
msg_box.setWindowTitle("Empty File")
msg_box.setText("The selected file is empty. Conversion cannot be performed.")
msg_box.setStandardButtons(QMessageBox.Ok)
msg_box.exec_()
msg_box.setStandardButtons(QMessageBox.StandardButton.Ok)
msg_box.exec()

def upload_file_Pspice(self, file_path):
if file_path:
# Check if the file path contains spaces
if ' ' in file_path:
# Show a message box indicating that spaces are not allowed
msg_box = QMessageBox()
msg_box.setIcon(QMessageBox.Warning)
msg_box.setIcon(QMessageBox.Icon.Warning)
msg_box.setWindowTitle("Invalid File Path")
msg_box.setText("Spaces are not allowed in the file path.")
msg_box.setStandardButtons(QMessageBox.Ok)
msg_box.exec_()
msg_box.setStandardButtons(QMessageBox.StandardButton.Ok)
msg_box.exec()
return

if ".sch" in file_path:
print(file_path)
self.convert(file_path)
else:
msg_box = QMessageBox()
msg_box.setIcon(QMessageBox.Warning)
msg_box.setIcon(QMessageBox.Icon.Warning)
msg_box.setWindowTitle("Invalid File Path")
msg_box.setText("Only .sch file can be converted.")
msg_box.setStandardButtons(QMessageBox.Ok)
msg_box.exec_()
msg_box.setStandardButtons(QMessageBox.StandardButton.Ok)
msg_box.exec()
return

else:
print("No file selected.")

# Message box indicating that no file is selected
msg_box = QMessageBox()
msg_box.setIcon(QMessageBox.Warning)
msg_box.setIcon(QMessageBox.Icon.Warning)
msg_box.setWindowTitle("No File Selected")
msg_box.setText("Please select a file before uploading.")
msg_box.setStandardButtons(QMessageBox.Ok)
msg_box.exec_()
msg_box.setStandardButtons(QMessageBox.StandardButton.Ok)
msg_box.exec()

def merge_copytree(src, dst, filename):
if not os.path.exists(dst):
Expand Down
Loading