Example #1
0
def main(rts):
    pg.setConfigOptions(antialias=True)
    app = QtWidgets.QApplication(sys.argv)
    # phasor_plot = gui.PhasorPlot(rts, update_freq=30)
    grid_plt = GridPlot(rts, update_freq=1)
    # ts_plot = gui.TimeSeriesPlot(rts, ['speed', 'angle'], update_freq=30)  # , 'speed', 'e_q_t', 'e_d_t', 'e_q_st', 'e_d_st'])
    # stats_plot = gui.SimulationStatsPlot(rts, update_freq=30)

    # Add Control Widgets
    # line_outage_ctrl = gui.LineOutageWidget(rts)
    # excitation_ctrl = gui.GenCtrlWidget(rts)

    console = PythonConsole()
    console.push_local_ns('rts', rts)
    console.push_local_ns('grid_plt', grid_plt)
    # console.push_local_ns('ts_plot', ts_plot)
    # console.push_local_ns('phasor_plot', phasor_plot)
    # console.push_local_ns('line_outage_ctrl', line_outage_ctrl)
    # console.push_local_ns('excitation_ctrl', excitation_ctrl)
    console.show()
    console.eval_in_thread()

    app.exec_()

    return app
Example #2
0
def main(rts):
    update_freq = 30
    pg.setConfigOptions(antialias=True)
    app = QtWidgets.QApplication(sys.argv)
    phasor_plot = gui.PhasorPlot(rts, update_freq=update_freq)
    ts_plot = gui.TimeSeriesPlot(
        rts, ['speed', 'angle'], update_freq=update_freq
    )  # , 'speed', 'e_q_t', 'e_d_t', 'e_q_st', 'e_d_st'])
    grid_plot = gui.GridPlot3D(rts,
                               update_freq=update_freq,
                               z_ax='abs_pu',
                               rotating=False)  # , use_colors=True)
    grid_plot_angle = gui.GridPlot3D(rts,
                                     update_freq=update_freq,
                                     z_ax='angle',
                                     rotating=False)  # , use_colors=True)
    # stats_plot = gui.SimulationStatsPlot(rts, update_freq=30)

    # Add Control Widgets
    line_outage_ctrl = gui.LineOutageWidget(rts)
    gen_ctrl = gui.GenCtrlWidget(rts)

    console = PythonConsole()
    console.push_local_ns('rts', rts)
    console.push_local_ns('ts_plot', ts_plot)
    console.push_local_ns('phasor_plot', phasor_plot)
    console.push_local_ns('line_outage_ctrl', line_outage_ctrl)
    console.push_local_ns('gen_ctrl', gen_ctrl)
    console.show()
    console.eval_in_thread()

    app.exec_()

    return app
Example #3
0
 def new_consolle(self):
     self.a = []
     console = PythonConsole()
     console.push_local_ns('getData', self.getData)
     console.push_local_ns('getCurrent', self.getCurrent)
     console.show()
     console.eval_executor(gevent.spawn)
Example #4
0
def main(rts):
    app = QtWidgets.QApplication(sys.argv)
    phasor_plot = PhasorPlot(rts, update_freq=25)
    ts_plot = TimeSeriesPlotFast(rts, ['angle', 'speed'], update_freq=25)  # , 'speed', 'e_q_t', 'e_d_t', 'e_q_st', 'e_d_st'])
    stats_plot = SimulationStatsPlot(rts, update_freq=25)  # , 'speed', 'e_q_t', 'e_d_t', 'e_q_st', 'e_d_st'])

    # Add Control Widgets
    line_outage_ctrl = LineOutageWidget(rts)
    excitation_ctrl = GenCtrlWidget(rts)

    # console = PythonConsole()
    console = PythonConsole()
    console.push_local_ns('rts', rts)
    # console.push_local_ns('ts_plot', ts_plot)
    console.push_local_ns('phasor_plot', phasor_plot)
    console.push_local_ns('line_outage_ctrl', line_outage_ctrl)
    console.push_local_ns('excitation_ctrl', excitation_ctrl)
    console.show()
    console.eval_in_thread()
    app.exec_()

    return app
# -*- coding: utf-8 -*-
#/usr/bin/python
import sys

from pyqtconsole.qt.QtWidgets import QApplication
from pyqtconsole.console import PythonConsole


def greet():
    print("hello world")


if __name__ == '__main__':
    app = QApplication([])

    console = PythonConsole()
    console.push_local_ns('greet', greet)
    console.show()

    console.eval_queued()

    sys.exit(app.exec_())
Example #6
0
import sys
from threading import Thread
from PyQt5.QtWidgets import QApplication

from pyqtconsole.console import PythonConsole

app = QApplication([])
console = PythonConsole()
console.show()
console.eval_in_thread()

sys.exit(app.exec_())