Пример #1
0
 def run_app():
     # Creat an instance of PyQt5 application
     # Every PyQt5 application has to contain this line
     app = QApplication(sys.argv)
     # Set the default icon to use for all the windows of our application
     app.setWindowIcon(QIcon('myicon.ico'))
     # Create an instance of the GUI window.
     window = MainWindow()
     window.show()
     # Next line hands the control over to Python GUI
     app.exec_()
    def _initiate_mainWindow(self):
        self._mainWindow = MainWindow.MainWindow()
        # connect the signals sent from MainWindow to slots inside the AppController class

        self._mainWindow.buttonClickedEventWithArgument.connect(self.button_interaction_factory_method)
        self._mainWindow.virusInputDataChangedEvent.connect(self.virus_data_changed_interaction_factory_method)
        self._mainWindow.show()
Пример #3
0
def main():
    default_update_interval = 60  # in seconds
    data_provider = ContestDataCollector()
    qapp = QApplication(sys.argv)
    window = MainWindow()

    updater = TableUpdater(default_update_interval, data_provider, window)

    #This .1 second delay in updating the table gives widgets some time to setup
    # without the delay the gui seems to hang for a few second during launch
    threading.Timer(.1, updater.startUpdateTimer).start()

    exit(qapp.exec_())
Пример #4
0
    def __init__(self):
        self.mainWindow = MainWindow.MainWindow(self.basePath())
        self.mainWindow.show()
        self.connect_signals()
        self.initialize_gui()

        self.plot = self.mainWindow.getPlot()
        self.mainPlot = None
        self.frame_size = 1000

        self.flock_plot_data = [[], []]

        self.boids_cnt = 75

        self.boids_max_speed = 10
        self.boids_alignment_factor = 0.03
        self.boids_cohesion_factor = 0.19
        self.boids_separation_factor = 5.5
        self.boids_field_of_view_angle = 115
        self.distance_to_next_boid = 35
        self.slow_down_factor = 2.5

        self.plot_init_flag = True
        self.trace_boids = False
        self.add_lines = False

        self.trace_boids_cnt = 0

        self.trace_scipper = 10
        self.colors = ['b', 'y', 'g', 'r']

        self.flock_thread = QThread()
        self.flocking_worker = FlockingWorker.FlockingWorker(self)
        self.flocking_worker.timer.start()
        self.flocking_worker.plot_data_signal.connect(self.fill_flock)

        self.flocking_worker.moveToThread(self.flock_thread)

        self.timer = QtCore.QTimer()
        self.timer.setInterval(2)
        self.timer.timeout.connect(self.updatePlot)
Пример #5
0
import sys
from PyQt5.QtWidgets import QApplication
from src.gui import MainWindow

if __name__ == "__main__":
    app = QApplication([])
    window = MainWindow(title="Client", is_server=False)
    window.show()
    sys.exit(app.exec_())
Пример #6
0
from pyqtgraph.Qt import QtGui, QtCore
from src.gui.MainWindow import *

app = QtGui.QApplication([])

main_window = MainWindow(700, 600)
main_window.show()

if __name__ == '__main__':
    import sys
    if (sys.flags.interactive != 1) or not hasattr(QtCore, 'PYQT_VERSION'):
        QtGui.QApplication.instance().exec_()
Пример #7
0
from PyQt5.QtWidgets import QApplication

from src.gui import MainWindow

if __name__ == '__main__':
    app = QApplication([])
    gui = MainWindow()
    gui.show()
    app.exec_()
Пример #8
0
import sys
from PyQt5.QtWidgets import QApplication
from src.gui import MainWindow


if __name__ == "__main__":
    app = QApplication([])
    window = MainWindow(title="Server",is_server=True)
    window.show()
    sys.exit(app.exec_())
Пример #9
0
curses.init_pair(1, curses.COLOR_BLACK, curses.COLOR_CYAN)
curses.init_pair(2, curses.COLOR_CYAN, curses.COLOR_BLACK)
screen.border(0)
curses.curs_set(0)


config = Config.Config()
db = DBConnection.DBConnection(config).connect()

screen.refresh()

footer = Footer.Footer(db)
footer.refresh()

finder = Finder.Finder()
finder.refresh()

header = Header.Header()
header.refresh()

main = MainWindow.MainWindow(db, screen, header, finder, footer)

try:
    main.init()
except Exception as e:
    logging.fatal("Exception: {0}".format(e))
finally:
    curses.endwin()
    if traceback.format_exc().strip() != "None":
        print traceback.format_exc()