97 lines
4.4 KiB
Plaintext
97 lines
4.4 KiB
Plaintext
/*!
|
|
\example template
|
|
\title 1. Plugin wizard
|
|
\ingroup tutorials
|
|
\brief Explanation of the Qt Creator plugin wizard template
|
|
|
|
|
|
This tutorial shows you how to start a new plugin project using the nymea-qtcreator wizard. You can find the source code of the
|
|
qt-creator wizard on our \l{https://github.com/guh/nymea-qtcreator-wizards}{github page}.
|
|
|
|
|
|
\section1 Create the plugin project
|
|
|
|
Once you have installed all packages required for development, you can open the Qt Creator and start a new project.
|
|
If you need help with the overall Qt Creator project creation, you can find more information
|
|
\l{http://doc.qt.io/qtcreator/creator-project-creating.html}{here}.
|
|
|
|
\section2 Choose template
|
|
In the template view cou can find now the nymea section. In that section you can find the template for a new plugin.
|
|
\image plugin-template-1.png Create a new plugin
|
|
|
|
|
|
\section2 Project location
|
|
Choose the project name and the path where the project should be located. As in this example the name is \e{template}
|
|
and will be used within the source code as refference. A good practice is to pick a general describing name like a vendor
|
|
or product/project name.
|
|
\image plugin-template-2.png Project location
|
|
|
|
\section2 Plugin details
|
|
In this section the plugin details can be defined.
|
|
|
|
In the first part you can find the c++ specific definitions:
|
|
\list
|
|
\li \b{Class name}: Enter the name of the main class for this device plugin.
|
|
The naming should be \tt{DevicePlugin\e{Name}} in camel case.
|
|
\endlist
|
|
|
|
In the second part you can find the json specific definitions:
|
|
\list
|
|
\li \b{Vendor name}: Enter the name of the \l{Vendor}.
|
|
\li \b{Device name}: Enter the name for the default device which will be created as template.
|
|
You can change this any time in the json file.
|
|
\li \b{Setup method}: Pick the desired setup method for the default device which will be created as template.
|
|
You can change this any time in the json file. You can find more information in the
|
|
\l{CreateMethods and SetupMethods} section.
|
|
\li \b{Create method}: Pick the desired create method for the default device which will be created as template.
|
|
You can change this any time in the json file.
|
|
\li \b{Icon}: Pick the desired icon for the default device which will be created as template.
|
|
You can change this any time in the json file.
|
|
\endlist
|
|
|
|
See also the \l{CreateMethods and SetupMethods} section.
|
|
|
|
\image plugin-template-3.png Plugin details
|
|
|
|
\section2 Developer information
|
|
Enter the name and email address of the developer for this plugin. These information will be used in the
|
|
copyright sections of the plugin. The copyright information are placed in the \tt{debian/copyright} file and in each
|
|
source code license header.
|
|
\image plugin-template-4.png Developer information
|
|
|
|
\section2 Kit selection
|
|
Pick the build kit for this project. The kit must match the version of the \tt{nymead} and \tt{libnymea1} built.
|
|
|
|
\note: You have to make sure you are using the \underline{same kit} as the nymea daemon and libraries use. If you have installed the
|
|
\underline{nymea library} and \underline{Qt libraries} from you default system package manager, you should probably go with the
|
|
default kit of your distribution.
|
|
|
|
\image plugin-template-5.png Kit selection
|
|
|
|
\section2 Project Management
|
|
Here you can select your prefered project management tool. If you choose git,
|
|
the default \tt{.gitignore} file will be added to the project.
|
|
|
|
\image plugin-template-6.png Project Management
|
|
|
|
\section2 Project tree
|
|
Once you finished the plugin wizard, you can start with the development of you plugin.
|
|
\image plugin-template-7.png Project tree
|
|
|
|
\section1 Walk trough
|
|
|
|
Starting with the new created project you can find following files in you project:
|
|
|
|
\section2 template.pro
|
|
|
|
\quotefile template/template.pro
|
|
|
|
\section2 deviceplugintemplate.json
|
|
|
|
Here you can find the device plugin interface describibg the vendors, devices and plugin information.
|
|
A detailed description of each section can be found in the \l{The plugin JSON File} section.
|
|
|
|
\quotefile template/deviceplugintemplate.json
|
|
|
|
*/
|