diff --git a/video_tests/opengl_test/__init__.py b/video_tests/opengl_test/__init__.py new file mode 100644 index 000000000..3fef7b098 --- /dev/null +++ b/video_tests/opengl_test/__init__.py @@ -0,0 +1,40 @@ +#!/usr/bin/env python + +"""Main entry point for opengl_test. + +This module contains the code necessary to be able to launch QControl +directly from the command line, without using qtpyvcp. It handles +parsing command line args and starting the main application. + +Example: + Assuming the dir this file is located in is on the PATH, you can + launch opengl_test by saying:: + + $ opengl_test --ini=/path/to/config.ini [options ...] + + Run with the --help option to print a full list of options. + +""" + +__version__ = '0.0.1' + +import os +import qtpyvcp + +VCP_DIR = os.path.realpath(os.path.dirname(__file__)) +VCP_CONFIG_FILE = os.path.join(VCP_DIR, 'config.yml') + + +def main(opts=None): + + if opts is None: + from qtpyvcp.utilities.opt_parser import parse_opts + opts = parse_opts(vcp_cmd='opengl_test', + vcp_name='opengl_test', + vcp_version=__version__) + + qtpyvcp.run_vcp(opts, VCP_CONFIG_FILE) + + +if __name__ == '__main__': + main() diff --git a/video_tests/opengl_test/config.yml b/video_tests/opengl_test/config.yml new file mode 100644 index 000000000..6c7038c48 --- /dev/null +++ b/video_tests/opengl_test/config.yml @@ -0,0 +1,50 @@ +# Include the QtPyVCP default menubar. +{% include "default_menubar.yml" %} + +qtdesigner: + ui_file: ( windows.mainwindow.kwargs.ui_file ) + qss_file: ( application.kwargs.stylesheet ) + +vcp: + name: opengl_test + version: v0.0.1 + author: My Name + description: > + Put a short description of your VCP here. This will be + shown in the VCP Chooser when launching QtPyVCP with the + --chooser option. + + + Examples of what to included here: + * VCP Features + * Type of machine the VCP is for + * Development status + * Acknowledgments + +data_plugins: + status: + kwargs: + cycle_time: 75 + +windows: + + mainwindow: + # Specify the class to use for the VCP's mainwindow + # Format: package.module:class + provider: opengl_test.mainwindow:MyMainWindow + + # Keyword arguments to pass when initializing the class. + kwargs: + # Specify the mainwindow menubar as the default. + menu: ( default_menubar ) + # Specify the UI file to load the window layout from. + ui_file: {{ file.dir }}/mainwindow.ui + # Specify a stylesheet to use only for mainwindow. + stylesheet: null + # Set the window title from from the date in the vcp section above. + title: ( vcp.name ) ( vcp.version) + +application: + kwargs: + # Specify the application wide stylesheet. + stylesheet: {{ file.dir }}/style.qss diff --git a/video_tests/opengl_test/mainwindow.py b/video_tests/opengl_test/mainwindow.py new file mode 100644 index 000000000..88e0cfb6f --- /dev/null +++ b/video_tests/opengl_test/mainwindow.py @@ -0,0 +1,15 @@ +from qtpyvcp.widgets.form_widgets.main_window import VCPMainWindow + +# Setup logging +from qtpyvcp.utilities import logger +LOG = logger.getLogger('qtpyvcp.' + __name__) + +class MyMainWindow(VCPMainWindow): + """Main window class for the VCP.""" + def __init__(self, *args, **kwargs): + super(MyMainWindow, self).__init__(*args, **kwargs) + + # add any custom methods here + def on_exitBtn_clicked(self): + self.app.quit() + diff --git a/video_tests/opengl_test/mainwindow.ui b/video_tests/opengl_test/mainwindow.ui new file mode 100644 index 000000000..64f8be57e --- /dev/null +++ b/video_tests/opengl_test/mainwindow.ui @@ -0,0 +1,104 @@ + + + MainWindow + + + + 0 + 0 + 400 + 400 + + + + + 0 + 0 + + + + + 800 + 600 + + + + MainWindow + + + + + + + + + + QFrame::Box + + + OpenGl Works + + + Qt::AlignCenter + + + + + + + + + + Quit + + + + + + + + + + + Exit + + + Ctrl+Q + + + + + oPEN + + + + + Open + + + Ctrl+O + + + + + true + + + Fullscreen + + + F11 + + + + + + GcodeBackplot + QWidget +
qtpyvcp.widgets.display_widgets.gcode_backplot.gcode_backplot
+ 1 +
+
+ + +
diff --git a/video_tests/opengl_test/style.qss b/video_tests/opengl_test/style.qss new file mode 100644 index 000000000..7bb174d0c --- /dev/null +++ b/video_tests/opengl_test/style.qss @@ -0,0 +1,28 @@ +QsciScintilla { + qproperty-backgroundcolor: #D9DADB; + qproperty-marginbackgroundcolor: #D9DADB; +} + +ActionButton[actionName="machine.estop.toggle"]:checked{ + background: rgb(239, 41, 41); +} + +ActionButton[actionName="machine.power.toggle"]:checked{ + background:rgb(138, 226, 52); +} + +ActionButton[actionName="program.run"]:enabled{ + background:rgb(138, 226, 52); +} + +ActionButton[actionName="program.step"]:enabled{ + background:rgb(138, 226, 52); +} + +ActionButton[actionName="program.pause"]:enabled{ + background:rgb(252, 233, 79); +} + +ActionButton[actionName="program.abort"]:enabled{ + background: rgb(239, 41, 41); +} diff --git a/video_tests/qtpyvcp_test/__init__.py b/video_tests/qtpyvcp_test/__init__.py new file mode 100644 index 000000000..f845b16aa --- /dev/null +++ b/video_tests/qtpyvcp_test/__init__.py @@ -0,0 +1,40 @@ +#!/usr/bin/env python + +"""Main entry point for no_graphics_test. + +This module contains the code necessary to be able to launch QControl +directly from the command line, without using qtpyvcp. It handles +parsing command line args and starting the main application. + +Example: + Assuming the dir this file is located in is on the PATH, you can + launch no_graphics_test by saying:: + + $ no_graphics_test --ini=/path/to/config.ini [options ...] + + Run with the --help option to print a full list of options. + +""" + +__version__ = '0.0.1' + +import os +import qtpyvcp + +VCP_DIR = os.path.realpath(os.path.dirname(__file__)) +VCP_CONFIG_FILE = os.path.join(VCP_DIR, 'config.yml') + + +def main(opts=None): + + if opts is None: + from qtpyvcp.utilities.opt_parser import parse_opts + opts = parse_opts(vcp_cmd='no_graphics_test', + vcp_name='no_graphics_test', + vcp_version=__version__) + + qtpyvcp.run_vcp(opts, VCP_CONFIG_FILE) + + +if __name__ == '__main__': + main() diff --git a/video_tests/qtpyvcp_test/config.yml b/video_tests/qtpyvcp_test/config.yml new file mode 100644 index 000000000..f3657d747 --- /dev/null +++ b/video_tests/qtpyvcp_test/config.yml @@ -0,0 +1,50 @@ +# Include the QtPyVCP default menubar. +{% include "default_menubar.yml" %} + +qtdesigner: + ui_file: ( windows.mainwindow.kwargs.ui_file ) + qss_file: ( application.kwargs.stylesheet ) + +vcp: + name: no_graphics_test + version: v0.0.1 + author: My Name + description: > + Put a short description of your VCP here. This will be + shown in the VCP Chooser when launching QtPyVCP with the + --chooser option. + + + Examples of what to included here: + * VCP Features + * Type of machine the VCP is for + * Development status + * Acknowledgments + +data_plugins: + status: + kwargs: + cycle_time: 75 + +windows: + + mainwindow: + # Specify the class to use for the VCP's mainwindow + # Format: package.module:class + provider: no_graphics_test.mainwindow:MyMainWindow + + # Keyword arguments to pass when initializing the class. + kwargs: + # Specify the mainwindow menubar as the default. + menu: ( default_menubar ) + # Specify the UI file to load the window layout from. + ui_file: {{ file.dir }}/ui/mainwindow.ui + # Specify a stylesheet to use only for mainwindow. + stylesheet: null + # Set the window title from from the date in the vcp section above. + title: ( vcp.name ) ( vcp.version) + +application: + kwargs: + # Specify the application wide stylesheet. + stylesheet: {{ file.dir }}/ui/style.qss diff --git a/video_tests/qtpyvcp_test/mainwindow.py b/video_tests/qtpyvcp_test/mainwindow.py new file mode 100644 index 000000000..88e0cfb6f --- /dev/null +++ b/video_tests/qtpyvcp_test/mainwindow.py @@ -0,0 +1,15 @@ +from qtpyvcp.widgets.form_widgets.main_window import VCPMainWindow + +# Setup logging +from qtpyvcp.utilities import logger +LOG = logger.getLogger('qtpyvcp.' + __name__) + +class MyMainWindow(VCPMainWindow): + """Main window class for the VCP.""" + def __init__(self, *args, **kwargs): + super(MyMainWindow, self).__init__(*args, **kwargs) + + # add any custom methods here + def on_exitBtn_clicked(self): + self.app.quit() + diff --git a/video_tests/qtpyvcp_test/mainwindow.ui b/video_tests/qtpyvcp_test/mainwindow.ui new file mode 100644 index 000000000..379ceca2d --- /dev/null +++ b/video_tests/qtpyvcp_test/mainwindow.ui @@ -0,0 +1,93 @@ + + + MainWindow + + + + 0 + 0 + 400 + 400 + + + + + 0 + 0 + + + + + 800 + 600 + + + + MainWindow + + + + + + + + + + <html><head/><body><p>This is a test, if this loads but vtk_test or opengl_test do not load then you have a video card issue.</p><p>Try running the vtk_test or opengl_test from a terminal.</p><p>Type linuxcnc in a terminal and pick a QtPyVCP simulation like XYZ then pick either vtk_test or opengl_test. The error should be somewhere in the terminal.</p></body></html> + + + Qt::AlignCenter + + + true + + + + + + + Exit + + + + + + + + + + + Exit + + + Ctrl+Q + + + + + oPEN + + + + + Open + + + Ctrl+O + + + + + true + + + Fullscreen + + + F11 + + + + + + diff --git a/video_tests/qtpyvcp_test/style.qss b/video_tests/qtpyvcp_test/style.qss new file mode 100644 index 000000000..7bb174d0c --- /dev/null +++ b/video_tests/qtpyvcp_test/style.qss @@ -0,0 +1,28 @@ +QsciScintilla { + qproperty-backgroundcolor: #D9DADB; + qproperty-marginbackgroundcolor: #D9DADB; +} + +ActionButton[actionName="machine.estop.toggle"]:checked{ + background: rgb(239, 41, 41); +} + +ActionButton[actionName="machine.power.toggle"]:checked{ + background:rgb(138, 226, 52); +} + +ActionButton[actionName="program.run"]:enabled{ + background:rgb(138, 226, 52); +} + +ActionButton[actionName="program.step"]:enabled{ + background:rgb(138, 226, 52); +} + +ActionButton[actionName="program.pause"]:enabled{ + background:rgb(252, 233, 79); +} + +ActionButton[actionName="program.abort"]:enabled{ + background: rgb(239, 41, 41); +} diff --git a/video_tests/vtk_test/__init__.py b/video_tests/vtk_test/__init__.py new file mode 100644 index 000000000..4a4d70001 --- /dev/null +++ b/video_tests/vtk_test/__init__.py @@ -0,0 +1,40 @@ +#!/usr/bin/env python + +"""Main entry point for vtk_test. + +This module contains the code necessary to be able to launch QControl +directly from the command line, without using qtpyvcp. It handles +parsing command line args and starting the main application. + +Example: + Assuming the dir this file is located in is on the PATH, you can + launch vtk_test by saying:: + + $ vtk_test --ini=/path/to/config.ini [options ...] + + Run with the --help option to print a full list of options. + +""" + +__version__ = '0.0.1' + +import os +import qtpyvcp + +VCP_DIR = os.path.realpath(os.path.dirname(__file__)) +VCP_CONFIG_FILE = os.path.join(VCP_DIR, 'config.yml') + + +def main(opts=None): + + if opts is None: + from qtpyvcp.utilities.opt_parser import parse_opts + opts = parse_opts(vcp_cmd='vtk_test', + vcp_name='vtk_test', + vcp_version=__version__) + + qtpyvcp.run_vcp(opts, VCP_CONFIG_FILE) + + +if __name__ == '__main__': + main() diff --git a/video_tests/vtk_test/config.yml b/video_tests/vtk_test/config.yml new file mode 100644 index 000000000..1cd5feeb3 --- /dev/null +++ b/video_tests/vtk_test/config.yml @@ -0,0 +1,49 @@ +# Include the QtPyVCP default menubar. +{% include "default_menubar.yml" %} + +qtdesigner: + ui_file: ( windows.mainwindow.kwargs.ui_file ) + qss_file: ( application.kwargs.stylesheet ) + +vcp: + name: vtk_test + version: v0.0.1 + author: John Thornton + description: > + VTK Test is a video card test tool to see if the + Visualization Toolkit backplot works on your PC + If your having problems run this test from the + terminal by starting LinuxCNC with linuxcnc then + pick a QtPyVCP sim like XYZ + + Examples of what to included here: + * VTK Test + * Video Card Test + +data_plugins: + status: + kwargs: + cycle_time: 75 + +windows: + + mainwindow: + # Specify the class to use for the VCP's mainwindow + # Format: package.module:class + provider: vtk_test.mainwindow:MyMainWindow + + # Keyword arguments to pass when initializing the class. + kwargs: + # Specify the mainwindow menubar as the default. + menu: ( default_menubar ) + # Specify the UI file to load the window layout from. + ui_file: {{ file.dir }}/mainwindow.ui + # Specify a stylesheet to use only for mainwindow. + stylesheet: null + # Set the window title from from the date in the vcp section above. + title: ( vcp.name ) ( vcp.version) + +application: + kwargs: + # Specify the application wide stylesheet. + stylesheet: {{ file.dir }}/style.qss diff --git a/video_tests/vtk_test/mainwindow.py b/video_tests/vtk_test/mainwindow.py new file mode 100644 index 000000000..88e0cfb6f --- /dev/null +++ b/video_tests/vtk_test/mainwindow.py @@ -0,0 +1,15 @@ +from qtpyvcp.widgets.form_widgets.main_window import VCPMainWindow + +# Setup logging +from qtpyvcp.utilities import logger +LOG = logger.getLogger('qtpyvcp.' + __name__) + +class MyMainWindow(VCPMainWindow): + """Main window class for the VCP.""" + def __init__(self, *args, **kwargs): + super(MyMainWindow, self).__init__(*args, **kwargs) + + # add any custom methods here + def on_exitBtn_clicked(self): + self.app.quit() + diff --git a/video_tests/vtk_test/mainwindow.ui b/video_tests/vtk_test/mainwindow.ui new file mode 100644 index 000000000..0d439e86f --- /dev/null +++ b/video_tests/vtk_test/mainwindow.ui @@ -0,0 +1,103 @@ + + + MainWindow + + + + 0 + 0 + 436 + 465 + + + + + 0 + 0 + + + + + 800 + 600 + + + + MainWindow + + + + + + + + + + QFrame::Box + + + The Visualization Toolkit Works + + + Qt::AlignCenter + + + + + + + + + + Quit + + + + + + + + + + + Exit + + + Ctrl+Q + + + + + oPEN + + + + + Open + + + Ctrl+O + + + + + true + + + Fullscreen + + + F11 + + + + + + VTKBackPlot + QWidget +
qtpyvcp.widgets.display_widgets.vtk_backplot.vtk_backplot
+
+
+ + +
diff --git a/video_tests/vtk_test/style.qss b/video_tests/vtk_test/style.qss new file mode 100644 index 000000000..7bb174d0c --- /dev/null +++ b/video_tests/vtk_test/style.qss @@ -0,0 +1,28 @@ +QsciScintilla { + qproperty-backgroundcolor: #D9DADB; + qproperty-marginbackgroundcolor: #D9DADB; +} + +ActionButton[actionName="machine.estop.toggle"]:checked{ + background: rgb(239, 41, 41); +} + +ActionButton[actionName="machine.power.toggle"]:checked{ + background:rgb(138, 226, 52); +} + +ActionButton[actionName="program.run"]:enabled{ + background:rgb(138, 226, 52); +} + +ActionButton[actionName="program.step"]:enabled{ + background:rgb(138, 226, 52); +} + +ActionButton[actionName="program.pause"]:enabled{ + background:rgb(252, 233, 79); +} + +ActionButton[actionName="program.abort"]:enabled{ + background: rgb(239, 41, 41); +}