1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

Merged in filnet/librepilot/misc_fixes (pull request #484)

Misc fixes

Approved-by: Lalanne Laurent <f5soh@free.fr>
Approved-by: Philippe Renon <philippe_renon@yahoo.fr>
Approved-by: Paul Jewell <paul@teulu.org>
This commit is contained in:
Philippe Renon 2018-01-24 20:13:30 +00:00 committed by Lalanne Laurent
commit fcf25d1e5d
11 changed files with 6 additions and 444 deletions

View File

@ -50,8 +50,6 @@ HEADERS += \
basevalidatinglineedit.h \
linecolumnlabel.h \
qtcolorbutton.h \
abstractprocess.h \
consoleprocess.h \
synchronousprocess.h \
treewidgetcolumnstretcher.h \
checkablemessagebox.h \

View File

@ -1,43 +0,0 @@
/**
******************************************************************************
*
* @file emptygadgetwidget.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @addtogroup GCSPlugins GCS Plugins
* @{
* @addtogroup EmptyGadgetPlugin Empty Gadget Plugin
* @{
* @brief A place holder gadget plugin
*****************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef EMPTYGADGETWIDGET_H_
#define EMPTYGADGETWIDGET_H_
#include <QtGui/QLabel>
class EmptyGadgetWidget : public QLabel {
Q_OBJECT
public:
EmptyGadgetWidget(QWidget *parent = 0);
~EmptyGadgetWidget();
private:
};
#endif /* EMPTYGADGETWIDGET_H_ */

View File

@ -55,7 +55,7 @@
<displayVideo>true</displayVideo>
<pipelineDesc>ximagesrc ! tee name=t
t. ! queue ! timeoverlay ! autovideosink
t. ! queue ! videoconvert ! x264enc tune=zerolatency tune=zerolatency bitrate=498 ! mpegpsmux ! filesink location=capture.mpg</pipelineDesc>
t. ! queue ! videoconvert ! x264enc tune=zerolatency bitrate=498 ! mpegpsmux ! filesink location=capture.mpg</pipelineDesc>
<pipelineInfo></pipelineInfo>
<respectAspectRatio>true</respectAspectRatio>
</data>
@ -101,7 +101,7 @@
<displayVideo>true</displayVideo>
<pipelineDesc>v4l2src ! tee name=t
t. ! queue ! timeoverlay ! autovideosink
t. ! queue ! videoconvert ! x264enc tune=zerolatency tune=zerolatency bitrate=498 ! mpegpsmux ! filesink location=capture.mpg</pipelineDesc>
t. ! queue ! videoconvert ! x264enc tune=zerolatency bitrate=498 ! mpegpsmux ! filesink location=capture.mpg</pipelineDesc>
<pipelineInfo></pipelineInfo>
<respectAspectRatio>true</respectAspectRatio>
</data>

View File

@ -55,7 +55,7 @@
<displayVideo>true</displayVideo>
<pipelineDesc>avfvideosrc capture-screen=true capture-screen-cursor=true ! tee name=t
t. ! queue ! timeoverlay ! autovideosink
t. ! queue ! videoconvert ! x264enc tune=zerolatency tune=zerolatency bitrate=498 ! mpegpsmux ! filesink location=capture.mpg</pipelineDesc>
t. ! queue ! videoconvert ! x264enc tune=zerolatency bitrate=498 ! mpegpsmux ! filesink location=capture.mpg</pipelineDesc>
<pipelineInfo></pipelineInfo>
<respectAspectRatio>true</respectAspectRatio>
</data>
@ -101,7 +101,7 @@
<displayVideo>true</displayVideo>
<pipelineDesc>avfvideosrc ! tee name=t
t. ! queue ! timeoverlay ! autovideosink
t. ! queue ! videoconvert ! x264enc tune=zerolatency tune=zerolatency bitrate=498 ! mpegpsmux ! filesink location=capture.mpg</pipelineDesc>
t. ! queue ! videoconvert ! x264enc tune=zerolatency bitrate=498 ! mpegpsmux ! filesink location=capture.mpg</pipelineDesc>
<pipelineInfo></pipelineInfo>
<respectAspectRatio>true</respectAspectRatio>
</data>

View File

@ -55,7 +55,7 @@
<displayVideo>true</displayVideo>
<pipelineDesc>dx9screencapsrc monitor=0 cursor=true ! tee name=t
t. ! queue ! timeoverlay ! autovideosink
t. ! queue ! videoconvert ! x264enc tune=zerolatency tune=zerolatency bitrate=498 ! mpegpsmux ! filesink location=capture.mpg</pipelineDesc>
t. ! queue ! videoconvert ! x264enc tune=zerolatency bitrate=498 ! mpegpsmux ! filesink location=capture.mpg</pipelineDesc>
<pipelineInfo></pipelineInfo>
<respectAspectRatio>true</respectAspectRatio>
</data>
@ -115,7 +115,7 @@
<displayVideo>true</displayVideo>
<pipelineDesc>ksvideosrc device-index=0 ! tee name=t
t. ! queue ! timeoverlay ! autovideosink
t. ! queue ! videoconvert ! x264enc tune=zerolatency tune=zerolatency bitrate=498 ! mpegpsmux ! filesink location=capture.mpg</pipelineDesc>
t. ! queue ! videoconvert ! x264enc tune=zerolatency bitrate=498 ! mpegpsmux ! filesink location=capture.mpg</pipelineDesc>
<pipelineInfo></pipelineInfo>
<respectAspectRatio>true</respectAspectRatio>
</data>

View File

@ -1,200 +0,0 @@
This set of scripts is to provide a unix-like build environment on Windows.
---------------------------------------------------------------------------
1. Why do I need it?
2. How to install?
3. How to use it?
3.1. Interactive mode
3.2. Batch mode
4. Advanced usage
5. Limitations of use
6. Credits and license
1. Why do I need it?
--------------------
It allows to use the "Big Hammer", that is, to build whole OpenPilot system
with a single command "make all" using the top level Makefile originally
written for Linux and Mac only.
Also any routine task automation could use the same set of scripts and commands
on all platforms (Linux, Mac and Windows) if scripts are written in the shell
language. It is particularly important for cross-paltform projects like the
OpenPilot.
2. How to install?
------------------
Fortunately, it requires only few small text files since all others components
should already be installed on your system as parts of msysGit, QtSDK and
Arm compiler packages required to build the OpenPilot.
It is expected that you have the following tools installed into the listed
locations (but any other locations are fine as well):
- Python in C:\Python27
- QtSDK in C:\QtSDK (depending on SDK version)
- CodeSourcery G++ in %ProgramFiles%\CodeSourcery\Sourcery G++ Lite
- msysGit in %ProgramFiles%\Git
- Unicode NSIS in %ProgramFiles%\NSIS\Unicode
- OpenOCD in C:\OpenOCD\0.4.0\bin (optional)
The SDL and SSL libraries and headers should be installed into Qt directories to
build the GCS. Check the wiki or ground/gcs/copydata.pro for details.
Also it is assumed that you have the C:\Program Files\Git\cmd\ directory in
the PATH. Usually this is the case for msysGit installation if you have chosen
the 2nd option: put only git and gitk in the PATH (it is recommended option).
Now you need to copy few files to your msysGit installation folders.
Assuming that you installed the msysGit into C:\Program Files\Git\,
you have to copy:
make\winx86\bin\* -> C:\Program Files\Git\bin\
make\winx86\cmd\* -> C:\Program Files\Git\cmd\
If you have msysGit installed into another directory, you need to update paths
accordingly. Also if you have tools installed into different directories and
they are not in the PATH, then you may want to update paths in the sh.cmd
script too (it is self-documented).
Note for Windows 64-bit users: 64-bit systems use %ProgramFiles(x86)% folder
as default for program files instead of %ProgramFiles%. You have to check where
your tools are installed and update paths above accordingly.
3. How to use it?
-----------------
3.1. Interactive mode
---------------------
1) Type:
C:\> sh
and the bash prompt should appear:
user@pc /
$
2) Enter your OpenPilot directory:
user@pc /
$ cd D:/Work/OpenPilot/git
user@pc /d/Work/OpenPilot/git (master)
$
Note the current git branch in parentheses (master), if it exists. The path
format is also printed according to MSYS notation. And you have to use forward
slashes in paths, not backslashes.
3) Enter make command with required options and target list:
user@pc /d/Work/OpenPilot/git (master)
$ make all
The building should be started, and you will have full system including ground
software and flight firmware built in the end.
4) To build parts of the system you can use, for example, such commands:
user@pc /d/Work/OpenPilot/git (master)
$ make -j2 GCS_BUILD_CONF=release gcs coptercontrol
or to completely remove the build directory:
user@pc /d/Work/OpenPilot/git (master)
$ make all_clean
3.2. Batch mode
---------------
1) Create a shell script file containing all required commands, for instance:
#!/bin/sh
# This is the cc_make_release.sh file used to build CC release software
cd D:/Work/OpenPilot/git
make -j2 GCS_BUILD_CONF=release gcs coptercontrol
echo RC=$?
2) Run it typing:
C:\> sh cc_make_release.sh
3) Of course, a lot of other shell commands can be used in scripts.
4. Advanced usage
-----------------
It is possible to go further and integrate shell scripting into Windows system
like any other executables. This allows:
- double click on any .sh file in the Explorer window to execute it;
- type name of .sh file with any arguments on the command line to run script;
- omit .sh extension typing names since it is now recognized automatically;
- call .sh scripts even from .bat and .cmd files as Windows command;
- execute scripts which are in any directory in the PATH;
- return and check exit code from .sh scripts to .bat or .cmd batch files.
In short, you may have quite powerful and cross-platform bash scripting on
Windows.
In order to integrate bash scripting into Windows system you need to:
- double click on the included shell_script.reg file to register .sh
extension in the system. Thus, any click on .sh script will execute it
automatically assuming that the sh.cmd is in the PATH;
- register .sh extension as an executable file type, so you can omit the
.sh typing commands. To do so open "My Computer" properties dialog, choose
the "Advanced" tab, "Environment variables", in the "System variables"
find the variable called "PATHEXT". It contains the list of "executable"
file extensions separated by semicolon. You want to add a ";.SH" to the
end of its value. Then click OK to apply.
Now any .sh script can be run just by typing its name, optionally with
parameters.
As an example, you can create a shell script named make.sh in the cmd/
subdirectory of Git installation with the following content:
exec /bin/make $*
and then build the OpenPilot software typing
make all
directly from Windows command line or from a batch file.
You also may want to rename or remove "C:\Program Files\Git\etc\motd" file
to get rid of git bash welcome message on every script invocation.
5. Limitations of use
---------------------
Currently there may be some problems running scripts which contain spaces in
file names or located in directories which contain spaces in full paths.
It results in strange "file not found" or other errors.
It is recommended to avoid using such names with spaces.
6. Credits and license
----------------------
This set of scripts uses the MSYS package included into the msysGit
distribution and MinGW make included into the QtSDK package.
The sh.cmd, shell_script.reg and this README.txt files were written
by Oleg Semyonov (os@openpilot.org) for the OpenPilot project and
are licensed under CC-BY-SA terms:
http://creativecommons.org/licenses/by-sa/3.0/
Feel free to contact me for additions and improvements.
Happy bashing!

View File

@ -1,15 +0,0 @@
#!/bin/sh
#
# simple install command replacement for Windows
#
# This file should be put into C:\Program Files\Git\bin\ subdirectory
# (or similar, depeding on where the msysGit package was installed)
# to provide a make command to unix-like build environment on Windows.
#
# See also:
# README.txt
# http://wiki.openpilot.org/display/Doc/GCS+Development+on+Windows
# http://wiki.openpilot.org/display/Doc/Firmware+Development+on+Windows
#
cp -f $*

View File

@ -1,15 +0,0 @@
#!/bin/sh
#
# make command replacement for Windows
#
# This file should be put into C:\Program Files\Git\bin\ subdirectory
# (or similar, depeding on where the msysGit package was installed)
# to provide a make command to unix-like build environment on Windows.
#
# See also:
# README.txt
# http://wiki.openpilot.org/display/Doc/GCS+Development+on+Windows
# http://wiki.openpilot.org/display/Doc/Firmware+Development+on+Windows
#
mingw32-make.exe $*

View File

@ -1,9 +0,0 @@
#
# make command replacement to run from command prompt under bash
#
# This file should be put into C:\Program Files\Git\cmd\ subdirectory
# (or similar, depeding on where the msysGit package was installed)
# to provide a shell prompt in the unix-like build environment on Windows.
#
exec /bin/make $*

View File

@ -1,135 +0,0 @@
@echo off
rem
rem This file should be put into C:\Program Files\Git\cmd\ subdirectory
rem (or similar, depeding on where the msysGit package was installed)
rem to provide a shell prompt in the unix-like build environment on Windows.
rem
rem Currently supported on NT-class systems only (Windows XP and above).
rem
rem See also:
rem README.txt
rem http://wiki.openpilot.org/display/Doc/GCS+Development+on+Windows
rem http://wiki.openpilot.org/display/Doc/Firmware+Development+on+Windows
rem
rem Based on the msys.bat file from the MSYS package
rem http://www.mingw.org/wiki/msys
rem
rem Shared directories for toolchains
rem set DL_DIR=C:/LibrePilot/downloads
rem set TOOLS_DIR=C:/LibrePilot/tools
rem this should let run MSYS shell on x64
if "%PROCESSOR_ARCHITECTURE%" == "AMD64" (
SET COMSPEC=%WINDIR%\SysWOW64\cmd.exe
)
rem some MSYS environment variables
if "x%MSYSTEM%" == "x" set MSYSTEM=MINGW32
if not "x%DISPLAY%" == "x" set DISPLAY=
rem --------------------------------------------------------------------------
rem To build the OpenPilot software we need few tools in the PATH.
rem Here we attempt to guess tools location searching in the given
rem directories first, and in the PATH last, if not found where expected.
rem
rem Please note that if you have few similar tools installed somewhere but
rem not in the expected location, and they are in the PATH, then the script
rem can detect wrong directories. For instance, if you have QtSDK installed
rem on the D: drive, but have separately installed MinGW toolkit which is
rem in the PATH, then this script detects this MinGW instead of QtSDK's one.
rem As a result, the SDL headers will not be found, if they were copied into
rem QtSDK's MinGW directory. In that case make sure that you have correct
rem directories specified here.
rem
rem Also the SDL should be installed into Qt directories to build the GCS.
rem Check the wiki or ground/gcs/copydata.pro for details.
rem
rem Also you can add any paths below just by adding extra 'call :which'
rem lines with the following parameters:
rem - environment variable which will be set to the tool location, if found;
rem - expected directory for the executable which will be searched first;
rem - any executable file which will be searched in the given directory
rem or in the PATH, if not found where expected.
rem All they will be added to the PATH in order of appearance.
rem --------------------------------------------------------------------------
set NOT_FOUND=
set PATH_DIRS=
rem Replace %ProgramFiles% by %ProgramFiles(x86)% for 64bit system
call :which MSYSGIT "%ProgramFiles%\Git\bin" git.exe
call :which QTMINGW "C:\QtSDK\mingw\bin" mingw32-make.exe
call :which QTSDK "C:\QtSDK\Desktop\Qt\4.8.1\mingw\bin" qmake.exe
call :which ARMGCC "C:\OpenPilot\gcc-arm-none-eabi-4_6-2012q4\bin" arm-none-eabi-gcc.exe
call :which PYTHON "C:\Python27" python.exe
call :which UNSIS "%ProgramFiles%\NSIS\Unicode" makensis.exe
if "%NOT_FOUND%" == "" goto set_path
echo:
echo Some tools were not found in the PATH or expected location:
for %%f in (%NOT_FOUND%) do echo %%f
echo You may want to install them and/or update paths in the %0 file.
echo:
rem --------------------------------------------------------------------------
rem Provide a clean environment for command line build. We remove the
rem msysGit cmd subdirectory as well, so no recursive sh call can occur.
rem --------------------------------------------------------------------------
:set_path
set PATH=%SYSTEMROOT%\system32;%SYSTEMROOT%
set PATH=%PATH_DIRS%;%PATH%
rem echo PATH: %PATH%
rem --------------------------------------------------------------------------
rem Start a shell.
rem Any shell script can be passed to it via command line of this batch file.
rem --------------------------------------------------------------------------
if not exist "%MSYSGIT%\bash.exe" goto no_bash
call "%MSYSGIT%\bash.exe" --login -i %*
goto :eof
:no_bash
echo Cannot find bash, exiting with error
exit 1
rem --------------------------------------------------------------------------
rem Attempt to find executable in the directory given or in the PATH
rem --------------------------------------------------------------------------
:which
rem search in the directory given first
for %%F in (%2) do set FP=%%~F\%3
if exist "%FP%" goto found_directly
rem search in the PATH last
for %%F in (%3) do set FP=%%~$PATH:F
if exist "%FP%" goto found_in_path
:not_found
for %%F in (%2) do set FP=%%~F
rem echo %3: not found, expected in %FP%
set FP=
set NOT_FOUND=%NOT_FOUND% %3
goto set
:found_directly
for %%F in ("%FP%") do set FP=%%~dpsF
rem echo %3: found at: %FP%
goto set
:found_in_path
for %%F in ("%FP%") do set FP=%%~dpsF
rem echo %3: found in the PATH: %FP%
:set
rem set results regardless of was it found or not
set %1=%FP%
rem echo %1=%FP%
if "%FP%" == "" goto :eof
if not "%PATH_DIRS%" == "" set PATH_DIRS=%PATH_DIRS%;
set PATH_DIRS=%PATH_DIRS%%FP%
goto :eof

View File

@ -1,19 +0,0 @@
REGEDIT4
[HKEY_CLASSES_ROOT\.sh]
@="shfile"
[HKEY_CLASSES_ROOT\shfile]
@="shell script"
"AlwaysShowExt"=""
"BrowserFlags"=dword:00000008
"EditFlags"=dword:00000000
[HKEY_CLASSES_ROOT\shfile\shell]
@=""
[HKEY_CLASSES_ROOT\shfile\shell\open]
[HKEY_CLASSES_ROOT\shfile\shell\open\command]
@="cmd.exe /c call sh \"%1\" %*"