def main(): try: import FreeCAD except ValueError: print( 'FreeCAD library not found. Please check the FREECADPATH variable in this script is correct' ) sys.exit(1) simapp = QtGui.QApplication(sys.argv) simappwindow = QtGui.QMainWindow() simappwindow.setWindowTitle("EQ Simulator") s = None s = Simulator.Simulator() s.Build() manualsettingswidget = DockManualSetting(s) simulationwidget = DockSimulation(s, manualsettingswidget) simappwindow.addDockWidget(QtCore.Qt.BottomDockWidgetArea, manualsettingswidget) simappwindow.addDockWidget(QtCore.Qt.LeftDockWidgetArea, simulationwidget) # FreeCAD integration: see http://sourceforge.net/apps/mediawiki/free-cad/index.php?title=Embedding_FreeCADGui/fr # Utilisation d'un module tiers (en l'occurence Quarter ?) #FreeCADGui.setupWithoutGUI() widget3D = QtGui.QWidget() widget3D.setMinimumSize(712, 400) qw = QuarterWidget(widget3D) qw.setMinimumSize(712, 400) qw.setSceneGraph(s.scene) #Http server #server=BaseHTTPServer.HTTPServer(('', 8000), HTTPHandler) #server.serve_forever() #TCP Server server = QtNetwork.QTcpServer() server.setMaxPendingConnections(1) server.currentClient = None server.newConnection.connect( lambda: acceptClient(server, simulationwidget.process_config)) server.listen(QtNetwork.QHostAddress.Any, 64101) #s.Embed(widget3D) simappwindow.setCentralWidget(widget3D) simappwindow.show() #SoGui.mainloop() simapp.exec_()
def main(): try: import FreeCAD except ValueError: print('FreeCAD library not found. Please check the FREECADPATH variable in this script is correct') sys.exit(1) simapp=QtGui.QApplication(sys.argv) simappwindow=QtGui.QMainWindow() simappwindow.setWindowTitle("EQ Simulator") s=None s=Simulator.Simulator() s.Build() manualsettingswidget=DockManualSetting(s) simulationwidget=DockSimulation(s, manualsettingswidget) simappwindow.addDockWidget(QtCore.Qt.BottomDockWidgetArea, manualsettingswidget) simappwindow.addDockWidget(QtCore.Qt.LeftDockWidgetArea, simulationwidget) # FreeCAD integration: see http://sourceforge.net/apps/mediawiki/free-cad/index.php?title=Embedding_FreeCADGui/fr # Utilisation d'un module tiers (en l'occurence Quarter ?) #FreeCADGui.setupWithoutGUI() widget3D=QtGui.QWidget() widget3D.setMinimumSize(712,400) qw=QuarterWidget(widget3D) qw.setMinimumSize(712, 400) qw.setSceneGraph(s.scene) #Http server #server=BaseHTTPServer.HTTPServer(('', 8000), HTTPHandler) #server.serve_forever() #TCP Server server=QtNetwork.QTcpServer() server.setMaxPendingConnections(1) server.currentClient=None server.newConnection.connect(lambda:acceptClient(server, simulationwidget.process_config)) server.listen(QtNetwork.QHostAddress.Any, 64101) #s.Embed(widget3D) simappwindow.setCentralWidget(widget3D) simappwindow.show() #SoGui.mainloop() simapp.exec_()
motorstatusdockwidget=QtGui.QDockWidget("Motor status", simappwindow) motorstatusdockwidget.setAllowedAreas(QtCore.Qt.LeftDockWidgetArea | QtCore.Qt.RightDockWidgetArea) motorstatusdockwidget.setWidget(tabwidget) simappwindow.addDockWidget(QtCore.Qt.LeftDockWidgetArea, motorstatusdockwidget) # FreeCAD integration: see http://sourceforge.net/apps/mediawiki/free-cad/index.php?title=Embedding_FreeCADGui/fr # Utilisation d'un module tiers (en l'occurence Quarter ?) #FreeCADGui.setupWithoutGUI() s=Simulator() s.Build() widget3D=QtGui.QWidget() widget3D.setMinimumSize(640,480) qw=QuarterWidget(widget3D) qw.setMinimumSize(640, 480) qw.setSceneGraph(s.scene) #s.Embed(widget3D) simappwindow.setCentralWidget(widget3D) simappwindow.show() #SoGui.mainloop() simapp.exec_() #if __name__ == "Simulator": #if __name__ == "__main__": # main() #print __name__