diff --git a/_data/docs.yml b/_data/docs.yml index f90125a88f..3165e9aa8a 100644 --- a/_data/docs.yml +++ b/_data/docs.yml @@ -12,6 +12,7 @@ - index-developer - index-documenting - developing/develop-index + - developing/qtquickvcp - title: Manpages docs: diff --git a/docs/developing/develop-index.asciidoc b/docs/developing/develop-index.asciidoc index d81ead15b2..1db2175e6a 100644 --- a/docs/developing/develop-index.asciidoc +++ b/docs/developing/develop-index.asciidoc @@ -20,3 +20,5 @@ - link:/docs/developing/toolchangers[Specific info on writing toolchanger components] - link:/docs/developing/CAN-developing[Information on developing using CAN] + +- link:/docs/developing/qtquickvcp[Installing Using and Developing for QtQuickVcp] diff --git a/docs/developing/developing.asciidoc b/docs/developing/developing.asciidoc index 658186002e..9caa7bbd02 100644 --- a/docs/developing/developing.asciidoc +++ b/docs/developing/developing.asciidoc @@ -16,3 +16,8 @@ starting at point 1 should lead you thru the next steps and return you to this p == Other instructions for specific development . link:/docs/developing/CAN-developing[CAN developing for Machinekit] + +== QtQuickVcp + +. link:/docs/developing/qtquickvcp[Installing, Using and Developing for QtQuickVcp] + diff --git a/docs/developing/images/qtc_build_settings.png b/docs/developing/images/qtc_build_settings.png new file mode 100644 index 0000000000..b2e10ee626 Binary files /dev/null and b/docs/developing/images/qtc_build_settings.png differ diff --git a/docs/developing/images/qtc_qml_emulation.png b/docs/developing/images/qtc_qml_emulation.png new file mode 100644 index 0000000000..83f267826d Binary files /dev/null and b/docs/developing/images/qtc_qml_emulation.png differ diff --git a/docs/developing/qtquickvcp.asciidoc b/docs/developing/qtquickvcp.asciidoc new file mode 100644 index 0000000000..5959c92d2e --- /dev/null +++ b/docs/developing/qtquickvcp.asciidoc @@ -0,0 +1,667 @@ +--- +--- + +:skip-front-matter: + += QtQuickVcp +:toc: + +The QtQuick Virtual Control Panel + +== QtQuickVcp? + +QtQuickVcp is a Machinekit component which adds the ability create new user interfaces for link:https://github.com/machinekit/machinekit[Machinekit] written in Qt/C++/QML. + +Unlike http://www.machinekit.io/docs/man/man1/gladevcp.1[GladeVCP] all user interface functionality can be implemented in QML only. + +QtQuickVcp is designed with the aspect of remote interfaces on mobile devices and embedded systems in mind. + +A UI is designed once for a specific form factor and can then be deployed to any mobile, embedded or desktop device over the network. + +The link:http://github.com/strahlex/QtQuickVcp[repository] contains the QtQuickVcp library. + +A generic client implementation and binary distributions can be found here link:https://github.com/strahlex/MachinekitClient[Machinekit-Client] + +More details about QtQuickVcp and how it can be installed can be found in the link:https://github.com/strahlex/QtQuickVcp/wiki/QtQuick-Virtual-Control-Panel[QtQuickVcp Wiki] + +Online documentation for some QtQuickVcp classes can be found here http://static.machinekit.io/html/qtquickvcp/index.html[QtQuickVcp Docu] + + + +== Getting Started + +Please take a look at the link:http://www.youtube.com/watch?v=hyY1DoJ3mOA[YouTube video of HelloWorld in QtQuickVcp] + +image::http://img.youtube.com/vi/hyY1DoJ3mOA/0.jpg[] + +More detailed videos for specific areas will follow. + + + +=== Install or Update Machinekit +If you have no Machinekit installation please follow the installation steps in link:http://www.machinekit.io/docs/getting-started/installing-packages[Machinekit docs] + +If you already have Machinekit installed make sure it is up to date: +[source, bash] +---- + sudo apt-get update + sudo apt-get upgrade +---- + +In some cases you need a `dist-upgrade` to upgrade packages from non-debian repositories. +[source, bash] +---- + sudo apt-get dist-upgrade +---- + +NOTE: +When executing the `dist-upgrade`, make sure you have only the Debian and the Machinekit repositories activated. + +Alternatively, you can update the relevant Machinekit packages manually by running `sudo apt-get install `. + +=== Prepare Machinekit +To enable remote communication you have to set `REMOTE` variable to `1` in the ini-file: +[source, bash] +---- + sudo nano /etc/linuxcnc/machinekit.ini +---- + +NOTE: +Enable remote communications only in a *secured private network*. At the moment Machinetalk has no security layer. + + +=== Prepare your Configs + +To use mkwrapper and Machinetalk for your existing configurations you have to do 3 modifications. + +==== Modify the INI-file + +Linuxcnc needs to know which user-inferface it should use. For mkwrapper you need to edit following in the *DISPLAY* section: +[source, ini] +---- + DISPLAY = mkwrapper + INTRO_GRAPHIC = + INTRO_TIME = 0 +---- + +==== Modify the HAL-file + +For some user-interface you need a running Haltalk server. You can add one to you existing configuration by adding following in the beginning of the HAL-file: +[source, hal] +---- + # start haltalk server + loadusr -W haltalk +---- + +==== Create a Run-Script + +Machinekit configurations need a few actions to be performed before linuxcnc can start. Take a look at the following script and modify it to fit your configuration. + +Name it `.py` and run `chmod +x ` to make it executable. + +NOTE: +The example run script contains commands that you may not need for your specific setup. +Please *read the comments* carefully and *uncomment and modify commands* that you may need for your setup. + + +[source, python] +---- +#!/usr/bin/python + +import sys +import os +import subprocess +import importlib +from machinekit import launcher +from time import * + + +launcher.register_exit_handler() +launcher.set_debug_level(5) +os.chdir(os.path.dirname(os.path.realpath(__file__))) + +try: + launcher.check_installation() # make sure the Machinekit installation is sane + launcher.cleanup_session() # cleanup a previous session + # Uncomment and modify the following line if you create a configuration for the BeagleBone Black + # launcher.load_bbio_file('myoverlay.bbio') # load a BeagleBone Black universal overlay file + # Uncomment and modify the following line of you have custom HAL components + # launcher.install_comp('gantry.comp') # install a comp HAL component if not already installed + launcher.start_process("configserver ~/Machineface ~/Cetus/") # start the configserver with Machineface an Cetus user interfaces + launcher.start_process('linuxcnc xyz.ini') # start linuxcnc +except subprocess.CalledProcessError: + launcher.end_session() + sys.exit(1) + +# loop until script receives exit signal +# or one of the started applications exited incorrectly +# cleanup is done automatically +while True: + sleep(1) + launcher.check_processes() +---- + +==== Modifications for 3D Printers +The Machineface user interface is especially designed for controlling 3D printers. + +Therefore it features some additional controls for heatbed, extruder temperature and more. + +It implements following a set of link:https://github.com/strahlex/TCT3D/blob/revision2/UNIPRINT-3D.ini#L86[MCodes] as well as a few +link:https://github.com/strahlex/TCT3D/blob/revision2/UNIPRINT-3D.hal#L610[HAL signals] + +You may also want to take a look at the source code of Machineface: link:https://github.com/strahlex/Machineface/blob/master/Machineface/DisplayPanel.qml#L54[DisplayPanel.qml] + +=== Cloning the User Interfaces + +At the moment two user interfaces based on QtQuickVcp exist: + +link:https://github.com/strahlex/Machineface[Machineface]: a user interfaces designed for the use with small screens especially for 3D printers + +link:https://github.com/strahlex/Cetus.git[Cetus]: a full-featured user interfaces that should provide something like Axis + +Clone both user interfaces on your device with Machinekit installed. I recommend *forking the user interfaces on GitHub* and cloning the fork so you can push modifications upstream quickly. + +To modify these user interfaces a simple text editor is sufficient. Using a text editor with syntax highlighting for QML might improve the development experience. (e.g. Kate or Qt Creator) +[source, bash] +---- + git clone https://github.com/strahlex/Cetus.git + git clone https://github.com/strahlex/Machineface.git +---- + +=== Install the Machinekit-Client + +For desktop platforms (*Linux, Windows, Mac*) you can find binaries here: link:http://buildbot.roessler.systems/files/machinekit-client[Machinekit-Client releases] + +You can find the *Android* client link:https://play.google.com/store/apps/details?id=io.machinekit.appdiscover[here] +image:https://play.google.com/intl/en_us/badges/images/generic/en-play-badge.png[play,300,150,role="left"] + +Please note: the Android client installed on Android >= 5.0 is not able to discover Machinekit. + +If you an idea how to deploy the **iOS** client besides the Apple App Store please contact me. + +=== Test it +Now its time to start your configuration: + + ./.py + +It may be useful to start the configuration at boot: link:https://github.com/strahlex/asciidoc-sandbox/wiki/Starting-a-Machinekit-configuration-at-boot[Starting a Machinekit configuration at boot] + +Now start the Machinekit-Client on the desired platform. For some networks it may be necessary to enter the IP address of the Machinekit device manually (Unicast). + +=== Setup mklauncher +With newer versions of QtQuickVcp the entry point for the Machinekit-Client has been changed to the mklauncher service. +Please follow the steps here for more details link:https://github.com/strahlex/QtQuickVcp/wiki/Using-mklauncher[Using mklauncher] + +=== Using mklauncher +Mklauncher is the new entry point for Machinekit-Client. It acts as a remote version of the Machinekit Launcher. +Usage is quite simple +[source, bash] +---- +mklauncher --help +---- +for details + +The only thing you need to add to your Machinekit configarion is a `launcher.ini` file. + +[source, ini] +---- +[MendelMax] +name = MendelMax CRAMPS +description = DIY 3D printer +command = python run.py +variant = with one extruder +---- + +More examples can be found at link:https://github.com/strahlex/MendelMax-CRAMPS/blob/master/launcher.ini[MendelMax-CRAMPS] +and link:https://github.com/thecooltool/machinekit-configs/blob/master/launcher.ini[the-cooltool-config]. + +Once you have create a `launcher.ini` file and you configuration is ready for testing you can start mklauncher by typing following command: + +[source, bash] +---- +mklauncher . +---- + +The dot in the end means that mklauncher will recursively search for `launcher.ini` files in the current directory. +NOTE that this can be very slow if you do this in your home directory. + +Once you have successfully launched mklauncher you are ready to connect using the link:https://github.com/strahlex/MachinekitClient[Machinekit-Client] + +If you have a embedded Machinekit setup e.g. on the BeagleBone Black, it is recommended to start mklauncher at boot using systemd. +Use this guide for reference: + +link:https://github.com/strahlex/asciidoc-sandbox/blob/master/Starting-a-Machinekit-configuration-at-boot.md[Starting a Machinekit configuration at boot] +or use this script link:https://gist.github.com/strahlex/3eaa42f79f7a19e2244a[register.py]. + + + +== Contributing + +=== Work flow +* Create an issue in the issue tracker (e.g. Fan control missing) +* Fork the git repository. +* After you have coded some cool new stuff please create a pull request and link it to the issue. + + +=== Building and installing +QtQuickVcp is very versatile and is available for following platforms: + +* Windows Vista or newer +* OS X Mavericks or newer +* Linux (tested on Debian Jessie) +* Android 4.x or newer +* iOS (no binaries yet) + +Please note that intalling QtQuickVcp can be very cumbersome for most +platforms. However, since QtQuickVcp use **remote deployment** of it +is not necessary that you build QtQuickVcp e.g. for Android. Instead +please **take the easy way** and use the +link:https://github.com/strahlex/machinekit-vagrant[Machinekit Vagrant box] +for development. + +The link:https://github.com/strahlex/MachinekitClient[Machinekit-Client] serves +as universal client application. You can download binaries for all +supported platforms. + +Please only try to build and install QtQuickVcp +on you own if you feel confident to do so and if you plan to +contribute to the QtQuickVcp project. + +=== Easy Way - Vagrant +The easiest way to get a running MachinekitSDK, QtQuickVcp and Machinekit installation is to use +the link:https://github.com/strahlex/machinekit-vagrant[Vagrant configuration]. + +Follow the steps provided in the repository and you will have a working installation with a few clicks. + +=== Generic Requirements + +QtQuickVcp has the following requirements: + +* link:http://qt-project.org/downloads[Qt SDK] with Qt 5.2.1 or newer (Qt5.6 preferred) + +NOTE: +Qt 5.4.2 to Qt 5.5.1 will not work on Linux + +* link:https://developers.google.com/protocol-buffers[Protocol Buffers] - version 2.5.1 or newer +* link:http://zeromq.org[ZeroMQ] - version 3.x or newer + +=== Android + +Build instruction for Android toolchain on Linux + +==== Prerequisites + +* Install link:http://www.qt.io/download-open-source[Qt SDK for Android] +* Download and extract link:http://developer.android.com/ndk/downloads/index.html[Android NDK] + and link:http://developer.android.com/sdk/index.html#Other[Android SDK] to `~/bin` + +==== Stand-alone Android toolchain + +First create a Android Stand-alone toolchain: +[source, bash] +---- + sudo ~/bin/android-ndk/build/tools/make-standalone-toolchain.sh \ + --install-dir=/opt/android-toolchain --arch=arm + export PATH=/opt/android-toolchain/bin:$PATH +---- + +==== libsodium +**Not yet necessary. You can skip this step.** +[source, bash] +---- + git clone https://github.com/jedisct1/libsodium.git + cd libsodium + git checkout v1.0.8 + sh autogen.sh + ./configure --enable-static --disable-shared --prefix=$OUTPUT_DIR + make + sudo make install +---- + +==== ZeroMQ +Alter and execute the following commands +[source, bash] +---- + mkdir tmp + cd tmp/ + + export OUTPUT_DIR=/opt/zeromq-android + export RANLIB=/opt/android-toolchain/bin/arm-linux-androideabi-ranlib + + git clone https://github.com/zeromq/zeromq4-x.git + cd zeromq4-x/ + git checkout v4.0.7 + + # fix compile problems + mv tools/curve_keygen.c tools/curve_keygen.cpp + sed -i 's/\.c\>/&pp/' tools/Makefile.am + rm -f tools/.deps/curve_keygen.Po + + ./autogen.sh + ./configure --enable-static --disable-shared --host=arm-linux-androideabi \ + --prefix=$OUTPUT_DIR LDFLAGS="-L$OUTPUT_DIR/lib" CPPFLAGS="-fPIC \ + -I$OUTPUT_DIR/include" LIBS="-lgcc" + make + sudo make install + + cd .. +---- + +==== Protobuf + +[source, bash] +---- + export PATH=/opt/android-toolchain/bin:$PATH + export CFLAGS="-fPIC -DANDROID -nostdlib" + export CC=arm-linux-androideabi-gcc + export CXX=arm-linux-androideabi-g++ + export NDK=~/bin/android-ndk + export SYSROOT=$NDK/platform/android-9/arch-arm + export OUTPUT_DIR=/opt/protobuf-android + + # Latest and greatest, you might prefer 2.5.0 since it is usually installed in your distro + git clone https://github.com/google/protobuf.git + cd protobuf + git checkout v2.6.1 + + ./autogen.sh + ./configure --enable-static --disable-shared --host=arm-eabi --with-sysroot=$SYSROOT \ + CC=$CC CXX=$CXX --enable-cross-compile --with-protoc=protoc LIBS="-lc" --prefix=$OUTPUT_DIR + make + sudo make install +---- + +=== Mac - OS X and iOS +==== Prerequisites +- Update link:http://www.apple.com/osx/how-to-upgrade[OSX to the latest version] (or you may not be able to deploy to your device) +- Install link:https://itunes.apple.com/us/app/xcode/id497799835[XCode from the App Store] +- Install link:http://railsapps.github.io/xcode-command-line-tools.html[XCode command line tools] +- Install link:http://www.macports.org/install.php[MacPorts] +- Install link:http://www.qt.io/download-open-source[Qt SDK for Mac OSX and iOS] + +Then run +[source, bash] +---- + sudo port selfupdate + sudo port install libtool automake m4 autoconf pkgconfig +---- + +==== ZeroMQ +===== OSX +Install ZeroMQ to `/opt/local` +[source, bash] +---- + git clone https://github.com/zeromq/zeromq4-x.git + cd zeromq4-x + git checkout v4.0.7 + sh autogen.sh + ./configure --disable-static --enable-shared --prefix=/opt/local CC=clang CXX=clang++ \ + CXXFLAGS="-std=c++11 -stdlib=libstdc++ -O3" LDFLAGS="-stdlib=libstdc++" + make + sudo make install +---- + +===== iOS +Installs ZeroMQ libraries for iOS to `/opt/zeromq-ios` +[source, bash] +---- + git clone https://github.com/strahlex/libzmq-ios + cd libzmq-ios + chmod +x libzmq-ios.sh + sudo ./libzmq-ios.sh +---- + +==== Protobuf + +===== OSX +Since Yosemite one needs to compile a protobuf library that is compatible with libstdc++. +[source, bash] +---- + git clone https://github.com/google/protobuf.git + cd protobuf + git checkout v2.6.1 + sh autogen.sh + ./configure --disable-shared --enable-static --prefix=/opt/local CC=clang CXX=clang++ \ + CXXFLAGS="-std=c++11 -stdlib=libstdc++ -O3" LDFLAGS="-stdlib=libstdc++" + make + sudo make install +---- +=== iOS +See link:https://gist.github.com/strahlex/847dc5f320a21f1a9977[this] which installs protobuf to `/opt/protobuf-ios` +[source, bash] +---- + curl https://gist.githubusercontent.com/strahlex/847dc5f320a21f1a9977/raw/f3baa89c9aa7ff3300d4453b847fc3d786d02ba8/build-protobuf-2.6.1.sh --output build-protobuf-2.6.1.sh + chmod +x build-protobuf-2.6.1.sh + sudo ./build-protobuf-2.6.1.sh +---- + +=== Linux +The following steps are tested on **Debian Jessie**. For other +distributions please use the äquivalent packages if available. + +**VirtualBox users** see +link:https://github.com/strahlex/machinekit-vagrant[Machinekit Vagrant] + +Do not enable 3D acceleration or OpenGL will not work inside the VM. + +==== Prerequisites +[source, bash] +---- + sudo apt-get update + sudo apt-get install build-essential gdb dh-autoreconf libgl1-mesa-dev libxslt1.1 git +---- + +==== Protobuf and ZeroMQ packages +[source, bash] +---- + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 43DDF224 + sudo sh -c \ + "echo 'deb http://deb.machinekit.io/debian jessie main' > \ + /etc/apt/sources.list.d/machinekit.list" + sudo apt-get update + sudo apt-get install pkg-config libprotobuf-dev protobuf-compiler libzmq3-dev +---- + +==== Protobuf from source +[source, bash] +---- + git clone https://github.com/google/protobuf.git + cd protobuf + git checkout v2.6.1 + ./autogen.sh + ./configure + make + sudo make install +---- +==== ZeroMQ from source +[source, bash] +---- + git clone https://github.com/zeromq/zeromq4-x.git + cd zeromq4-x/ + git checkout v4.0.7 + ./autogen.sh + ./configure # add other options here + make + make check + sudo make install +---- + +=== Windows +If you want to use Windows in a VirtualBox VM please enable 3D acceleration for Qt to work properly. + +==== Prerequisites +- Install everything to `C:\bin` +- Install Microsoft Visual Studio of your choice +- link:https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx[2015 Community Edition] +- link:https://www.microsoft.com/en-us/download/details.aspx?id=44914[2013 Express Edition] +- Install link:http://www.qt.io/download-open-source/[Qt SDK] for Windows (Use the MSVC2015 or MSVC2013 version depending on Visual Studio) +- Install a Git command line client (VS2015 comes with Git, link:https://git-for-windows.github.io[Git for Windows] is also fine, select add to Windows Path in setup) +- Create a link from your users directory to `C:\bin` +- Run in cmd window as administrator: `mklink /D C:\Users\%USERNAME%\bin C:\bin` + +==== ZeroMQ +Open a cmd window: +[source, bash] +---- + cd C:\bin + git clone https://github.com/zeromq/zeromq4-x.git + cd zeromq4-x + git checkout v4.0.7 +---- + +Now start Visual Studio and open the solution `C:\zeromq4-x\builds\msvc\msvc11.sln` say yes to migrating the project to the new format. + +Wait a few seconds until parsing the header files is finished. Then select the Release build. + +Now right click on the libzmq project in the Solutions Explorer and click build. + +Now select the x64 build. + +Now right click on the `libzmq11` project in the Solutions Explorer and click build. + +Copy the `libzmq.dll` and `libzmq.pdb` files from `zeromq4-x\bin\Win32` to the `Qt\\\bin` folder. + +Same for `x64` + +==== Protobuf +Open a cmd window: +[source, bash] +---- + cd C:\bin + git clone https://github.com/google/protobuf.git + cd protobuf + git checkout v2.6.1 +---- + +Now start Visual Studio and open the solution `C:\protobuf\vsprojects\protobuf.sln` say yes to migrating the project to the new format. + +Wait a few seconds until parsing the header files is finished. Then select the Release build. + +Now right click on the libprotobuf project in the Solutions Explorer and click build. See MSVC2015 below + + +Repeat this step for libprotobuf-lite, libprotoc and protoc. + +Copy the `libprotobuf.lib` files from `protobuf\vsprojects\Release` to the `Qt\\\lib` folder. + +Copy the `libprotobuf.pdb` files from `protobuf\vsprojects\Release` to the `Qt\\\bin` folder. + +Repeat for `x64` in `protobuf\vsprojects\x64\Release`. + +==== MSVC2015 +Even if you have the option to use MSVC2015, use MSVC2013 instead by changing the platform tool set to Visual Studio 2013, +as you will get this kind of compiler error with MSVC2015: +[source, bash] +---- +error C2338: is deprecated and will be REMOVED. Please use . +You can define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS to acknowledge that you have received this warning. +---- + +If MSVC2015 is the only option you have, add `_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS=1;` to "Preprocessor Definitions" entry under Project Properties. +See also link:http://stackoverflow.com/q/30430789/4599792[C++ Hash Deprecation Warning] + +=== Building QtQuickVcp + +After you have all the requirements installed clone and build the link:https://github.com/strahlex/QtQuickVcp[QtQuickVcp repo] +[source, bash] +---- + git clone https://github.com/strahlex/QtQuickVcp +---- + +Before building the project **modify the paths.pri file if necessary**. + +==== Build from Qt Creator +Open Qt Creator and open the QtQuickVcp.pro file. Select the Qt version you want to build against. +Before building the project add these additional make commands to your project settings: +`install, docs and install_docs` + +image::../images/qtc_build_settings.png[qtc-build,600,400] + +Build the project in release mode (or debug mode if you want to debug QtQuickVcp and you application). Now you should have a working QtQuickVcp installed to your Qt version. + +==== Setup Qt Creator +Per default Qt Creator's QtQuick designer does not work with custom QML modules. Therefore, it is necessary to enable building a working QML emulation layer. +This can be done in the Qt Creator preferences *Tools > Options...* in the *Qt Quick register* by selecting the *Use QML emulation layer that is built by the selected Qt* option. +The build path is automatically completed. + +image::../images/qtc_qml_emulation.png[qtc_qml,600,400] + +==== Build from command line (Linux only) +The following steps assume that you have the Qt SDK installed in `~/bin/Qt/` +[source, bash] +---- + # set QMAKE + QMAKE=~/bin/Qt/5.*/gcc*/bin/qmake + QT_INSTALL_PREFIX=~/bin/Qt/5.*/gcc* + + # download and install QtQuickVcp + git clone https://github.com/strahlex/QtQuickVcp + mkdir -p build/QtQuickVcp + cd build/QtQuickVcp + + $QMAKE ../../QtQuickVcp + make + make docs + make install + make install_docs +---- + +=== MachinekitSDK +If you also want to have QtQuickVcp specific wizards and extensions +for QtCreator please continue with the install instructions for the [MachinekitSDK](https://github.com/strahlex/MachinekitSDK) + +== Developing QtQuickVcp +This section is for developers who want to extend the functionality of QtQuickVcp. + +If you are new to Qt and/or QtQuick I would recommend you to read the Qt documentation and follow the getting started and tutorials: http://qt-project.org/doc/qt-5/gettingstartedqml.html + +=== Choosing the right QML module +QtQuickVcp is split into several QML modules: + +- *Machinekit.HalRemote* - Non GUI HAL remote pins and components +- *Machinekit.HalRemote.Controls* - UI items such as Slider and ProgressBar combined with HAL pins +- *Machinekit.Controls* - Generic UI items not combined with HAL pins (can be used for non HAL projects) +- *Machinekit.PathView* - GCode path and progress views +- *Machinekit.VideoView* - Video views, e.g. for mjpeg-webcam streams + + +You can find these modules as *separate folders* inside the *src* folder of QtQuickVcp. E.g. the folder +containing the module *Machinekit.HalRemote* is *src/halremote* + +=== Creating new QML based Components + +QML files are the preferred way of creating new visual QtQuickVcp Components. Just create a new QML file +using the New File dialog and then you can either use the Qt Quick Desinger or the text editor to develop +your components. I recommend you to use the text editor as you will learn how to use make use of QtQuick faster and the Designer is currently far from perfect. + +A good way to start is looking at the existing QML Components and how they are implemented. +Please make sure you make use of http://qt-project.org/doc/qt-5/qtquick-usecase-layouts.html[anchors or layout] based positioning wherever possible as it saves computation power and makes your UIs scaleable. + +=== Adding QML files to the QML module + +You need to add the newly created QML files to following places in order to make them work when the QML module is deployed. + +- *.pro file of the module* to the *QML_FILES* variable +- *.qrc file of the module* +- *plugin.cpp of the module* to the *qmldir structure* +- *.metainfo file in designer folder* + +=== Creating new C++ based Components +For some functionality it is necessary to develop C\++ based QtQuickVcp Components. This may include visual items that need access to native OpenGL painting instructions, visual items that use QPainter to paint on a canvas and non visual items that need performance, access to Qt/C++ functionality or native C/C++ libraries. + +=== Adding C++ classes to the QML module + +You need to add the C++ classes to following places in order to make them work when the QML module is deployed. + +- *plugin.cpp of the module* with *qmlRegisterType* +- *.metainfo file of the Qt Quick Designer plugin* + +=== Creating a new QML module + +TODO + +=== Adding the QML module to the project + +- `QtQuickVcp.pro (OTHER_FILES, doc folder)` +- src/src.pro +- `doc/config/qtquickvcp-project.qdocconf (sourcedirs)`