def __init__(self, command, projPath): QtGui.QWidget.__init__(self) self.obj_appconfig = Appconfig() self.process = QtCore.QProcess(self) self.terminal = QtGui.QWidget(self) self.layout = QtGui.QVBoxLayout(self) self.layout.addWidget(self.terminal) print "Argument to ngspice command : ", command print "\nngspice simulation starts : \n" if platform.system() == 'Linux': self.command = "cd " + projPath + " && ngspice " + command console_output = os.popen(self.command).read() self.obj_appconfig.print_info("NgSpice output: " + console_output) self.obj_appconfig.proc_dict[ self.obj_appconfig.current_project['ProjectName']].append( self.process.pid()) elif platform.system() == 'Windows': tempdir = os.getcwd() projPath = self.obj_appconfig.current_project["ProjectName"] os.chdir(projPath) self.command = "ngspice " + command self.process.start(self.command) os.chdir(tempdir) print "\n simulation finished"
def __init__(self): self.obj_appconfig = Appconfig() print "Initialization" self.data = [ ] #consists of all the columns of data belonging to nodes and branches self.y = [] #stores y-axis data self.x = [] #stores x-axis data
def __init__(self,parent=None): super(Subcircuit, self).__init__() QtGui.QWidget.__init__(self) self.obj_appconfig=Appconfig() self.obj_validation=Validation() self.obj_dockarea=parent self.layout = QtGui.QVBoxLayout() self.splitter= QtGui.QSplitter() self.splitter.setOrientation(QtCore.Qt.Vertical) self.newbtn = QtGui.QPushButton('New Subcircuit Schematic') self.newbtn.setFixedSize(200,40) self.newbtn.clicked.connect(self.newsch) self.editbtn = QtGui.QPushButton('Edit Subcircuit Schematic') self.editbtn.setFixedSize(200,40) self.editbtn.clicked.connect(self.editsch) self.convertbtn = QtGui.QPushButton('Convert Kicad to Ngspice') self.convertbtn.setFixedSize(200,40) self.convertbtn.clicked.connect(self.convertsch) self.hbox = QtGui.QHBoxLayout() self.hbox.addWidget(self.newbtn) self.hbox.addWidget(self.editbtn) self.hbox.addWidget(self.convertbtn) self.hbox.addStretch(1) self.vbox = QtGui.QVBoxLayout() self.vbox.addLayout(self.hbox) self.vbox.addStretch(1) self.setLayout(self.vbox) self.show()
def __init__(self, filecount): QtWidgets.QWidget.__init__(self) # Maker.addverilog(self) self.obj_Appconfig = Appconfig() if os.name == 'nt': self.home = os.path.join('library', 'config') else: self.home = os.path.expanduser('~') self.parser = ConfigParser() self.parser.read(os.path.join( self.home, os.path.join('.nghdl', 'config.ini'))) self.nghdl_home = self.parser.get('NGHDL', 'NGHDL_HOME') self.release_dir = self.parser.get('NGHDL', 'RELEASE') self.src_home = self.parser.get('SRC', 'SRC_HOME') self.licensefile = self.parser.get('SRC', 'LICENSE') self.digital_home = self.parser.get('NGHDL', 'DIGITAL_MODEL') self.digital_home = self.digital_home + "/Ngveri" self.count = 0 self.text = "" self.entry_var = {} self.createNgveriWidget() self.fname = "" self.filecount = filecount
def __init__(self, command, projPath): QtGui.QWidget.__init__(self) self.obj_appconfig = Appconfig() self.process = QtCore.QProcess(self) self.terminal = QtGui.QWidget(self) self.layout = QtGui.QVBoxLayout(self) self.layout.addWidget(self.terminal) print "Argument to ngspice command : ", command if platform.system() == 'Linux': self.command = "cd " + projPath + ";ngspice " + command #Creating argument for process #self.args = ['-into', str(self.terminal.winId()),'-hold','-e', self.command] self.args = ['-hold', '-e', self.command] self.process.start('xterm', self.args) self.obj_appconfig.process_obj.append(self.process) self.obj_appconfig.proc_dict[ self.obj_appconfig.current_project['ProjectName']].append( self.process.pid()) elif platform.system() == 'Windows': tempdir = os.getcwd() projPath = self.obj_appconfig.current_project["ProjectName"] os.chdir(projPath) self.command = "ngspice " + command self.process.start(self.command) os.chdir(tempdir)
def __init__(self, command, projPath): """ - Creates constructor for NgspiceWidget class. - Checks whether OS is linux or windows and creates NgSpice window accordingly. """ QtGui.QWidget.__init__(self) self.obj_appconfig = Appconfig() self.process = QtCore.QProcess(self) self.terminal = QtGui.QWidget(self) self.layout = QtGui.QVBoxLayout(self) self.layout.addWidget(self.terminal) print("Argument to ngspice command : ", command) # For Linux OS if platform.system() == 'Linux': self.command = "cd " + projPath + ";ngspice " + command # Creating argument for process self.args = ['-hold', '-e', self.command] self.process.start('xterm', self.args) self.obj_appconfig.process_obj.append(self.process) print(self.obj_appconfig.proc_dict) (self.obj_appconfig.proc_dict[ self.obj_appconfig.current_project['ProjectName']].append( self.process.pid())) # For Windows OS elif platform.system() == 'Windows': tempdir = os.getcwd() projPath = self.obj_appconfig.current_project["ProjectName"] os.chdir(projPath) self.command = "ngspice " + command self.process.start(self.command) os.chdir(tempdir)
def __init__(self,*args): """ Initialize main Application window """ #Calling __init__ of super class QtGui.QMainWindow.__init__(self,*args) #Flag for online-offline mode. Default is set offline mode. #Mode gets updated dynamically from the previous eSim session. self.online_flag = False #Creating require Object self.obj_workspace = Workspace.Workspace() self.obj_Mainview = MainView() self.obj_kicad = Kicad(self.obj_Mainview.obj_dockarea) self.obj_appconfig = Appconfig() self.obj_validation = Validation() #Initialize all widget self.setCentralWidget(self.obj_Mainview) self.initToolBar() self.setGeometry(self.obj_appconfig._app_xpos, self.obj_appconfig._app_ypos, self.obj_appconfig._app_width, self.obj_appconfig._app_heigth) self.setWindowTitle(self.obj_appconfig._APPLICATION) self.showMaximized() self.setWindowIcon(QtGui.QIcon('../../images/logo.png')) #self.show() self.systemTrayIcon = QtGui.QSystemTrayIcon(self) self.systemTrayIcon.setIcon(QtGui.QIcon('../../images/logo.png')) self.systemTrayIcon.setVisible(True)
def __init__(self, *args): """Initialize main Application window.""" # Calling __init__ of super class QtWidgets.QMainWindow.__init__(self, *args) # Flag for mode of operation. Default is set to offline mode. self.online_flag = False # Creating require Object self.obj_workspace = Workspace.Workspace() self.obj_Mainview = MainView() self.obj_kicad = Kicad(self.obj_Mainview.obj_dockarea) self.obj_appconfig = Appconfig() self.obj_validation = Validation() # Initialize all widget self.setCentralWidget(self.obj_Mainview) self.initToolBar() self.setGeometry(self.obj_appconfig._app_xpos, self.obj_appconfig._app_ypos, self.obj_appconfig._app_width, self.obj_appconfig._app_heigth) self.setWindowTitle( self.obj_appconfig._APPLICATION + "-" + self.obj_appconfig._VERSION ) self.showMaximized() self.setWindowIcon(QtGui.QIcon(init_path + 'images/logo.png')) self.systemTrayIcon = QtWidgets.QSystemTrayIcon(self) self.systemTrayIcon.setIcon(QtGui.QIcon(init_path + 'images/logo.png')) self.systemTrayIcon.setVisible(True)
def __init__(self): super(Workspace, self).__init__() self.obj_appconfig = Appconfig() #Initializing Workspace directory for project self.initWorkspace()
def __init__(self, dir=None): QtGui.QWidget.__init__(self) self.obj_validation = Validation() self.obj_appconfig = Appconfig() self.projDir = dir self.projName = os.path.basename(self.projDir) self.ngspiceNetlist = os.path.join(self.projDir, self.projName + ".cir.out") self.modelicaNetlist = os.path.join(self.projDir, self.projName + ".mo") self.map_json = Appconfig.modelica_map_json self.grid = QtGui.QGridLayout() self.FileEdit = QtGui.QLineEdit() self.FileEdit.setText(self.ngspiceNetlist) self.grid.addWidget(self.FileEdit, 0, 0) self.browsebtn = QtGui.QPushButton("Browse") self.browsebtn.clicked.connect(self.browseFile) self.grid.addWidget(self.browsebtn, 0, 1) self.convertbtn = QtGui.QPushButton("Convert") self.convertbtn.clicked.connect(self.callConverter) self.grid.addWidget(self.convertbtn, 2, 1) self.loadOMbtn = QtGui.QPushButton("Load OMEdit") self.loadOMbtn.clicked.connect(self.callOMEdit) self.grid.addWidget(self.loadOMbtn, 3, 1) # self.setGeometry(300, 300, 350, 300) self.setLayout(self.grid) self.show()
def __init__(self, *args): """ Initialize main Application window """ #Calling __init__ of super class QtGui.QMainWindow.__init__(self, *args) #Creating require Object self.obj_workspace = Workspace.Workspace() self.obj_Mainview = MainView() self.obj_kicad = Kicad(self.obj_Mainview.obj_dockarea) self.obj_appconfig = Appconfig() self.obj_validation = Validation() #Initialize all widget self.setCentralWidget(self.obj_Mainview) self.initToolBar() self.setGeometry(self.obj_appconfig._app_xpos, self.obj_appconfig._app_ypos, self.obj_appconfig._app_width, self.obj_appconfig._app_heigth) self.setWindowTitle(self.obj_appconfig._APPLICATION) self.showMaximized() self.setWindowIcon(QtGui.QIcon('res/images/logo.png')) #self.show() self.systemTrayIcon = QtGui.QSystemTrayIcon(self) self.systemTrayIcon.setIcon(QtGui.QIcon('res/images/logo.png')) self.systemTrayIcon.setVisible(True)
def call_system(self, command): procThread = Appconfig() proc = subprocess.Popen(command.split()) self.my_workers.append(proc) procThread.procThread_list.append(proc) procThread.proc_dict[procThread.current_project['ProjectName']].append( proc.pid)
def __init__(self): QtGui.QWidget.__init__(self) self.obj_appconfig = Appconfig() self.treewidget = QtGui.QTreeWidget() self.window = QtGui.QVBoxLayout() header = QtGui.QTreeWidgetItem(["Projects", "path"]) self.treewidget.setHeaderItem(header) self.treewidget.setColumnHidden(1, True) #CSS self.treewidget.setStyleSheet(" \ QTreeView { border-radius: 15px; border: 1px solid gray; padding: 5px; width: 200px; height: 150px; } \ QTreeView::branch:has-siblings:!adjoins-item { border-image: url(res/images/vline.png) 0; } \ QTreeView::branch:has-siblings:adjoins-item { border-image: url(res/images/branch-more.png) 0; } \ QTreeView::branch:!has-children:!has-siblings:adjoins-item { border-image: url(res/images/branch-end.png) 0; } \ QTreeView::branch:has-children:!has-siblings:closed, \ QTreeView::branch:closed:has-children:has-siblings { border-image: none; image: url(res/images/branch-closed.png); } \ QTreeView::branch:open:has-children:!has-siblings, \ QTreeView::branch:open:has-children:has-siblings { border-image: none; image: url(res/images/branch-open.png); } \ ") for parents, children in self.obj_appconfig.project_explorer.items(): self.addTreeNode(parents, children) self.window.addWidget(self.treewidget) self.treewidget.doubleClicked.connect(self.openProject) self.treewidget.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) self.treewidget.customContextMenuRequested.connect(self.openMenu) self.setLayout(self.window) self.show()
def __init__(self, verilogfile, refreshoption, observer): # Set the patterns for PatternMatchingEventHandler watchdog.events.PatternMatchingEventHandler.__init__( self, ignore_directories=True, case_sensitive=False) self.verilogfile = verilogfile self.refreshoption = refreshoption self.obj_Appconfig = Appconfig() self.observer = observer self.toggle = toggle(self.refreshoption)
def __init__(self): """ This method is doing following tasks: - Working as a constructor for class ProjectExplorer. - view of project explorer area. """ QtWidgets.QWidget.__init__(self) self.obj_appconfig = Appconfig() self.obj_validation = Validation() self.treewidget = QtWidgets.QTreeWidget() self.window = QtWidgets.QVBoxLayout() header = QtWidgets.QTreeWidgetItem(["Projects", "path"]) self.treewidget.setHeaderItem(header) self.treewidget.setColumnHidden(1, True) # CSS init_path = '../../' if os.name == 'nt': init_path = '' self.treewidget.setStyleSheet(" \ QTreeView { border-radius: 15px; border: 1px \ solid gray; padding: 5px; width: 200px; height: 150px; }\ QTreeView::branch:has-siblings:!adjoins-item { \ border-image: url(" + init_path + "images/vline.png) 0;} \ QTreeView::branch:has-siblings:adjoins-item { \ border-image: url(" + init_path + "images/branch-more.png) 0; } \ QTreeView::branch:!has-children:!has-siblings:adjoins-item { \ border-image: url(" + init_path + "images/branch-end.png) 0; } \ QTreeView::branch:has-children:!has-siblings:closed, \ QTreeView::branch:closed:has-children:has-siblings { \ border-image: none; \ image: url(" + init_path + "images/branch-closed.png); } \ QTreeView::branch:open:has-children:!has-siblings, \ QTreeView::branch:open:has-children:has-siblings { \ border-image: none; \ image: url(" + init_path + "images/branch-open.png); } \ ") for parents, children in list( self.obj_appconfig.project_explorer.items()): os.path.join(parents) if os.path.exists(parents): pathlist = parents.split(os.sep) parentnode = QtWidgets.QTreeWidgetItem(self.treewidget, [pathlist[-1], parents]) for files in children: QtWidgets.QTreeWidgetItem( parentnode, [files, os.path.join(parents, files)]) self.window.addWidget(self.treewidget) self.treewidget.doubleClicked.connect(self.openProject) self.treewidget.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) self.treewidget.customContextMenuRequested.connect(self.openMenu) self.setLayout(self.window) self.show()
def body(self): self.editfile = str(QtGui.QFileDialog.getExistingDirectory(None,"Open File","../SubcircuitLibrary")) if self.editfile: self.obj_Appconfig = Appconfig() self.obj_Appconfig.current_subcircuit['SubcircuitName'] = self.editfile self.schname = os.path.basename(self.editfile) self.editfile = os.path.join(self.editfile,self.schname) self.cmd = "eeschema "+self.editfile+".sch " self.obj_workThread = WorkerThread(self.cmd) self.obj_workThread.start()
def body(self): """ Open a project directory using Qt GUI and validate if .proj file present in it using `Validation` class @params @return :dirs => The directories inside the project folder :filelist => The files inside the project folder """ self.obj_Appconfig = Appconfig() self.openDir = self.obj_Appconfig.default_workspace["workspace"] self.projDir = QtGui.QFileDialog.getExistingDirectory( self, "open", self.openDir) if self.obj_validation.validateOpenproj(self.projDir): self.obj_Appconfig.current_project['ProjectName'] = str( self.projDir) if os.path.isdir(self.projDir): print("True") for dirs, subdirs, filelist in os.walk( self.obj_Appconfig.current_project["ProjectName"]): # directory = dirs # files = filelist # above 'directory' and 'files' variable never used pass self.obj_Appconfig.project_explorer[dirs] = filelist json.dump(self.obj_Appconfig.project_explorer, open(self.obj_Appconfig.dictPath["path"], 'w')) self.obj_Appconfig.print_info('Open Project called') self.obj_Appconfig.print_info('Current Project is ' + self.projDir) return dirs, filelist else: self.obj_Appconfig.print_error( "The project doesn't contain .proj file. Please select the " + "proper directory else you won't be able to perform any " + "operation") reply = QtGui.QMessageBox.critical( None, "Error Message", "<b>Error: The project doesn't contain .proj file.</b><br/>" "<b>Please select the proper project directory else you won't" " be able to perform any operation</b>", QtGui.QMessageBox.Ok | QtGui.QMessageBox.Cancel) if reply == QtGui.QMessageBox.Ok: self.body() self.obj_Appconfig.print_info('Open Project called') self.obj_Appconfig.print_info('Current Project is ' + self.projDir) elif reply == QtGui.QMessageBox.Cancel: self.obj_Appconfig.print_info('No Project opened')
def __init__(self, filecount): print(self) QtWidgets.QWidget.__init__(self) self.count = 0 self.text = "" self.filecount = filecount self.entry_var = {} self.createMakerWidget() self.obj_Appconfig = Appconfig() verilogFile.append("")
def __init__(self, command, projPath): """ - Creates constructor for NgspiceWidget class. - Checks whether OS is Linux or Windows and creates Ngspice window accordingly. """ QtWidgets.QWidget.__init__(self) self.obj_appconfig = Appconfig() self.process = QtCore.QProcess(self) self.terminal = QtWidgets.QWidget(self) self.layout = QtWidgets.QVBoxLayout(self) self.layout.addWidget(self.terminal) print("Argument to ngspice command : ", command) if os.name == 'nt': # For Windows OS parser_nghdl = ConfigParser() parser_nghdl.read( os.path.join('library', 'config', '.nghdl', 'config.ini') ) msys_home = parser_nghdl.get('COMPILER', 'MSYS_HOME') tempdir = os.getcwd() projPath = self.obj_appconfig.current_project["ProjectName"] os.chdir(projPath) self.command = 'cmd /c '+'"start /min ' + \ msys_home + "/usr/bin/mintty.exe ngspice -p " + command + '"' self.process.start(self.command) os.chdir(tempdir) else: # For Linux OS self.command = "cd " + projPath + ";ngspice " + command # Creating argument for process self.args = ['-hold', '-e', self.command] self.process.start('xterm', self.args) self.obj_appconfig.process_obj.append(self.process) print(self.obj_appconfig.proc_dict) ( self.obj_appconfig.proc_dict [self.obj_appconfig.current_project['ProjectName']].append( self.process.pid()) ) self.process = QtCore.QProcess(self) self.command = "ngspice -b -r " + \ command.replace(".cir.out", ".raw") + " -o " \ + command.replace(".cir.out", ".out") + " " + command + \ "; gaw " + command.replace(".cir.out", ".raw") self.process.start('sh', ['-c', self.command])
def __init__(self, *args): # call init method of superclass QtGui.QWidget.__init__(self, *args) self.obj_appconfig = Appconfig() self.leftSplit = QtGui.QSplitter() self.middleSplit = QtGui.QSplitter() self.mainLayout = QtGui.QVBoxLayout() # Intermediate Widget self.middleContainer = QtGui.QWidget() self.middleContainerLayout = QtGui.QVBoxLayout() # Area to be included in MainView self.noteArea = QtGui.QTextEdit() self.noteArea.setReadOnly(True) self.obj_appconfig.noteArea['Note'] = self.noteArea self.obj_appconfig.noteArea['Note'].append( ' eSim Started......') self.obj_appconfig.noteArea['Note'].append('Project Selected : None') self.obj_appconfig.noteArea['Note'].append('\n') # CSS self.noteArea.setStyleSheet(" \ QWidget { border-radius: 15px; border: 1px \ solid gray; padding: 5px; } \ ") self.obj_dockarea = DockArea.DockArea() self.obj_projectExplorer = ProjectExplorer.ProjectExplorer() # Adding content to vertical middle Split. self.middleSplit.setOrientation(QtCore.Qt.Vertical) self.middleSplit.addWidget(self.obj_dockarea) self.middleSplit.addWidget(self.noteArea) # Adding middle split to Middle Container Widget self.middleContainerLayout.addWidget(self.middleSplit) self.middleContainer.setLayout(self.middleContainerLayout) # Adding content of left split self.leftSplit.addWidget(self.obj_projectExplorer) self.leftSplit.addWidget(self.middleContainer) # Adding to main Layout self.mainLayout.addWidget(self.leftSplit) self.leftSplit.setSizes([self.width() / 4.5, self.height()]) self.middleSplit.setSizes([self.width(), self.height() / 2]) self.setLayout(self.mainLayout)
def __init__(self, fpath, projectName): QtGui.QMainWindow.__init__(self) self.fpath = fpath #+".cir.out" self.projectName = projectName self.obj_appconfig = Appconfig() print "Path : ", self.fpath print "Project Name : ", self.projectName self.obj_appconfig.print_info('Ngspice simulation is called : ' + self.fpath) self.obj_appconfig.print_info('PythonPlotting is called : ' + self.fpath) self.combo = [] self.combo1 = [] self.combo1_rev = [] #Creating Frame self.createMainFrame()
def __init__(self, fpath, projectName): """This create constructor for plotWindow class.""" QtGui.QMainWindow.__init__(self) self.fpath = fpath self.projectName = projectName self.obj_appconfig = Appconfig() print("Complete Project Path : ", self.fpath) print("Project Name : ", self.projectName) self.obj_appconfig.print_info('Ngspice simulation is called : ' + self.fpath) self.obj_appconfig.print_info('PythonPlotting is called : ' + self.fpath) self.combo = [] self.combo1 = [] self.combo1_rev = [] # Creating Frame self.createMainFrame()
def __init__(self, command, projPath): """ - Creates constructor for NgspiceWidget class. - Checks whether OS is linux or windows and creates NgSpice window accordingly. """ QtGui.QWidget.__init__(self) self.obj_appconfig = Appconfig() self.process = QtCore.QProcess(self) self.terminal = QtGui.QWidget(self) self.layout = QtGui.QVBoxLayout(self) self.layout.addWidget(self.terminal) if os.name == 'nt': home = os.path.expanduser("~") parser_nghdl = SafeConfigParser() parser_nghdl.read( os.path.join(home, os.path.join('.nghdl', 'config.ini'))) try: msys_bin = parser_nghdl.get('COMPILER', 'MSYS_HOME') except BaseException: pass print("Argument to ngspice command : ", command) # For Linux OS if platform.system() == 'Linux': self.command = "cd " + projPath + ";ngspice " + command # Creating argument for process self.args = ['-hold', '-e', self.command] self.process.start('xterm', self.args) self.obj_appconfig.process_obj.append(self.process) print(self.obj_appconfig.proc_dict) (self.obj_appconfig.proc_dict[ self.obj_appconfig.current_project['ProjectName']].append( self.process.pid())) # For Windows OS elif platform.system() == 'Windows': tempdir = os.getcwd() projPath = self.obj_appconfig.current_project["ProjectName"] os.chdir(projPath) self.command = 'cmd /c '+'"start /min ' + \ msys_bin + "/mintty.exe ngspice " + command + '"' self.process.start(self.command) os.chdir(tempdir)
def body(self): self.obj_Appconfig = Appconfig() self.openDir = self.obj_Appconfig.default_workspace["workspace"] #print "default workspace is now 1", self.openDir self.projDir = QtGui.QFileDialog.getExistingDirectory( self, "open", self.openDir) if self.obj_validation.validateOpenproj(self.projDir) == True: #print "Pass open project test" #self.obj_Appconfig = Appconfig() self.obj_Appconfig.current_project['ProjectName'] = str( self.projDir) if os.path.isdir(self.projDir): print "true" for dirs, subdirs, filelist in os.walk( self.obj_Appconfig.current_project["ProjectName"]): directory = dirs files = filelist self.obj_Appconfig.project_explorer[dirs] = filelist json.dump(self.obj_Appconfig.project_explorer, open(self.obj_Appconfig.dictPath, 'w')) self.obj_Appconfig.print_info('Open Project called') self.obj_Appconfig.print_info('Current Project is ' + self.projDir) return dirs, filelist else: #print "Failed open project test" self.obj_Appconfig.print_error( "The project doesn't contain .proj file. Please select the proper directory else you won't be able to perform any operation" ) reply = QtGui.QMessageBox.critical( None, "Error Message", '''<b> Error: The project doesn't contain .proj file.</b><br/> <b>Please select the proper project directory else you won't be able to perform any operation</b>''', QtGui.QMessageBox.Ok | QtGui.QMessageBox.Cancel) if reply == QtGui.QMessageBox.Ok: self.body() self.obj_Appconfig.print_info('Open Project called') self.obj_Appconfig.print_info('Current Project is ' + self.projDir) elif reply == QtGui.QMessageBox.Cancel: self.obj_Appconfig.print_info('No Project opened') else: pass
def body(self): init_path = '../../' if os.name == 'nt': init_path = '' self.editfile = QtWidgets.QFileDialog.getExistingDirectory( None, "Open File", init_path + "library/SubcircuitLibrary") if self.editfile: self.obj_Appconfig = Appconfig() self.obj_Appconfig.current_subcircuit['SubcircuitName'] \ = self.editfile self.schname = os.path.basename(self.editfile) self.editfile = os.path.join(self.editfile, self.schname) self.cmd = "eeschema " + self.editfile + ".sch " self.obj_workThread = WorkerThread(self.cmd) self.obj_workThread.start()
def call_system(self, command): """ call_system is used to create childprocess for the passed arguments (self.args) and also pass the process created and its id to config file Apponfig() object contains procThread and proc_dist used to track processes called @params :command => (self.args) takes space separated string of\ comamnds to be executed in different child processes (see subprocess.Popen()) """ procThread = Appconfig() proc = subprocess.Popen(command.split()) self.my_workers.append(proc) procThread.procThread_list.append(proc) procThread.proc_dict[procThread.current_project['ProjectName']].append( proc.pid)
def __init__(self, *args): """ Initialize main Application window """ #Calling __init__ of super class QtGui.QMainWindow.__init__(self, *args) #Creating Application configuration object self.obj_appconfig = Appconfig() self.setGeometry(self.obj_appconfig._app_xpos, self.obj_appconfig._app_ypos, self.obj_appconfig._app_width, self.obj_appconfig._app_heigth) self.setWindowTitle(self.obj_appconfig._APPLICATION) #Init Workspace self.obj_workspace = Workspace.Workspace() #Init necessary components in sequence self.initActions() self.initView()
def __init__(self, parent=None): super(Subcircuit, self).__init__() QtGui.QWidget.__init__(self) self.obj_appconfig = Appconfig() self.obj_validation = Validation() self.obj_dockarea = parent self.layout = QtGui.QVBoxLayout() self.splitter = QtGui.QSplitter() self.splitter.setOrientation(QtCore.Qt.Vertical) self.newbtn = QtGui.QPushButton('New Subcircuit Schematic') self.newbtn.setToolTip('<b>To create new Subcircuit Schematic</b>') self.newbtn.setFixedSize(200, 40) self.newbtn.clicked.connect(self.newsch) self.editbtn = QtGui.QPushButton('Edit Subcircuit Schematic') self.editbtn.setToolTip('<b>To edit existing Subcircuit Schematic</b>') self.editbtn.setFixedSize(200, 40) self.editbtn.clicked.connect(self.editsch) self.convertbtn = QtGui.QPushButton('Convert Kicad to Ngspice') self.convertbtn.setToolTip( '<b>To convert Subcircuit Kicad Netlist to Ngspice Netlist</b>') self.convertbtn.setFixedSize(200, 40) self.convertbtn.clicked.connect(self.convertsch) self.uploadbtn = QtGui.QPushButton('Upload a Subcircuit') self.uploadbtn.setToolTip('<b>To Upload a subcircuit</b>') self.uploadbtn.setFixedSize(180, 38) self.uploadbtn.clicked.connect(self.uploadSub) self.hbox = QtGui.QHBoxLayout() self.hbox.addWidget(self.newbtn) self.hbox.addWidget(self.editbtn) self.hbox.addWidget(self.convertbtn) self.hbox.addWidget(self.uploadbtn) self.hbox.addStretch(1) self.vbox = QtGui.QVBoxLayout() self.vbox.addLayout(self.hbox) self.vbox.addStretch(1) self.setLayout(self.vbox) self.show()
def __init__(self): QtGui.QMainWindow.__init__(self) self.obj_appconfig = Appconfig() for dockName in dockList: dock[dockName] = QtGui.QDockWidget(dockName) self.welcomeWidget = QtGui.QWidget() self.welcomeLayout = QtGui.QVBoxLayout() self.welcomeLayout.addWidget(Welcome()) ##Call browser #Adding to main Layout self.welcomeWidget.setLayout(self.welcomeLayout) dock[dockName].setWidget(self.welcomeWidget) #CSS dock[dockName].setStyleSheet(" \ QWidget { border-radius: 15px; border: 1px solid gray; padding: 5px; width: 200px; height: 150px; } \ ") self.addDockWidget(QtCore.Qt.TopDockWidgetArea, dock[dockName]) #self.tabifyDockWidget(dock['Notes'],dock['Blank']) self.show()
def body(self): self.projDir = QtGui.QFileDialog.getExistingDirectory() if self.obj_validation.validateOpenproj(self.projDir) == True: print "Pass open project test" self.obj_Appconfig = Appconfig() self.obj_Appconfig.current_project['ProjectName'] = str( self.projDir) else: print "Failed open project test" reply = QtGui.QMessageBox.critical( None, "Error Message", '''<b> Error: The project doesn't contain .proj file.</b><br/> <b>Please select the proper project directory else you won't be able to perform any operation</b>''', QtGui.QMessageBox.Ok | QtGui.QMessageBox.Cancel) if reply == QtGui.QMessageBox.Ok: self.body() elif reply == QtGui.QMessageBox.Cancel: pass else: pass