1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-19 04:52:12 +01:00

initial changes

This commit is contained in:
Nickolay 2011-09-15 00:38:18 +03:00
parent 2f7f920ef3
commit 3af398d7f9
16 changed files with 865 additions and 593 deletions

View File

@ -0,0 +1,311 @@
<!DOCTYPE QtCreatorProject>
<qtcreator>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
<value type="int">0</value>
</data>
<data>
<variable>ProjectExplorer.Project.EditorSettings</variable>
<valuemap type="QVariantMap">
<value key="EditorConfiguration.Codec" type="QByteArray">System</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.Target.0</variable>
<valuemap type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Desktop</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Target.DesktopTarget</value>
<value key="ProjectExplorer.Target.ActiveBuildConfiguration" type="int">0</value>
<value key="ProjectExplorer.Target.ActiveRunConfiguration" type="int">0</value>
<valuemap key="ProjectExplorer.Target.BuildConfiguration.0" type="QVariantMap">
<valuemap key="ProjectExplorer.BuildConfiguration.BuildStep.0" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">qmake</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QtProjectManager.QMakeBuildStep</value>
<valuelist key="QtProjectManager.QMakeBuildStep.QMakeArguments" type="QVariantList"/>
</valuemap>
<valuemap key="ProjectExplorer.BuildConfiguration.BuildStep.1" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Make</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
<value key="Qt4ProjectManager.MakeStep.Clean" type="bool">false</value>
<valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"/>
<value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
</valuemap>
<value key="ProjectExplorer.BuildConfiguration.BuildStepsCount" type="int">2</value>
<valuemap key="ProjectExplorer.BuildConfiguration.CleanStep.0" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Make</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
<value key="Qt4ProjectManager.MakeStep.Clean" type="bool">true</value>
<valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList">
<value type="QString">clean</value>
</valuelist>
<value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
</valuemap>
<value key="ProjectExplorer.BuildConfiguration.CleanStepsCount" type="int">1</value>
<value key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment" type="bool">false</value>
<valuelist key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges" type="QVariantList"/>
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Qt in PATH Debug</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">2</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">D:/!Work/OpenSource/OpenPilot/op/OpenPilot/ground-build</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">2</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">2</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">true</value>
</valuemap>
<valuemap key="ProjectExplorer.Target.BuildConfiguration.1" type="QVariantMap">
<valuemap key="ProjectExplorer.BuildConfiguration.BuildStep.0" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">qmake</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QtProjectManager.QMakeBuildStep</value>
<valuelist key="QtProjectManager.QMakeBuildStep.QMakeArguments" type="QVariantList"/>
</valuemap>
<valuemap key="ProjectExplorer.BuildConfiguration.BuildStep.1" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Make</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
<value key="Qt4ProjectManager.MakeStep.Clean" type="bool">false</value>
<valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"/>
<value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
</valuemap>
<value key="ProjectExplorer.BuildConfiguration.BuildStepsCount" type="int">2</value>
<valuemap key="ProjectExplorer.BuildConfiguration.CleanStep.0" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Make</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
<value key="Qt4ProjectManager.MakeStep.Clean" type="bool">true</value>
<valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList">
<value type="QString">clean</value>
</valuelist>
<value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
</valuemap>
<value key="ProjectExplorer.BuildConfiguration.CleanStepsCount" type="int">1</value>
<value key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment" type="bool">false</value>
<valuelist key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges" type="QVariantList"/>
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Qt in PATH Release</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">0</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">D:/!Work/OpenSource/OpenPilot/op/OpenPilot/ground-build</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">2</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">2</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">true</value>
</valuemap>
<valuemap key="ProjectExplorer.Target.BuildConfiguration.2" type="QVariantMap">
<valuemap key="ProjectExplorer.BuildConfiguration.BuildStep.0" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">qmake</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QtProjectManager.QMakeBuildStep</value>
<valuelist key="QtProjectManager.QMakeBuildStep.QMakeArguments" type="QVariantList"/>
</valuemap>
<valuemap key="ProjectExplorer.BuildConfiguration.BuildStep.1" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Make</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
<value key="Qt4ProjectManager.MakeStep.Clean" type="bool">false</value>
<valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"/>
<value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
</valuemap>
<value key="ProjectExplorer.BuildConfiguration.BuildStepsCount" type="int">2</value>
<valuemap key="ProjectExplorer.BuildConfiguration.CleanStep.0" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Make</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
<value key="Qt4ProjectManager.MakeStep.Clean" type="bool">true</value>
<valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList">
<value type="QString">clean</value>
</valuelist>
<value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
</valuemap>
<value key="ProjectExplorer.BuildConfiguration.CleanStepsCount" type="int">1</value>
<value key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment" type="bool">false</value>
<valuelist key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges" type="QVariantList"/>
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">4.6.2 Debug</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">2</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">D:/!Work/OpenSource/OpenPilot/op/OpenPilot/ground-build</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">13</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">2</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">true</value>
</valuemap>
<valuemap key="ProjectExplorer.Target.BuildConfiguration.3" type="QVariantMap">
<valuemap key="ProjectExplorer.BuildConfiguration.BuildStep.0" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">qmake</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QtProjectManager.QMakeBuildStep</value>
<valuelist key="QtProjectManager.QMakeBuildStep.QMakeArguments" type="QVariantList"/>
</valuemap>
<valuemap key="ProjectExplorer.BuildConfiguration.BuildStep.1" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Make</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
<value key="Qt4ProjectManager.MakeStep.Clean" type="bool">false</value>
<valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"/>
<value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
</valuemap>
<value key="ProjectExplorer.BuildConfiguration.BuildStepsCount" type="int">2</value>
<valuemap key="ProjectExplorer.BuildConfiguration.CleanStep.0" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Make</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
<value key="Qt4ProjectManager.MakeStep.Clean" type="bool">true</value>
<valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList">
<value type="QString">clean</value>
</valuelist>
<value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
</valuemap>
<value key="ProjectExplorer.BuildConfiguration.CleanStepsCount" type="int">1</value>
<value key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment" type="bool">false</value>
<valuelist key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges" type="QVariantList"/>
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">4.6.2 Release</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">0</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">D:/!Work/OpenSource/OpenPilot/op/OpenPilot/ground-build</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">13</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">2</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">true</value>
</valuemap>
<value key="ProjectExplorer.Target.BuildConfigurationCount" type="int">4</value>
<valuemap key="ProjectExplorer.Target.RunConfiguration.0" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">bin</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4RunConfiguration</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.BaseEnvironmentBase" type="int">2</value>
<valuelist key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments" type="QVariantList"/>
<value key="Qt4ProjectManager.Qt4RunConfiguration.ProFile" type="QString">openpilotgcs/bin/bin.pro</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix" type="bool">false</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal" type="bool">false</value>
<valuelist key="Qt4ProjectManager.Qt4RunConfiguration.UserEnvironmentChanges" type="QVariantList"/>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetName" type="bool">false</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetWorkingDirectory" type="bool">false</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory" type="QString"></value>
</valuemap>
<valuemap key="ProjectExplorer.Target.RunConfiguration.1" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">translations</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4RunConfiguration</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.BaseEnvironmentBase" type="int">2</value>
<valuelist key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments" type="QVariantList"/>
<value key="Qt4ProjectManager.Qt4RunConfiguration.ProFile" type="QString">openpilotgcs/share/openpilotgcs/translations/translations.pro</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix" type="bool">false</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal" type="bool">false</value>
<valuelist key="Qt4ProjectManager.Qt4RunConfiguration.UserEnvironmentChanges" type="QVariantList"/>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetName" type="bool">false</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetWorkingDirectory" type="bool">false</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory" type="QString"></value>
</valuemap>
<valuemap key="ProjectExplorer.Target.RunConfiguration.10" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">uavobjgenerator</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4RunConfiguration</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.BaseEnvironmentBase" type="int">2</value>
<valuelist key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments" type="QVariantList"/>
<value key="Qt4ProjectManager.Qt4RunConfiguration.ProFile" type="QString">uavobjgenerator/uavobjgenerator.pro</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix" type="bool">false</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal" type="bool">false</value>
<valuelist key="Qt4ProjectManager.Qt4RunConfiguration.UserEnvironmentChanges" type="QVariantList"/>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetName" type="bool">false</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetWorkingDirectory" type="bool">false</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory" type="QString"></value>
</valuemap>
<valuemap key="ProjectExplorer.Target.RunConfiguration.2" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">app</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4RunConfiguration</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.BaseEnvironmentBase" type="int">2</value>
<valuelist key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments" type="QVariantList"/>
<value key="Qt4ProjectManager.Qt4RunConfiguration.ProFile" type="QString">openpilotgcs/src/app/app.pro</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix" type="bool">false</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal" type="bool">false</value>
<valuelist key="Qt4ProjectManager.Qt4RunConfiguration.UserEnvironmentChanges" type="QVariantList"/>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetName" type="bool">false</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetWorkingDirectory" type="bool">false</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory" type="QString"></value>
</valuemap>
<valuemap key="ProjectExplorer.Target.RunConfiguration.3" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">berkeley</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4RunConfiguration</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.BaseEnvironmentBase" type="int">2</value>
<valuelist key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments" type="QVariantList"/>
<value key="Qt4ProjectManager.Qt4RunConfiguration.ProFile" type="QString">openpilotgcs/src/libs/libqxt/src/berkeley/berkeley.pro</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix" type="bool">false</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal" type="bool">false</value>
<valuelist key="Qt4ProjectManager.Qt4RunConfiguration.UserEnvironmentChanges" type="QVariantList"/>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetName" type="bool">false</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetWorkingDirectory" type="bool">false</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory" type="QString"></value>
</valuemap>
<valuemap key="ProjectExplorer.Target.RunConfiguration.4" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">designer</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4RunConfiguration</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.BaseEnvironmentBase" type="int">2</value>
<valuelist key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments" type="QVariantList"/>
<value key="Qt4ProjectManager.Qt4RunConfiguration.ProFile" type="QString">openpilotgcs/src/libs/libqxt/src/designer/designer.pro</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix" type="bool">false</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal" type="bool">false</value>
<valuelist key="Qt4ProjectManager.Qt4RunConfiguration.UserEnvironmentChanges" type="QVariantList"/>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetName" type="bool">false</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetWorkingDirectory" type="bool">false</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory" type="QString"></value>
</valuemap>
<valuemap key="ProjectExplorer.Target.RunConfiguration.5" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">gui</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4RunConfiguration</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.BaseEnvironmentBase" type="int">2</value>
<valuelist key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments" type="QVariantList"/>
<value key="Qt4ProjectManager.Qt4RunConfiguration.ProFile" type="QString">openpilotgcs/src/libs/libqxt/src/gui/gui.pro</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix" type="bool">false</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal" type="bool">false</value>
<valuelist key="Qt4ProjectManager.Qt4RunConfiguration.UserEnvironmentChanges" type="QVariantList"/>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetName" type="bool">false</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetWorkingDirectory" type="bool">false</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory" type="QString"></value>
</valuemap>
<valuemap key="ProjectExplorer.Target.RunConfiguration.6" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">network</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4RunConfiguration</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.BaseEnvironmentBase" type="int">2</value>
<valuelist key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments" type="QVariantList"/>
<value key="Qt4ProjectManager.Qt4RunConfiguration.ProFile" type="QString">openpilotgcs/src/libs/libqxt/src/network/network.pro</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix" type="bool">false</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal" type="bool">false</value>
<valuelist key="Qt4ProjectManager.Qt4RunConfiguration.UserEnvironmentChanges" type="QVariantList"/>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetName" type="bool">false</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetWorkingDirectory" type="bool">false</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory" type="QString"></value>
</valuemap>
<valuemap key="ProjectExplorer.Target.RunConfiguration.7" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">sql</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4RunConfiguration</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.BaseEnvironmentBase" type="int">2</value>
<valuelist key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments" type="QVariantList"/>
<value key="Qt4ProjectManager.Qt4RunConfiguration.ProFile" type="QString">openpilotgcs/src/libs/libqxt/src/sql/sql.pro</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix" type="bool">false</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal" type="bool">false</value>
<valuelist key="Qt4ProjectManager.Qt4RunConfiguration.UserEnvironmentChanges" type="QVariantList"/>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetName" type="bool">false</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetWorkingDirectory" type="bool">false</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory" type="QString"></value>
</valuemap>
<valuemap key="ProjectExplorer.Target.RunConfiguration.8" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">web</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4RunConfiguration</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.BaseEnvironmentBase" type="int">2</value>
<valuelist key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments" type="QVariantList"/>
<value key="Qt4ProjectManager.Qt4RunConfiguration.ProFile" type="QString">openpilotgcs/src/libs/libqxt/src/web/web.pro</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix" type="bool">false</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal" type="bool">false</value>
<valuelist key="Qt4ProjectManager.Qt4RunConfiguration.UserEnvironmentChanges" type="QVariantList"/>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetName" type="bool">false</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetWorkingDirectory" type="bool">false</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory" type="QString"></value>
</valuemap>
<valuemap key="ProjectExplorer.Target.RunConfiguration.9" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">zeroconf</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4RunConfiguration</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.BaseEnvironmentBase" type="int">2</value>
<valuelist key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments" type="QVariantList"/>
<value key="Qt4ProjectManager.Qt4RunConfiguration.ProFile" type="QString">openpilotgcs/src/libs/libqxt/src/zeroconf/zeroconf.pro</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix" type="bool">false</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal" type="bool">false</value>
<valuelist key="Qt4ProjectManager.Qt4RunConfiguration.UserEnvironmentChanges" type="QVariantList"/>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetName" type="bool">false</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetWorkingDirectory" type="bool">false</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory" type="QString"></value>
</valuemap>
<value key="ProjectExplorer.Target.RunConfigurationCount" type="int">11</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.TargetCount</variable>
<value type="int">1</value>
</data>
<data>
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
<value type="int">4</value>
</data>
</qtcreator>

View File

@ -28,7 +28,7 @@
#define LKS94PROJECTION_H #define LKS94PROJECTION_H
#include <QVector> #include <QVector>
#include "cmath" #include "cmath"
#include "../pureprojection.h" #include "D:\!Work\OpenSource\OpenPilot\OpenPilot\ground\openpilotgcs\src\libs\opmapcontrol\src\internals\pureprojection.h"
namespace projections { namespace projections {

View File

@ -0,0 +1,154 @@
/**
******************************************************************************
*
* @file NotificationItem.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Notify Plugin configuration header
* @see The GNU Public License (GPL) Version 3
* @defgroup notifyplugin
* @{
*
*****************************************************************************/
/*
* 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 NOTIFICATION_ITEM_H
#define NOTIFICATION_ITEM_H
#include <coreplugin/iuavgadgetconfiguration.h>
#include "qsettings.h"
#include <qstringlist.h>
#include <QTimer>
using namespace Core;
#define DECLARE_SOUND(number) \
QString getSound##number() const { return _sound##number; } \
void setSound##number(QString text) { _sound##number = text; } \
// QString getSound2() const { return _sound2; }
// void setSound2(QString text) { _sound2 = text; }
// QString getSound3() const { return _sound3; }
// void setSound3(QString text) { _sound3 = text; }
class NotificationItem : public QObject
{
Q_OBJECT
public:
explicit NotificationItem(QObject *parent = 0);
void copyTo(NotificationItem*) const;
DECLARE_SOUND(1)
DECLARE_SOUND(2)
DECLARE_SOUND(3)
QString getValue() const { return _dataValue; }
void setValue(QString text) { _dataValue = text; }
QString getSayOrder() const { return _sayOrder; }
void setSayOrder(QString text) { _sayOrder = text; }
double getSpinBoxValue() const { return _spinBoxValue; }
void setSpinBoxValue(double value) { _spinBoxValue = value; }
QString getDataObject() const { return _dataObject; }
void setDataObject(QString text) { _dataObject = text; }
QString getObjectField() const { return _objectField; }
void setObjectField(QString text) { _objectField = text; }
QString getSoundCollectionPath() const { return _soundCollectionPath; }
void setSoundCollectionPath(QString path) { _soundCollectionPath = path; }
QString getCurrentLanguage() const { return _currentLanguage; }
void setCurrentLanguage(QString text) { _currentLanguage = text; }
QStringList getMessageSequence() const { return _messageSequence; }
void setMessageSequence(QStringList sequence) { _messageSequence = sequence; }
QString getRepeatFlag() const { return _repeatString; }
void setRepeatFlag(QString value) { _repeatString = value; }
bool getRepeatTimeout() const { return _repeatTimeout; }
void setRepeatTimeout(bool value) { _repeatTimeout = value; }
int getExpireTimeout() const { return _expireTimeout; }
void setExpireTimeout(int value) { _expireTimeout = value; }
bool getEnableFlag() const { return _enableFlag; }
void setEnableFlag(bool value) { _enableFlag = value; }
void saveState(QSettings* settings) const;
void restoreState(QSettings* settings);
QString parseNotifyMessage();
QTimer* timer;
QTimer* expireTimer;
bool isNowPlaying; //
bool firstStart;
private:
QStringList _messageSequence;
//! path to folder with sound files
QString _soundCollectionPath;
//! language in what notifications will be spelled
QString _currentLanguage;
//! one UAV object per one notification
QString _dataObject;
//! one field value change can be assigned to one notification
QString _objectField;
//! poled UAV field value
QString _dataValue;
//! possible sounds(at least one required to play notification)
QString _sound1;
QString _sound2;
QString _sound3;
//! order in what sounds 1-3 will be played
QString _sayOrder;
double _spinBoxValue;
QString _repeatString;
//! time when next notification must be fired
bool _repeatTimeout;
//! how often or what periodicaly notification should be played
int _repeatTimerValue;
//! time after event occured till notification became invalid
//! and will be removed from list
int _expireTimeout;
//! enables/disables playing of current notification
bool _enableFlag;
};
Q_DECLARE_METATYPE(NotificationItem*)
#endif // NotificationItem_H

View File

@ -10,9 +10,9 @@ QT += phonon
HEADERS += notifyplugin.h \ HEADERS += notifyplugin.h \
notifypluginoptionspage.h \ notifypluginoptionspage.h \
notifypluginconfiguration.h \
notifyitemdelegate.h \ notifyitemdelegate.h \
notifytablemodel.h notifytablemodel.h \
NotificationItem.h
SOURCES += notifyplugin.cpp \ SOURCES += notifyplugin.cpp \
notifypluginoptionspage.cpp \ notifypluginoptionspage.cpp \

View File

@ -25,136 +25,135 @@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "notifyitemdelegate.h"
#include <QtGui> #include <QtGui>
#include "notifyitemdelegate.h"
#include "notifytablemodel.h"
NotifyItemDelegate::NotifyItemDelegate(QStringList items,QObject *parent) NotifyItemDelegate::NotifyItemDelegate(QStringList items, QObject* parent)
: QItemDelegate(parent), : QItemDelegate(parent)
m_parent(parent), , _parent(parent)
m_items(items) { , _items(items)
{
} }
QWidget *NotifyItemDelegate::createEditor(QWidget *parent, QWidget *NotifyItemDelegate::createEditor(QWidget* parent,
const QStyleOptionViewItem &, const QStyleOptionViewItem& /*none*/,
const QModelIndex &index) const const QModelIndex& index) const
{ {
if (index.column() == 1) { if(eREPEAT_VALUE == index.column()) {
QComboBox* editor = new QComboBox(parent); QComboBox* editor = new QComboBox(parent);
editor->clear(); editor->clear();
editor->addItems(m_items); editor->addItems(_items);
//repeatEditor->setCurrentIndex(0); return editor;
//repeatEditor->setItemDelegate(new RepeatCounterDelegate()); } else {
if(eEXPIRE_TIME == index.column()) {
//connect(repeatEditor,SIGNAL(activated (const QString& )),this,SLOT(selectRow(const QString& ))); QSpinBox* editor = new QSpinBox(parent);
//QTableWidgetItem* item = qobject_cast<QTableWidgetItem *>(parent); connect(editor, SIGNAL(editingFinished()), this, SLOT(commitAndCloseEditor()));
//((QTableWidgetItem*)parent)->setSelected(true); return editor;
// connect(editor, SIGNAL(editingFinished()), } else {
// this, SLOT(commitAndCloseEditor())); if(eENABLE_NOTIFICATION == index.column()) {
return editor; QCheckBox* editor = new QCheckBox(parent);
} else connect(editor, SIGNAL(editingFinished()), this, SLOT(commitAndCloseEditor()));
{ return editor;
if(index.column() == 2)
{
QSpinBox* editor = new QSpinBox(parent);
connect(editor, SIGNAL(editingFinished()),
this, SLOT(commitAndCloseEditor()));
return editor;
}
}
QLineEdit *editor = new QLineEdit(parent);
// connect(editor, SIGNAL(editingFinished()),
// this, SLOT(commitAndCloseEditor()));
return editor;
}
void NotifyItemDelegate::commitAndCloseEditor()
{
QLineEdit *editor = qobject_cast<QLineEdit *>(sender());
if (editor)
{
emit commitData(editor);
emit closeEditor(editor);
} else {
QComboBox* editor = qobject_cast<QComboBox*>(sender());
if (editor)
{
emit commitData(editor);
emit closeEditor(editor);
} else {
QSpinBox* editor = qobject_cast<QSpinBox*>(sender());
if (editor)
{
emit commitData(editor);
emit closeEditor(editor);
}
}
}
}
void NotifyItemDelegate::setEditorData(QWidget *editor,
const QModelIndex &index) const
{
QLineEdit *edit = qobject_cast<QLineEdit*>(editor);
if (edit) {
edit->setText(index.model()->data(index, Qt::EditRole).toString());
} else {
QComboBox * repeatEditor = qobject_cast<QComboBox *>(editor);
if (repeatEditor)
repeatEditor->setCurrentIndex(repeatEditor->findText(index.model()->data(index, Qt::EditRole).toString()));
else {
QSpinBox * expireEditor = qobject_cast<QSpinBox *>(editor);
if (expireEditor)
expireEditor->setValue(index.model()->data(index, Qt::EditRole).toInt());
}
}
}
void NotifyItemDelegate::setModelData(QWidget *editor,
QAbstractItemModel *model, const QModelIndex &index) const
{
QLineEdit *edit = qobject_cast<QLineEdit *>(editor);
if (edit) {
model->setData(index, edit->text());
} else {
QComboBox * repeatEditor = qobject_cast<QComboBox *>(editor);
if (repeatEditor) {
model->setData(index, repeatEditor->currentText());
} else {
QSpinBox * expireEditor = qobject_cast<QSpinBox *>(editor);
if (expireEditor) {
//expireEditor->interpretText();
model->setData(index, expireEditor->value(), Qt::EditRole);
} }
} }
} }
} QLineEdit *editor = new QLineEdit(parent);
return editor;
}
void NotifyItemDelegate::commitAndCloseEditor()
{
QLineEdit* editor = qobject_cast<QLineEdit*>(sender());
if (editor) {
emit commitData(editor);
emit closeEditor(editor);
} else {
QComboBox* editor = qobject_cast<QComboBox*>(sender());
if (editor)
{
emit commitData(editor);
emit closeEditor(editor);
} else {
QSpinBox* editor = qobject_cast<QSpinBox*>(sender());
if (editor)
{
emit commitData(editor);
emit closeEditor(editor);
} else {
QCheckBox* editor = qobject_cast<QCheckBox*>(sender());
if (editor)
{
emit commitData(editor);
emit closeEditor(editor);
}
}
}
}
}
void NotifyItemDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const
{
QLineEdit* edit = qobject_cast<QLineEdit*>(editor);
if(edit) {
edit->setText(index.model()->data(index, Qt::EditRole).toString());
} else {
QComboBox* repeatEditor = qobject_cast<QComboBox *>(editor);
if(repeatEditor)
repeatEditor->setCurrentIndex(repeatEditor->findText(index.model()->data(index, Qt::EditRole).toString()));
else {
QSpinBox* expireEditor = qobject_cast<QSpinBox *>(editor);
if(expireEditor)
expireEditor->setValue(index.model()->data(index, Qt::EditRole).toInt());
else {
QCheckBox* enablePlayEditor = qobject_cast<QCheckBox *>(editor);
if (enablePlayEditor)
enablePlayEditor->setChecked(index.model()->data(index, Qt::EditRole).toBool());
}
}
}
}
void NotifyItemDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
{
QLineEdit *edit = qobject_cast<QLineEdit *>(editor);
if(edit) {
model->setData(index, edit->text());
} else {
QComboBox * repeatEditor = qobject_cast<QComboBox *>(editor);
if(repeatEditor) {
model->setData(index, repeatEditor->currentText());
} else {
QSpinBox * expireEditor = qobject_cast<QSpinBox *>(editor);
if(expireEditor) {
model->setData(index, expireEditor->value(), Qt::EditRole);
} else {
QCheckBox* enablePlayEditor = qobject_cast<QCheckBox*>(editor);
if (enablePlayEditor) {
model->setData(index, enablePlayEditor->isChecked(), Qt::EditRole);
}
}
}
}
}
void NotifyItemDelegate::selectRow(const QString & text) void NotifyItemDelegate::selectRow(const QString & text)
{ {
//QList<QTableWidgetItem *> list = ((QTableWidget*)(sender()->parent()))->findItems(text,Qt::MatchExactly);
QComboBox* combo = qobject_cast<QComboBox*>(sender()); QComboBox* combo = qobject_cast<QComboBox*>(sender());
QTableWidget* table = new QTableWidget; QTableWidget* table = new QTableWidget;
table = (QTableWidget*)(combo->parent()); table = (QTableWidget*)(combo->parent());
qDebug()<<table->columnCount();
qDebug()<<table->rowCount(); qDebug() << table->columnCount();
qDebug()<<table->currentRow(); qDebug() << table->rowCount();
//table->setCurrentIndex(1); qDebug() << table->currentRow();
//table->findItems(text,Qt::MatchExactly);
//item->model()->index()
//item->setSelected(true);
} }
QSize NotifyItemDelegate::sizeHint ( const QStyleOptionViewItem & option, QSize NotifyItemDelegate::sizeHint(const QStyleOptionViewItem & option,
const QModelIndex & index ) const const QModelIndex & index) const
{ {
QSize s = QItemDelegate::sizeHint(option, index); QSize s = QItemDelegate::sizeHint(option, index);
s.setHeight(10); s.setHeight(10);
return s; return s;
} }

View File

@ -31,21 +31,6 @@
#include <QItemDelegate> #include <QItemDelegate>
#include <QComboBox> #include <QComboBox>
//class RepeatCounterDelegate : public QItemDelegate
//{
// Q_OBJECT
//public:
// RepeatCounterDelegate(QObject *parent = 0);
// QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &,
// const QModelIndex &index) const;
// void setEditorData(QWidget *editor, const QModelIndex &index) const;
// void setModelData(QWidget *editor, QAbstractItemModel *model,
// const QModelIndex &index) const;
//private slots:
// void commitAndCloseEditor();
//};
class NotifyItemDelegate : public QItemDelegate class NotifyItemDelegate : public QItemDelegate
{ {
@ -58,19 +43,16 @@ public:
void setEditorData(QWidget *editor, const QModelIndex &index) const; void setEditorData(QWidget *editor, const QModelIndex &index) const;
void setModelData(QWidget *editor, QAbstractItemModel *model, void setModelData(QWidget *editor, QAbstractItemModel *model,
const QModelIndex &index) const; const QModelIndex &index) const;
// bool editorEvent(QEvent * event, QAbstractItemModel * model,
// const QStyleOptionViewItem & option, const QModelIndex & index );
QSize sizeHint ( const QStyleOptionViewItem & option, const QModelIndex & index ) const; QSize sizeHint ( const QStyleOptionViewItem & option, const QModelIndex & index ) const;
private:
QObject* m_parent;
QStringList m_items;
QComboBox* repeatEditor;
private slots: private slots:
void selectRow(const QString & text); void selectRow(const QString & text);
void commitAndCloseEditor(); void commitAndCloseEditor();
private:
QObject* _parent;
QStringList _items;
}; };
#endif // NOTIFYITEMDELEGATE_H #endif // NOTIFYITEMDELEGATE_H

View File

@ -26,7 +26,7 @@
*/ */
#include "notifyplugin.h" #include "notifyplugin.h"
#include "notifypluginconfiguration.h" #include "notificationitem.h"
#include "notifypluginoptionspage.h" #include "notifypluginoptionspage.h"
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <QDebug> #include <QDebug>
@ -37,15 +37,29 @@
#include <iostream> #include <iostream>
#include "qxttimer.h" #include "qxttimer.h"
#include "backendcapabilities.h"
static const QString VERSION = "1.0.0"; static const QString VERSION = "1.0.0";
//#define DEBUG_NOTIFIES //#define DEBUG_NOTIFIES
#ifdef DEBUG_NOTIFIES
QDebug qNotifyDebug()
#endif
#ifndef DEBUG_NOTIFIES
QNoDebug qNotifyDebug()
#endif
{
#ifdef DEBUG_NOTIFIES
return qDebug();
#endif
return QNoDebug();
}
SoundNotifyPlugin::SoundNotifyPlugin() SoundNotifyPlugin::SoundNotifyPlugin()
{ {
phonon.mo = NULL; phonon.mo = NULL;
configured = false; configured = false;
// Do nothing // Do nothing
} }
@ -121,7 +135,7 @@ void SoundNotifyPlugin::readConfig( QSettings* settings, UAVConfigInfo *configIn
int size = settings->beginReadArray("listNotifies"); int size = settings->beginReadArray("listNotifies");
for (int i = 0; i < size; ++i) { for (int i = 0; i < size; ++i) {
settings->setArrayIndex(i); settings->setArrayIndex(i);
NotifyPluginConfiguration* notification = new NotifyPluginConfiguration; NotificationItem* notification = new NotificationItem;
notification->restoreState(settings); notification->restoreState(settings);
lstNotifications.append(notification); lstNotifications.append(notification);
} }
@ -145,7 +159,7 @@ void SoundNotifyPlugin::readConfig_0_0_0(){
int size = settings->beginReadArray("listNotifies"); int size = settings->beginReadArray("listNotifies");
for (int i = 0; i < size; ++i) { for (int i = 0; i < size; ++i) {
settings->setArrayIndex(i); settings->setArrayIndex(i);
NotifyPluginConfiguration* notification = new NotifyPluginConfiguration; NotificationItem* notification = new NotificationItem;
notification->restoreState(settings); notification->restoreState(settings);
lstNotifications.append(notification); lstNotifications.append(notification);
} }
@ -185,7 +199,7 @@ void SoundNotifyPlugin::onAutopilotDisconnect()
void SoundNotifyPlugin::resetNotification(void) void SoundNotifyPlugin::resetNotification(void)
{ {
//first, reject empty args and unknown fields. //first, reject empty args and unknown fields.
foreach(NotifyPluginConfiguration* notify,lstNotifications) { foreach(NotificationItem* notify,lstNotifications) {
if(notify->timer) if(notify->timer)
{ {
disconnect(notify->timer, SIGNAL(timeout()), this, SLOT(repeatTimerHandler())); disconnect(notify->timer, SIGNAL(timeout()), this, SLOT(repeatTimerHandler()));
@ -207,7 +221,7 @@ void SoundNotifyPlugin::resetNotification(void)
update list of notifies; update list of notifies;
will be perform on OK or APPLY press of option page will be perform on OK or APPLY press of option page
*/ */
void SoundNotifyPlugin::updateNotificationList(QList<NotifyPluginConfiguration*> list) void SoundNotifyPlugin::updateNotificationList(QList<NotificationItem*> list)
{ {
removedNotifies.clear(); removedNotifies.clear();
resetNotification(); resetNotification();
@ -224,10 +238,10 @@ void SoundNotifyPlugin::connectNotifications()
if (obj != NULL) if (obj != NULL)
disconnect(obj,SIGNAL(objectUpdated(UAVObject*)),this,SLOT(appendNotification(UAVObject*))); disconnect(obj,SIGNAL(objectUpdated(UAVObject*)),this,SLOT(appendNotification(UAVObject*)));
} }
if(phonon.mo != NULL) { if(phonon.mo != NULL) {
delete phonon.mo; delete phonon.mo;
phonon.mo = NULL; phonon.mo = NULL;
} }
if(!enableSound) return; if(!enableSound) return;
@ -240,25 +254,10 @@ void SoundNotifyPlugin::connectNotifications()
removedNotifies.clear(); removedNotifies.clear();
//first, reject empty args and unknown fields. //first, reject empty args and unknown fields.
foreach(NotifyPluginConfiguration* notify,lstNotifications) { foreach(NotificationItem* notify, lstNotifications) {
notify->firstStart=true; notify->firstStart=true;
notify->isNowPlaying=false; notify->isNowPlaying=false;
// if(notify->timer)
// {
// disconnect(notify->timer, SIGNAL(timeout()), this, SLOT(repeatTimerHandler()));
// notify->timer->stop();
// delete notify->timer;
// notify->timer = NULL;
// }
// if(notify->expireTimer)
// {
// disconnect(notify->expireTimer, SIGNAL(timeout()), this, SLOT(expireTimerHandler()));
// notify->expireTimer->stop();
// delete notify->expireTimer;
// notify->expireTimer = NULL;
// }
UAVDataObject* obj = dynamic_cast<UAVDataObject*>( objManager->getObject(notify->getDataObject()) ); UAVDataObject* obj = dynamic_cast<UAVDataObject*>( objManager->getObject(notify->getDataObject()) );
if (obj != NULL ) { if (obj != NULL ) {
if(!lstNotifiedUAVObjects.contains(obj)) { if(!lstNotifiedUAVObjects.contains(obj)) {
@ -269,27 +268,25 @@ void SoundNotifyPlugin::connectNotifications()
std::cout << "Error: Object is unknown (" << notify->getDataObject().toStdString() << ")." << std::endl; std::cout << "Error: Object is unknown (" << notify->getDataObject().toStdString() << ")." << std::endl;
} }
if(lstNotifications.isEmpty()) return; if(lstNotifications.isEmpty()) return;
// set notification message to current event // set notification message to current event
phonon.mo = Phonon::createPlayer(Phonon::NotificationCategory); phonon.mo = Phonon::createPlayer(Phonon::NotificationCategory);
phonon.mo->clearQueue(); phonon.mo->clearQueue();
phonon.firstPlay = true; phonon.firstPlay = true;
#ifdef DEBUG_NOTIFIES QList<Phonon::AudioOutputDevice> audioOutputDevices =
QList<Phonon::AudioOutputDevice> audioOutputDevices = Phonon::BackendCapabilities::availableAudioOutputDevices();
Phonon::BackendCapabilities::availableAudioOutputDevices(); foreach(Phonon::AudioOutputDevice dev, audioOutputDevices) {
foreach(Phonon::AudioOutputDevice dev, audioOutputDevices) { qNotifyDebug() << "Notify: Audio Output device: " << dev.name() << " - " << dev.description();
qDebug() << "Notify: Audio Output device: " << dev.name() << " - " << dev.description(); }
} connect(phonon.mo, SIGNAL(stateChanged(Phonon::State,Phonon::State)),
#endif this, SLOT(stateChanged(Phonon::State,Phonon::State)));
connect(phonon.mo,SIGNAL(stateChanged(Phonon::State,Phonon::State)),
this,SLOT(stateChanged(Phonon::State,Phonon::State)));
} }
void SoundNotifyPlugin::appendNotification(UAVObject *object) void SoundNotifyPlugin::appendNotification(UAVObject *object)
{ {
disconnect(object, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(appendNotification(UAVObject*))); disconnect(object, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(appendNotification(UAVObject*)));
foreach(NotifyPluginConfiguration* notification, lstNotifications) { foreach(NotificationItem* notification, lstNotifications) {
if(object->getName()!=notification->getDataObject()) if(object->getName()!=notification->getDataObject())
continue; continue;
@ -306,7 +303,7 @@ void SoundNotifyPlugin::appendNotification(UAVObject *object)
} }
void SoundNotifyPlugin::checkNotificationRule(NotifyPluginConfiguration* notification, UAVObject* object) void SoundNotifyPlugin::checkNotificationRule(NotificationItem* notification, UAVObject* object)
{ {
bool condition=false; bool condition=false;
double threshold; double threshold;
@ -350,7 +347,7 @@ void SoundNotifyPlugin::checkNotificationRule(NotifyPluginConfiguration* notific
#endif #endif
// if audio is busy, start expiration timer // if audio is busy, start expiration timer
//ms = (notification->getExpiredTimeout()[in sec])*1000 //ms = (notification->getExpiredTimeout()[in sec])*1000
//QxtTimer::singleShot(notification->getExpireTimeout()*1000, this, SLOT(expirationTimerHandler(NotifyPluginConfiguration*)), qVariantFromValue(notification)); //QxtTimer::singleShot(notification->getExpireTimeout()*1000, this, SLOT(expirationTimerHandler(NotificationItem*)), qVariantFromValue(notification));
pendingNotifications.append(notification); pendingNotifications.append(notification);
if(!notification->expireTimer) if(!notification->expireTimer)
{ {
@ -363,21 +360,22 @@ void SoundNotifyPlugin::checkNotificationRule(NotifyPluginConfiguration* notific
} }
} }
bool SoundNotifyPlugin::playNotification(NotifyPluginConfiguration* notification) bool SoundNotifyPlugin::playNotification(NotificationItem* notification)
{ {
// Check: race condition, if phonon.mo got deleted don't go further // Check: race condition, if phonon.mo got deleted don't go further
if (phonon.mo == NULL) if (phonon.mo == NULL)
return false; return false;
if(!notification->getEnableFlag()) return true;
#ifdef DEBUG_NOTIFIES #ifdef DEBUG_NOTIFIES
qDebug() << "Phonon State: " << phonon.mo->state(); qDebug() << "Phonon State: " << phonon.mo->state();
#endif #endif
if((phonon.mo->state()==Phonon::PausedState) || if((phonon.mo->state()==Phonon::PausedState)
(phonon.mo->state()==Phonon::StoppedState) || || (phonon.mo->state()==Phonon::StoppedState)
phonon.firstPlay) || phonon.firstPlay)
{ {
// don't fire expire timer // don't fire expire timer
//notification->expire = false;
nowPlayingConfiguration = notification; nowPlayingConfiguration = notification;
if(notification->expireTimer) if(notification->expireTimer)
notification->expireTimer->stop(); notification->expireTimer->stop();
@ -385,7 +383,6 @@ bool SoundNotifyPlugin::playNotification(NotifyPluginConfiguration* notification
if(notification->getRepeatFlag()=="Repeat Once") if(notification->getRepeatFlag()=="Repeat Once")
{ {
removedNotifies.append(lstNotifications.takeAt(lstNotifications.indexOf(notification))); removedNotifies.append(lstNotifications.takeAt(lstNotifications.indexOf(notification)));
//if(!notification->firstStart) return true;
} }
else { else {
if(notification->getRepeatFlag()!="Repeat Instantly") if(notification->getRepeatFlag()!="Repeat Instantly")
@ -407,24 +404,21 @@ bool SoundNotifyPlugin::playNotification(NotifyPluginConfiguration* notification
} }
if(!notification->timer->isActive()) if(!notification->timer->isActive())
notification->timer->start(); notification->timer->start();
//QxtTimer::singleShot(timer_value, this, SLOT(repeatTimerHandler(NotifyPluginConfiguration*)), qVariantFromValue(notification));
} }
} }
notification->firstStart=false; notification->firstStart=false;
phonon.mo->clear(); phonon.mo->clear();
QString str = notification->parseNotifyMessage(); QString str = notification->parseNotifyMessage();
#ifdef DEBUG_NOTIFIES qNotifyDebug() << "play notification - " << str;
qDebug() << "play notification - " << str;
#endif foreach(QString item, notification->getMessageSequence()) {
foreach(QString item, notification->getNotifyMessageList()) { Phonon::MediaSource *ms = new Phonon::MediaSource(item);
Phonon::MediaSource *ms = new Phonon::MediaSource(item); ms->setAutoDelete(true);
ms->setAutoDelete(true); phonon.mo->enqueue(*ms);
phonon.mo->enqueue(*ms); }
}
phonon.mo->play(); phonon.mo->play();
phonon.firstPlay = false; // On Linux, you sometimes have to nudge Phonon to play 1 time before phonon.firstPlay = false; // On Linux, you sometimes have to nudge Phonon to play 1 time before
// the state is not "Loading" anymore. // the state is not "Loading" anymore.
} }
else else
return false; // if audio is busy return false; // if audio is busy
@ -432,20 +426,9 @@ bool SoundNotifyPlugin::playNotification(NotifyPluginConfiguration* notification
return true; return true;
} }
//void SoundNotifyPlugin::repeatTimerHandler(NotifyPluginConfiguration* notification)
//{
// qDebug() << "repeatTimerHandler - " << notification->parseNotifyMessage();
// ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
// UAVObjectManager *objManager = pm->getObject<UAVObjectManager>();
// UAVObject* object = objManager->getObject(notification->getDataObject());
// if(object)
// checkNotificationRule(notification,object);
//}
void SoundNotifyPlugin::repeatTimerHandler() void SoundNotifyPlugin::repeatTimerHandler()
{ {
NotifyPluginConfiguration* notification = static_cast<NotifyPluginConfiguration*>(sender()->parent()); NotificationItem* notification = static_cast<NotificationItem*>(sender()->parent());
#ifdef DEBUG_NOTIFIES #ifdef DEBUG_NOTIFIES
qDebug() << "repeatTimerHandler - " << notification->parseNotifyMessage(); qDebug() << "repeatTimerHandler - " << notification->parseNotifyMessage();
#endif #endif
@ -459,7 +442,7 @@ void SoundNotifyPlugin::repeatTimerHandler()
void SoundNotifyPlugin::expireTimerHandler() void SoundNotifyPlugin::expireTimerHandler()
{ {
// fire expire timer // fire expire timer
NotifyPluginConfiguration* notification = static_cast<NotifyPluginConfiguration*>(sender()->parent()); NotificationItem* notification = static_cast<NotificationItem*>(sender()->parent());
notification->expireTimer->stop(); notification->expireTimer->stop();
if(!pendingNotifications.isEmpty()) if(!pendingNotifications.isEmpty())
@ -494,7 +477,7 @@ void SoundNotifyPlugin::stateChanged(Phonon::State newstate, Phonon::State oldst
nowPlayingConfiguration=NULL; nowPlayingConfiguration=NULL;
if(!pendingNotifications.isEmpty()) if(!pendingNotifications.isEmpty())
{ {
NotifyPluginConfiguration* notification = pendingNotifications.takeFirst(); NotificationItem* notification = pendingNotifications.takeFirst();
#ifdef DEBUG_NOTIFIES #ifdef DEBUG_NOTIFIES
qDebug() << "play audioFree - " << notification->parseNotifyMessage(); qDebug() << "play audioFree - " << notification->parseNotifyMessage();
#endif #endif

View File

@ -32,7 +32,7 @@
#include "uavtalk/telemetrymanager.h" #include "uavtalk/telemetrymanager.h"
#include "uavobjectmanager.h" #include "uavobjectmanager.h"
#include "uavobject.h" #include "uavobject.h"
#include "notifypluginconfiguration.h" #include "notificationitem.h"
#include <QSettings> #include <QSettings>
#include <phonon/MediaObject> #include <phonon/MediaObject>
@ -44,10 +44,12 @@ class NotifyPluginOptionsPage;
typedef struct { typedef struct {
Phonon::MediaObject* mo; Phonon::MediaObject* mo;
NotifyPluginConfiguration* notify; NotificationItem* notify;
bool firstPlay; bool firstPlay;
} PhononObject, *pPhononObject; } PhononObject, *pPhononObject;
class SoundNotifyPlugin : public Core::IConfigurablePlugin class SoundNotifyPlugin : public Core::IConfigurablePlugin
{ {
Q_OBJECT Q_OBJECT
@ -62,48 +64,42 @@ public:
void shutdown(); void shutdown();
QList<NotifyPluginConfiguration*> getListNotifications() { return lstNotifications; } QList<NotificationItem*> getListNotifications() { return lstNotifications; }
//void setListNotifications(QList<NotifyPluginConfiguration*>& list_notify) { } NotificationItem* getCurrentNotification(){ return &currentNotification;}
NotifyPluginConfiguration* getCurrentNotification(){ return &currentNotification;}
bool getEnableSound() const { return enableSound; } bool getEnableSound() const { return enableSound; }
void setEnableSound(bool value) {enableSound = value; } void setEnableSound(bool value) {enableSound = value; }
private: private:
bool configured; // just for migration,delete later bool configured; // just for migration,delete later
bool enableSound; bool enableSound;
QList< QList<Phonon::MediaSource>* > lstMediaSource; QList< QList<Phonon::MediaSource>* > lstMediaSource;
QStringList mediaSource; QStringList mediaSource;
//QMap<QString, Phonon::MediaObject*> mapMediaObjects;
QMultiMap<QString, PhononObject> mapMediaObjects; QMultiMap<QString, PhononObject> mapMediaObjects;
QSettings* settings; QSettings* settings;
QList<UAVDataObject*> lstNotifiedUAVObjects; QList<UAVDataObject*> lstNotifiedUAVObjects;
QList<NotificationItem*> lstNotifications;
QList<NotificationItem*> pendingNotifications;
QList<NotificationItem*> removedNotifies;
QList<NotifyPluginConfiguration*> lstNotifications; NotificationItem currentNotification;
QList<NotifyPluginConfiguration*> pendingNotifications; NotificationItem* nowPlayingConfiguration;
QList<NotifyPluginConfiguration*> removedNotifies;
NotifyPluginConfiguration currentNotification;
NotifyPluginConfiguration* nowPlayingConfiguration;
QString m_field; QString m_field;
PhononObject phonon; PhononObject phonon;
NotifyPluginOptionsPage *mop; NotifyPluginOptionsPage *mop;
TelemetryManager* telMngr; TelemetryManager* telMngr;
bool playNotification(NotifyPluginConfiguration* notification); bool playNotification(NotificationItem* notification);
void checkNotificationRule(NotifyPluginConfiguration* notification, UAVObject* object); void checkNotificationRule(NotificationItem* notification, UAVObject* object);
void readConfig_0_0_0(); void readConfig_0_0_0();
private slots: private slots:
void onTelemetryManagerAdded(QObject* obj); void onTelemetryManagerAdded(QObject* obj);
void onAutopilotDisconnect(); void onAutopilotDisconnect();
void connectNotifications(); void connectNotifications();
void updateNotificationList(QList<NotifyPluginConfiguration*> list); void updateNotificationList(QList<NotificationItem*> list);
void resetNotification(void); void resetNotification(void);
void appendNotification(UAVObject *object); void appendNotification(UAVObject *object);
void repeatTimerHandler(void); void repeatTimerHandler(void);

View File

@ -1,7 +1,7 @@
/** /**
****************************************************************************** ******************************************************************************
* *
* @file notifyPluginConfiguration.cpp * @file NotificationItem.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Notify Plugin configuration * @brief Notify Plugin configuration
* @see The GNU Public License (GPL) Version 3 * @see The GNU Public License (GPL) Version 3
@ -25,60 +25,60 @@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "notifypluginconfiguration.h" #include "NotificationItem.h"
#include <QtCore/QDataStream> #include <QtCore/QDataStream>
#include <QFile> #include <QFile>
#include "utils/pathutils.h" #include "utils/pathutils.h"
NotifyPluginConfiguration::NotifyPluginConfiguration(QObject *parent) : NotificationItem::NotificationItem(QObject *parent) :
QObject(parent), QObject(parent),
isNowPlaying(0), isNowPlaying(0),
firstStart(1), firstStart(1),
soundCollectionPath(""), _soundCollectionPath(""),
currentLanguage("default"), _currentLanguage("default"),
dataObject(""), _dataObject(""),
objectField(""), _objectField(""),
value("Equal to"), _dataValue("Equal to"),
sound1(""), _sound1(""),
sound2(""), _sound2(""),
sound3(""), _sound3(""),
sayOrder("Never"), _sayOrder("Never"),
spinBoxValue(0), _spinBoxValue(0),
repeatString("Repeat Instantly"), _repeatString("Repeat Instantly"),
repeatTimeout(true), _repeatTimeout(true),
expireTimeout(15) _expireTimeout(15)
{ {
timer = NULL; timer = NULL;
expireTimer = NULL; expireTimer = NULL;
} }
void NotifyPluginConfiguration::copyTo(NotifyPluginConfiguration* that) const void NotificationItem::copyTo(NotificationItem* that) const
{ {
that->isNowPlaying = isNowPlaying; that->isNowPlaying = isNowPlaying;
that->firstStart = firstStart; that->firstStart = firstStart;
that->soundCollectionPath = soundCollectionPath; that->_soundCollectionPath = _soundCollectionPath;
that->currentLanguage = currentLanguage; that->_currentLanguage = _currentLanguage;
that->soundCollectionPath = soundCollectionPath; that->_soundCollectionPath = _soundCollectionPath;
that->dataObject = dataObject; that->_dataObject = _dataObject;
that->objectField = objectField; that->_objectField = _objectField;
that->value = value; that->_dataValue = _dataValue;
that->sound1 = sound1; that->_sound1 = _sound1;
that->sound2 = sound2; that->_sound2 = _sound2;
that->sound3 = sound3; that->_sound3 = _sound3;
that->sayOrder = sayOrder; that->_sayOrder = _sayOrder;
that->spinBoxValue = spinBoxValue; that->_spinBoxValue = _spinBoxValue;
that->repeatString = repeatString; that->_repeatString = _repeatString;
that->repeatTimeout = repeatTimeout; that->_repeatTimeout = _repeatTimeout;
that->expireTimeout = expireTimeout; that->_expireTimeout = _expireTimeout;
} }
void NotifyPluginConfiguration::saveState(QSettings* settings) const void NotificationItem::saveState(QSettings* settings) const
{ {
settings->setValue("SoundCollectionPath", Utils::PathUtils().RemoveDataPath(getSoundCollectionPath())); settings->setValue("SoundCollectionPath", Utils::PathUtils().RemoveDataPath(getSoundCollectionPath()));
settings->setValue(QLatin1String("CurrentLanguage"), getCurrentLanguage()); settings->setValue(QLatin1String("CurrentLanguage"), getCurrentLanguage());
settings->setValue(QLatin1String("ObjectField"), getObjectField()); settings->setValue(QLatin1String("ObjectField"), getObjectField());
settings->setValue(QLatin1String("DataObject"), getDataObject()); settings->setValue(QLatin1String("DataObject"), getDataObject());
@ -92,7 +92,7 @@ void NotifyPluginConfiguration::saveState(QSettings* settings) const
settings->setValue(QLatin1String("ExpireTimeout"), getExpireTimeout()); settings->setValue(QLatin1String("ExpireTimeout"), getExpireTimeout());
} }
void NotifyPluginConfiguration::restoreState(QSettings* settings) void NotificationItem::restoreState(QSettings* settings)
{ {
//settings = Core::ICore::instance()->settings(); //settings = Core::ICore::instance()->settings();
setSoundCollectionPath(Utils::PathUtils().InsertDataPath(settings->value(QLatin1String("SoundCollectionPath"), tr("")).toString())); setSoundCollectionPath(Utils::PathUtils().InsertDataPath(settings->value(QLatin1String("SoundCollectionPath"), tr("")).toString()));
@ -110,7 +110,7 @@ void NotifyPluginConfiguration::restoreState(QSettings* settings)
} }
QString NotifyPluginConfiguration::parseNotifyMessage() QString NotificationItem::parseNotifyMessage()
{ {
// tips: // tips:
// check of *.wav files exist needed for playing phonon queues; // check of *.wav files exist needed for playing phonon queues;
@ -121,30 +121,30 @@ QString NotifyPluginConfiguration::parseNotifyMessage()
str = QString("%L1 ").arg(getSpinBoxValue()); str = QString("%L1 ").arg(getSpinBoxValue());
int position = 0xFF; int position = 0xFF;
// generate queue of sound files to play // generate queue of sound files to play
notifyMessageList.clear(); _messageSequence.clear();
if(QFile::exists(QDir::toNativeSeparators(getSoundCollectionPath() + "/" + getCurrentLanguage()+"/"+getSound1()+".wav"))) if(QFile::exists(QDir::toNativeSeparators(getSoundCollectionPath() + "/" + getCurrentLanguage()+"/"+getSound1()+".wav")))
notifyMessageList.append(QDir::toNativeSeparators(getSoundCollectionPath() + "/" + getCurrentLanguage()+"/"+getSound1()+".wav")); _messageSequence.append(QDir::toNativeSeparators(getSoundCollectionPath() + "/" + getCurrentLanguage()+"/"+getSound1()+".wav"));
else else
if(QFile::exists(QDir::toNativeSeparators(getSoundCollectionPath() + "/default/"+getSound1()+".wav"))) if(QFile::exists(QDir::toNativeSeparators(getSoundCollectionPath() + "/default/"+getSound1()+".wav")))
notifyMessageList.append(QDir::toNativeSeparators(getSoundCollectionPath() + "/default/"+getSound1()+".wav")); _messageSequence.append(QDir::toNativeSeparators(getSoundCollectionPath() + "/default/"+getSound1()+".wav"));
if(getSound2()!="") if("" != getSound2())
{ {
if(QFile::exists(QDir::toNativeSeparators(getSoundCollectionPath() + "/" + getCurrentLanguage()+"/"+getSound2()+".wav"))) if(QFile::exists(QDir::toNativeSeparators(getSoundCollectionPath() + "/" + getCurrentLanguage()+"/"+getSound2()+".wav")))
notifyMessageList.append(QDir::toNativeSeparators(getSoundCollectionPath() + "/" + getCurrentLanguage()+"/"+getSound2()+".wav")); _messageSequence.append(QDir::toNativeSeparators(getSoundCollectionPath() + "/" + getCurrentLanguage()+"/"+getSound2()+".wav"));
else else
if(QFile::exists(QDir::toNativeSeparators(getSoundCollectionPath() + "/default/"+getSound2()+".wav"))) if(QFile::exists(QDir::toNativeSeparators(getSoundCollectionPath() + "/default/"+getSound2()+".wav")))
notifyMessageList.append(QDir::toNativeSeparators(getSoundCollectionPath() + "/default/"+getSound2()+".wav")); _messageSequence.append(QDir::toNativeSeparators(getSoundCollectionPath() + "/default/"+getSound2()+".wav"));
} }
if(getSound3()!="") if("" != getSound3())
{ {
if(QFile::exists(QDir::toNativeSeparators(getSoundCollectionPath()+ "/" + getCurrentLanguage()+"/"+getSound3()+".wav"))) if(QFile::exists(QDir::toNativeSeparators(getSoundCollectionPath()+ "/" + getCurrentLanguage()+"/"+getSound3()+".wav")))
notifyMessageList.append(QDir::toNativeSeparators(getSoundCollectionPath()+ "/" + getCurrentLanguage()+"/"+getSound3()+".wav")); _messageSequence.append(QDir::toNativeSeparators(getSoundCollectionPath()+ "/" + getCurrentLanguage()+"/"+getSound3()+".wav"));
else else
if(QFile::exists(QDir::toNativeSeparators(getSoundCollectionPath()+"/default/"+getSound3()+".wav"))) if(QFile::exists(QDir::toNativeSeparators(getSoundCollectionPath()+"/default/"+getSound3()+".wav")))
notifyMessageList.append(QDir::toNativeSeparators(getSoundCollectionPath()+"/default/"+getSound3()+".wav")); _messageSequence.append(QDir::toNativeSeparators(getSoundCollectionPath()+"/default/"+getSound3()+".wav"));
} }
switch(str1.at(0).toAscii()) switch(str1.at(0).toAscii())
@ -178,7 +178,7 @@ QString NotifyPluginConfiguration::parseNotifyMessage()
break; break;
} }
if(position!=0xFF) if(position != 0xFF)
{ {
QStringList numberParts = QString("%1").arg(getSpinBoxValue()).trimmed().split("."); QStringList numberParts = QString("%1").arg(getSpinBoxValue()).trimmed().split(".");
QStringList numberFiles; QStringList numberFiles;
@ -212,9 +212,9 @@ QString NotifyPluginConfiguration::parseNotifyMessage()
} }
} }
if(numberParts.size()>1) { if(1 < numberParts.size()) {
numberFiles.append("point"); numberFiles.append("point");
if((numberParts.at(1).size()==1) /*|| (numberParts.at(1).toInt()<20)*/) if((numberParts.at(1).size()==1))
numberFiles.append(numberParts.at(1)); numberFiles.append(numberParts.at(1));
else { else {
if(numberParts.at(1).left(1)=="0") if(numberParts.at(1).left(1)=="0")
@ -226,20 +226,18 @@ QString NotifyPluginConfiguration::parseNotifyMessage()
} }
foreach(QString fileName,numberFiles) { foreach(QString fileName,numberFiles) {
fileName+=".wav"; fileName+=".wav";
QString filePath = QDir::toNativeSeparators(getSoundCollectionPath()+"/"+ getCurrentLanguage()+"/"+fileName); QString filePath = QDir::toNativeSeparators(getSoundCollectionPath()+"/"+ getCurrentLanguage()+"/"+fileName);
if(QFile::exists(filePath)) if(QFile::exists(filePath))
notifyMessageList.insert(position++,QDir::toNativeSeparators(getSoundCollectionPath()+ "/"+getCurrentLanguage()+"/"+fileName)); _messageSequence.insert(position++,QDir::toNativeSeparators(getSoundCollectionPath()+ "/"+getCurrentLanguage()+"/"+fileName));
else { else {
if(QFile::exists(QDir::toNativeSeparators(getSoundCollectionPath()+"/default/"+fileName))) if(QFile::exists(QDir::toNativeSeparators(getSoundCollectionPath()+"/default/"+fileName)))
notifyMessageList.insert(position++,QDir::toNativeSeparators(getSoundCollectionPath()+"/default/"+fileName)); _messageSequence.insert(position++,QDir::toNativeSeparators(getSoundCollectionPath()+"/default/"+fileName));
else { else {
notifyMessageList.clear(); _messageSequence.clear();
break; // if no some of *.wav files, then don't play number! break; // if no some of *.wav files, then don't play number!
} }
} }
} }
} }
//str.replace(QString(".wav | .mp3"), QString(""));
return str; return str;
} }

View File

@ -1,122 +0,0 @@
/**
******************************************************************************
*
* @file notifypluginconfiguration.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Notify Plugin configuration header
* @see The GNU Public License (GPL) Version 3
* @defgroup notifyplugin
* @{
*
*****************************************************************************/
/*
* 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 NOTIFYPLUGINCONFIGURATION_H
#define NOTIFYPLUGINCONFIGURATION_H
#include <coreplugin/iuavgadgetconfiguration.h>
#include "qsettings.h"
#include <qstringlist.h>
#include <QTimer>
using namespace Core;
class NotifyPluginConfiguration : public QObject
{
Q_OBJECT
public:
explicit NotifyPluginConfiguration(QObject *parent = 0);
QTimer* timer;
QTimer* expireTimer;
bool isNowPlaying; //
bool firstStart;
void copyTo(NotifyPluginConfiguration*) const;
QString getSound1() const { return sound1; }
void setSound1(QString text) {sound1 = text; }
QString getSound2() const { return sound2; }
void setSound2(QString text) {sound2 = text; }
QString getSound3() const { return sound3; }
void setSound3(QString text) {sound3 = text; }
QString getValue() const { return value; }
void setValue(QString text) {value = text; }
QString getSayOrder() const { return sayOrder; }
void setSayOrder(QString text) {sayOrder = text; }
double getSpinBoxValue() const { return spinBoxValue; }
void setSpinBoxValue(double value) {spinBoxValue = value; }
QString getDataObject() const { return dataObject; }
void setDataObject(QString text) {dataObject = text; }
QString getObjectField() const { return objectField; }
void setObjectField(QString text) { objectField = text; }
QString getSoundCollectionPath() const { return soundCollectionPath; }
void setSoundCollectionPath(QString text) { soundCollectionPath = text; }
QString getCurrentLanguage() const { return currentLanguage; }
void setCurrentLanguage(QString text) { currentLanguage = text; }
QStringList getNotifyMessageList() const { return notifyMessageList; }
void setNotifyMessageList(QStringList text) { notifyMessageList = text; }
QString getRepeatFlag() const { return repeatString; }
void setRepeatFlag(QString value) { repeatString = value; }
bool getRepeatTimeout() const { return repeatTimeout; }
void setRepeatTimeout(bool value) { repeatTimeout = value; }
int getExpireTimeout() const { return expireTimeout; }
void setExpireTimeout(int value) { expireTimeout = value; }
void saveState(QSettings* settings) const;
void restoreState(QSettings* settings);
QString parseNotifyMessage();
private:
QStringList notifyMessageList;
QString soundCollectionPath;
QString currentLanguage;
QString dataObject;
QString objectField;
QString value;
QString sound1;
QString sound2;
QString sound3;
QString sayOrder;
double spinBoxValue;
QString repeatString;
bool repeatTimeout;
int repeatTimerValue;
int expireTimeout;
};
Q_DECLARE_METATYPE(NotifyPluginConfiguration*)
#endif // NOTIFYPLUGINCONFIGURATION_H

View File

@ -27,7 +27,7 @@
#include "notifypluginoptionspage.h" #include "notifypluginoptionspage.h"
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include "notifypluginconfiguration.h" #include "notificationitem.h"
#include "ui_notifypluginoptionspage.h" #include "ui_notifypluginoptionspage.h"
#include "extensionsystem/pluginmanager.h" #include "extensionsystem/pluginmanager.h"
#include "utils/pathutils.h" #include "utils/pathutils.h"
@ -44,7 +44,7 @@
#include "notifyitemdelegate.h" #include "notifyitemdelegate.h"
#include "notifytablemodel.h" #include "notifytablemodel.h"
NotifyPluginOptionsPage::NotifyPluginOptionsPage(/*NotifyPluginConfiguration *config,*/ QObject *parent) : NotifyPluginOptionsPage::NotifyPluginOptionsPage(/*NotificationItem *config,*/ QObject *parent) :
IOptionsPage(parent), IOptionsPage(parent),
owner((SoundNotifyPlugin*)parent), owner((SoundNotifyPlugin*)parent),
currentCollectionPath(""), currentCollectionPath(""),
@ -95,36 +95,29 @@ QWidget *NotifyPluginOptionsPage::createPage(QWidget *parent)
connect(options_page->buttonAdd, SIGNAL(pressed()), this, SLOT(on_buttonAddNotification_clicked())); connect(options_page->buttonAdd, SIGNAL(pressed()), this, SLOT(on_buttonAddNotification_clicked()));
connect(options_page->buttonDelete, SIGNAL(pressed()), this, SLOT(on_buttonDeleteNotification_clicked())); connect(options_page->buttonDelete, SIGNAL(pressed()), this, SLOT(on_buttonDeleteNotification_clicked()));
connect(options_page->buttonModify, SIGNAL(pressed()), this, SLOT(on_buttonModifyNotification_clicked())); connect(options_page->buttonModify, SIGNAL(pressed()), this, SLOT(on_buttonModifyNotification_clicked()));
// connect(options_page->buttonTestSound1, SIGNAL(clicked()), this, SLOT(on_buttonTestSound1_clicked()));
// connect(options_page->buttonTestSound2, SIGNAL(clicked()), this, SLOT(on_buttonTestSound2_clicked()));
connect(options_page->buttonPlayNotification, SIGNAL(clicked()), this, SLOT(on_buttonTestSoundNotification_clicked())); connect(options_page->buttonPlayNotification, SIGNAL(clicked()), this, SLOT(on_buttonTestSoundNotification_clicked()));
connect(options_page->chkEnableSound, SIGNAL(toggled(bool)), this, SLOT(on_chkEnableSound_toggled(bool))); connect(options_page->chkEnableSound, SIGNAL(toggled(bool)), this, SLOT(on_chkEnableSound_toggled(bool)));
connect(options_page->UAVObject, SIGNAL(currentIndexChanged(QString)), this, SLOT(on_UAVObject_indexChanged(QString))); connect(options_page->UAVObject, SIGNAL(currentIndexChanged(QString)), this, SLOT(on_UAVObject_indexChanged(QString)));
connect(this, SIGNAL(updateNotifications(QList<NotifyPluginConfiguration*>)), connect(this, SIGNAL(updateNotifications(QList<NotificationItem*>)),
owner, SLOT(updateNotificationList(QList<NotifyPluginConfiguration*>))); owner, SLOT(updateNotificationList(QList<NotificationItem*>)));
connect(this, SIGNAL(resetNotification()),owner, SLOT(resetNotification())); connect(this, SIGNAL(resetNotification()),owner, SLOT(resetNotification()));
//emit resetNotification(); //emit resetNotification();
privListNotifications.clear();
privListNotifications.clear(); for (int i = 0; i < owner->getListNotifications().size(); ++i) {
NotificationItem* notification = new NotificationItem();
for (int i = 0; i < owner->getListNotifications().size(); ++i) { owner->getListNotifications().at(i)->copyTo(notification);
NotifyPluginConfiguration* notification = new NotifyPluginConfiguration(); privListNotifications.append(notification);
owner->getListNotifications().at(i)->copyTo(notification);
privListNotifications.append(notification);
} }
updateConfigView(owner->getCurrentNotification()); updateConfigView(owner->getCurrentNotification());
options_page->chkEnableSound->setChecked(owner->getEnableSound()); options_page->chkEnableSound->setChecked(owner->getEnableSound());
QStringList headerStrings; notifyRulesModel = new NotifyTableModel(&privListNotifications);
headerStrings << "Name" << "Repeats" << "Lifetime,sec";
notifyRulesModel = new NotifyTableModel(&privListNotifications,headerStrings);
options_page->notifyRulesView->setModel(notifyRulesModel); options_page->notifyRulesView->setModel(notifyRulesModel);
options_page->notifyRulesView->resizeRowsToContents(); options_page->notifyRulesView->resizeRowsToContents();
notifyRulesSelection = new QItemSelectionModel(notifyRulesModel); notifyRulesSelection = new QItemSelectionModel(notifyRulesModel);
@ -135,50 +128,28 @@ QWidget *NotifyPluginOptionsPage::createPage(QWidget *parent)
connect(this, SIGNAL(entryAdded(int)), connect(this, SIGNAL(entryAdded(int)),
notifyRulesModel, SLOT(entryAdded(int))); notifyRulesModel, SLOT(entryAdded(int)));
options_page->notifyRulesView->setSelectionModel(notifyRulesSelection); options_page->notifyRulesView->setSelectionModel(notifyRulesSelection);
options_page->notifyRulesView->setItemDelegate(new NotifyItemDelegate(delegateItems,this)); options_page->notifyRulesView->setItemDelegate(new NotifyItemDelegate(delegateItems,this));
options_page->notifyRulesView->setColumnWidth(0,200); options_page->notifyRulesView->setColumnWidth(eMESSAGE_NAME,200);
options_page->notifyRulesView->setColumnWidth(1,150); options_page->notifyRulesView->setColumnWidth(eREPEAT_VALUE,120);
options_page->notifyRulesView->setColumnWidth(2,100); options_page->notifyRulesView->setColumnWidth(eEXPIRE_TIME,100);
options_page->notifyRulesView->setColumnWidth(eENABLE_NOTIFICATION,60);
options_page->buttonModify->setEnabled(false); options_page->buttonModify->setEnabled(false);
options_page->buttonDelete->setEnabled(false); options_page->buttonDelete->setEnabled(false);
options_page->buttonPlayNotification->setEnabled(false); options_page->buttonPlayNotification->setEnabled(false);
// sound1 = Phonon::createPlayer(Phonon::NotificationCategory);
// sound2 = Phonon::createPlayer(Phonon::NotificationCategory);
notifySound = Phonon::createPlayer(Phonon::NotificationCategory); notifySound = Phonon::createPlayer(Phonon::NotificationCategory);
// audioOutput = new Phonon::AudioOutput(Phonon::NotificationCategory, this);
// Phonon::createPath(sound1, audioOutput);
// Phonon::createPath(sound2, audioOutput);
// Phonon::createPath(notifySound, audioOutput);
// connect(sound1,SIGNAL(stateChanged(Phonon::State,Phonon::State)),SLOT(changeButtonText(Phonon::State,Phonon::State)));
// connect(sound2,SIGNAL(stateChanged(Phonon::State,Phonon::State)),SLOT(changeButtonText(Phonon::State,Phonon::State)));
connect(notifySound,SIGNAL(stateChanged(Phonon::State,Phonon::State)), connect(notifySound,SIGNAL(stateChanged(Phonon::State,Phonon::State)),
this,SLOT(changeButtonText(Phonon::State,Phonon::State))); this,SLOT(changeButtonText(Phonon::State,Phonon::State)));
connect(notifySound, SIGNAL(finished(void)), this, SLOT(onFinishedPlaying(void)));
return optionsPageWidget; return optionsPageWidget;
} }
void NotifyPluginOptionsPage::showPersistentComboBox( const QModelIndex & parent, int start, int end ) void NotifyPluginOptionsPage::getOptionsPageValues(NotificationItem* notification)
{
// for (int i=start; i<end+1; i++) {
// options_page->tableNotifications->openPersistentEditor(options_page->tableNotifications->item(i,1));
// }
}
void NotifyPluginOptionsPage::showPersistentComboBox2( const QModelIndex & topLeft, const QModelIndex & bottomRight )
{
//for (QModelIndex i=topLeft; i<bottomRight+1; i++)
{
// options_page->tableNotifications->openPersistentEditor(options_page->tableNotifications->item(options_page->tableNotifications->currentRow(),1));
}
}
void NotifyPluginOptionsPage::getOptionsPageValues(NotifyPluginConfiguration* notification)
{ {
notification->setSoundCollectionPath(options_page->SoundDirectoryPathChooser->path()); notification->setSoundCollectionPath(options_page->SoundDirectoryPathChooser->path());
notification->setCurrentLanguage(options_page->SoundCollectionList->currentText()); notification->setCurrentLanguage(options_page->SoundCollectionList->currentText());
@ -191,26 +162,16 @@ void NotifyPluginOptionsPage::getOptionsPageValues(NotifyPluginConfiguration* no
notification->setValue(options_page->Value->currentText()); notification->setValue(options_page->Value->currentText());
notification->setSpinBoxValue(options_page->ValueSpinBox->value()); notification->setSpinBoxValue(options_page->ValueSpinBox->value());
// if(notifyRulesSelection->currentIndex().row()>-1)
// {
// //qDebug() << "delegate value:" << options_page->tableNotifications->item(options_page->tableNotifications->currentRow(),1)->data(Qt::EditRole);
// notification->setRepeatFlag(notifyRulesModel->data(notifyRulesSelection->currentIndex(),Qt::DisplayRole).toString());
// }
} }
//////////////////////////////////////////// /*!
// Called when the user presses apply or OK. * Called when the user presses apply or OK.
// * Saves the current values
// Saves the current values */
//
////////////////////////////////////////////
void NotifyPluginOptionsPage::apply() void NotifyPluginOptionsPage::apply()
{ {
getOptionsPageValues(owner->getCurrentNotification());
getOptionsPageValues(owner->getCurrentNotification());
owner->setEnableSound(options_page->chkEnableSound->isChecked()); owner->setEnableSound(options_page->chkEnableSound->isChecked());
//owner->setListNotifications(privListNotifications);
emit updateNotifications(privListNotifications); emit updateNotifications(privListNotifications);
} }
@ -218,25 +179,22 @@ void NotifyPluginOptionsPage::finish()
{ {
disconnect(notifySound,SIGNAL(stateChanged(Phonon::State,Phonon::State)), disconnect(notifySound,SIGNAL(stateChanged(Phonon::State,Phonon::State)),
this,SLOT(changeButtonText(Phonon::State,Phonon::State))); this,SLOT(changeButtonText(Phonon::State,Phonon::State)));
if(notifySound) if (notifySound) {
{
notifySound->stop(); notifySound->stop();
notifySound->clear(); notifySound->clear();
} }
if (options_page)
delete options_page; delete options_page;
} }
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// Fills in the <Field> combo box when value is changed in the // Fills in the <Field> combo box when value is changed in the
// <Object> combo box // <Object> combo box
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
void NotifyPluginOptionsPage::on_UAVObject_indexChanged(QString val) { void NotifyPluginOptionsPage::on_UAVObject_indexChanged(QString val) {
options_page->UAVObjectField->clear(); options_page->UAVObjectField->clear();
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); ExtensionSystem::PluginManager* pm = ExtensionSystem::PluginManager::instance();
UAVObjectManager *objManager = pm->getObject<UAVObjectManager>(); UAVObjectManager* objManager = pm->getObject<UAVObjectManager>();
UAVDataObject* obj = dynamic_cast<UAVDataObject*>( objManager->getObject(val) ); UAVDataObject* obj = dynamic_cast<UAVDataObject*>( objManager->getObject(val) );
QList<UAVObjectField*> fieldList = obj->getFields(); QList<UAVObjectField*> fieldList = obj->getFields();
foreach (UAVObjectField* field, fieldList) { foreach (UAVObjectField* field, fieldList) {
@ -258,8 +216,8 @@ void NotifyPluginOptionsPage::on_soundLanguage_indexChanged(int index)
{ {
options_page->SoundCollectionList->setCurrentIndex(index); options_page->SoundCollectionList->setCurrentIndex(index);
currentCollectionPath = options_page->SoundDirectoryPathChooser->path() + currentCollectionPath = options_page->SoundDirectoryPathChooser->path()
QDir::toNativeSeparators("/" + options_page->SoundCollectionList->currentText()); + QDir::toNativeSeparators("/" + options_page->SoundCollectionList->currentText());
QDir dirPath(currentCollectionPath); QDir dirPath(currentCollectionPath);
QStringList filters; QStringList filters;
@ -280,30 +238,38 @@ void NotifyPluginOptionsPage::on_soundLanguage_indexChanged(int index)
void NotifyPluginOptionsPage::changeButtonText(Phonon::State newstate, Phonon::State oldstate) void NotifyPluginOptionsPage::changeButtonText(Phonon::State newstate, Phonon::State oldstate)
{ {
if(newstate == Phonon::PausedState || newstate == Phonon::StoppedState){ Q_ASSERT(Phonon::ErrorState != newstate);
if (newstate == Phonon::PausedState || newstate == Phonon::StoppedState) {
options_page->buttonPlayNotification->setText("Play"); options_page->buttonPlayNotification->setText("Play");
options_page->buttonPlayNotification->setIcon(QPixmap(":/notify/images/play.png")); options_page->buttonPlayNotification->setIcon(QPixmap(":/notify/images/play.png"));
} } else {
else if (newstate == Phonon::PlayingState) {
if(newstate == Phonon::PlayingState) { options_page->buttonPlayNotification->setText("Stop");
options_page->buttonPlayNotification->setText("Stop"); options_page->buttonPlayNotification->setIcon(QPixmap(":/notify/images/stop.png"));
options_page->buttonPlayNotification->setIcon(QPixmap(":/notify/images/stop.png")); }
} }
} }
void NotifyPluginOptionsPage::onFinishedPlaying()
{
notifySound->clear();
}
void NotifyPluginOptionsPage::on_buttonTestSoundNotification_clicked() void NotifyPluginOptionsPage::on_buttonTestSoundNotification_clicked()
{ {
// QList <Phonon::MediaSource> messageNotify; NotificationItem* notification = NULL;
NotifyPluginConfiguration *notification;
if(notifyRulesSelection->currentIndex().row()==-1) return; if (-1 == notifyRulesSelection->currentIndex().row())
return;
notifySound->clearQueue(); notifySound->clearQueue();
notification = privListNotifications.at(notifyRulesSelection->currentIndex().row()); notification = privListNotifications.at(notifyRulesSelection->currentIndex().row());
notification->parseNotifyMessage(); notification->parseNotifyMessage();
foreach(QString item, notification->getNotifyMessageList()) QStringList sequence = notification->getMessageSequence();
notifySound->enqueue(Phonon::MediaSource(item)); Q_ASSERT(!!sequence.size());
foreach(QString item, sequence)
notifySound->enqueue(Phonon::MediaSource(item));
notifySound->play(); notifySound->play();
} }
@ -316,25 +282,24 @@ void NotifyPluginOptionsPage::on_chkEnableSound_toggled(bool state)
audioOutput->setMuted(state1); audioOutput->setMuted(state1);
} }
void NotifyPluginOptionsPage::updateConfigView(NotifyPluginConfiguration* notification) void NotifyPluginOptionsPage::updateConfigView(NotificationItem* notification)
{ {
QString path = notification->getSoundCollectionPath(); QString path = notification->getSoundCollectionPath();
if(path=="") if (path == "") {
{
//QDir dir = QDir::currentPath(); //QDir dir = QDir::currentPath();
//path = QDir::currentPath().left(QDir::currentPath().indexOf("OpenPilot",0,Qt::CaseSensitive))+"../share/sounds"; //path = QDir::currentPath().left(QDir::currentPath().indexOf("OpenPilot",0,Qt::CaseSensitive))+"../share/sounds";
path = Utils::PathUtils().InsertDataPath("%%DATAPATH%%sounds"); path = Utils::PathUtils().InsertDataPath("%%DATAPATH%%sounds");
} }
options_page->SoundDirectoryPathChooser->setPath(path); options_page->SoundDirectoryPathChooser->setPath(path);
if(options_page->SoundCollectionList->findText(notification->getCurrentLanguage())!=-1){ if (-1 != options_page->SoundCollectionList->findText(notification->getCurrentLanguage())){
options_page->SoundCollectionList->setCurrentIndex(options_page->SoundCollectionList->findText(notification->getCurrentLanguage())); options_page->SoundCollectionList->setCurrentIndex(options_page->SoundCollectionList->findText(notification->getCurrentLanguage()));
} } else {
else
options_page->SoundCollectionList->setCurrentIndex(options_page->SoundCollectionList->findText("default")); options_page->SoundCollectionList->setCurrentIndex(options_page->SoundCollectionList->findText("default"));
}
if (options_page->UAVObject->findText(notification->getDataObject())!=-1){
if(options_page->UAVObject->findText(notification->getDataObject())!=-1){
options_page->UAVObject->setCurrentIndex(options_page->UAVObject->findText(notification->getDataObject())); options_page->UAVObject->setCurrentIndex(options_page->UAVObject->findText(notification->getDataObject()));
} }
@ -349,15 +314,13 @@ void NotifyPluginOptionsPage::updateConfigView(NotifyPluginConfiguration* notifi
} }
} }
if(options_page->UAVObjectField->findText(notification->getObjectField())!=-1){ if (-1 != options_page->UAVObjectField->findText(notification->getObjectField())) {
options_page->UAVObjectField->setCurrentIndex(options_page->UAVObjectField->findText(notification->getObjectField())); options_page->UAVObjectField->setCurrentIndex(options_page->UAVObjectField->findText(notification->getObjectField()));
} }
if(options_page->Sound1->findText(notification->getSound1())!=-1){ if (-1 != options_page->Sound1->findText(notification->getSound1())) {
options_page->Sound1->setCurrentIndex(options_page->Sound1->findText(notification->getSound1())); options_page->Sound1->setCurrentIndex(options_page->Sound1->findText(notification->getSound1()));
} } else {
else
{
// show item from default location // show item from default location
options_page->SoundCollectionList->setCurrentIndex(options_page->SoundCollectionList->findText("default")); options_page->SoundCollectionList->setCurrentIndex(options_page->SoundCollectionList->findText("default"));
options_page->Sound1->setCurrentIndex(options_page->Sound1->findText(notification->getSound1())); options_page->Sound1->setCurrentIndex(options_page->Sound1->findText(notification->getSound1()));
@ -366,10 +329,9 @@ void NotifyPluginOptionsPage::updateConfigView(NotifyPluginConfiguration* notifi
//options_page->Sound1->setCurrentIndex(-1); //options_page->Sound1->setCurrentIndex(-1);
} }
if(options_page->Sound2->findText(notification->getSound2())!=-1) { if (-1 != options_page->Sound2->findText(notification->getSound2())) {
options_page->Sound2->setCurrentIndex(options_page->Sound2->findText(notification->getSound2())); options_page->Sound2->setCurrentIndex(options_page->Sound2->findText(notification->getSound2()));
} } else {
else {
// show item from default location // show item from default location
options_page->SoundCollectionList->setCurrentIndex(options_page->SoundCollectionList->findText("default")); options_page->SoundCollectionList->setCurrentIndex(options_page->SoundCollectionList->findText("default"));
options_page->Sound2->setCurrentIndex(options_page->Sound2->findText(notification->getSound2())); options_page->Sound2->setCurrentIndex(options_page->Sound2->findText(notification->getSound2()));
@ -378,33 +340,33 @@ void NotifyPluginOptionsPage::updateConfigView(NotifyPluginConfiguration* notifi
//options_page->Sound2->setCurrentIndex(-1); //options_page->Sound2->setCurrentIndex(-1);
} }
if(options_page->Sound3->findText(notification->getSound3())!=-1) { if (-1 != options_page->Sound3->findText(notification->getSound3())) {
options_page->Sound3->setCurrentIndex(options_page->Sound3->findText(notification->getSound3())); options_page->Sound3->setCurrentIndex(options_page->Sound3->findText(notification->getSound3()));
} } else {
else {
// show item from default location // show item from default location
options_page->SoundCollectionList->setCurrentIndex(options_page->SoundCollectionList->findText("default")); options_page->SoundCollectionList->setCurrentIndex(options_page->SoundCollectionList->findText("default"));
options_page->Sound3->setCurrentIndex(options_page->Sound3->findText(notification->getSound3())); options_page->Sound3->setCurrentIndex(options_page->Sound3->findText(notification->getSound3()));
} }
if(options_page->Value->findText(notification->getValue())!=-1) { if (-1 != options_page->Value->findText(notification->getValue())) {
options_page->Value->setCurrentIndex(options_page->Value->findText(notification->getValue())); options_page->Value->setCurrentIndex(options_page->Value->findText(notification->getValue()));
} }
if(options_page->SayOrder->findText(notification->getSayOrder())!=-1) { if (-1 != options_page->SayOrder->findText(notification->getSayOrder())) {
options_page->SayOrder->setCurrentIndex(options_page->SayOrder->findText(notification->getSayOrder())); options_page->SayOrder->setCurrentIndex(options_page->SayOrder->findText(notification->getSayOrder()));
} }
options_page->ValueSpinBox->setValue(notification->getSpinBoxValue()); options_page->ValueSpinBox->setValue(notification->getSpinBoxValue());
} }
void NotifyPluginOptionsPage::on_tableNotification_changeSelection( const QItemSelection & selected, const QItemSelection & deselected ) void NotifyPluginOptionsPage::on_tableNotification_changeSelection( const QItemSelection & selected, const QItemSelection & deselected )
{ {
bool select = true; bool select = false;
notifySound->stop(); notifySound->stop();
if(selected.indexes().size()) if (selected.indexes().size()) {
select = true;
updateConfigView(privListNotifications.at(selected.indexes().at(0).row())); updateConfigView(privListNotifications.at(selected.indexes().at(0).row()));
else }
select = false;
options_page->buttonModify->setEnabled(select); options_page->buttonModify->setEnabled(select);
options_page->buttonDelete->setEnabled(select); options_page->buttonDelete->setEnabled(select);
@ -412,13 +374,11 @@ void NotifyPluginOptionsPage::on_tableNotification_changeSelection( const QItemS
} }
void NotifyPluginOptionsPage::on_buttonAddNotification_clicked() void NotifyPluginOptionsPage::on_buttonAddNotification_clicked()
{ {
NotifyPluginConfiguration* notification = new NotifyPluginConfiguration; NotificationItem* notification = new NotificationItem;
if(options_page->SoundDirectoryPathChooser->path()=="") if (options_page->SoundDirectoryPathChooser->path()=="") {
{
QPalette textPalette=options_page->SoundDirectoryPathChooser->palette(); QPalette textPalette=options_page->SoundDirectoryPathChooser->palette();
textPalette.setColor(QPalette::Normal,QPalette::Text, Qt::red); textPalette.setColor(QPalette::Normal,QPalette::Text, Qt::red);
options_page->SoundDirectoryPathChooser->setPalette(textPalette); options_page->SoundDirectoryPathChooser->setPalette(textPalette);
@ -433,20 +393,20 @@ void NotifyPluginOptionsPage::on_buttonAddNotification_clicked()
notification->setValue(options_page->Value->currentText()); notification->setValue(options_page->Value->currentText());
notification->setSpinBoxValue(options_page->ValueSpinBox->value()); notification->setSpinBoxValue(options_page->ValueSpinBox->value());
if(options_page->Sound1->currentText()!="") if (options_page->Sound1->currentText().size() > 0)
notification->setSound1(options_page->Sound1->currentText()); notification->setSound1(options_page->Sound1->currentText());
notification->setSound2(options_page->Sound2->currentText()); notification->setSound2(options_page->Sound2->currentText());
notification->setSound3(options_page->Sound3->currentText()); notification->setSound3(options_page->Sound3->currentText());
if(((options_page->Sound2->currentText()=="")&&(options_page->SayOrder->currentText()=="After second")) if ( ((!options_page->Sound2->currentText().size()) && (options_page->SayOrder->currentText()=="After second"))
|| ((options_page->Sound3->currentText()=="")&&(options_page->SayOrder->currentText()=="After third"))) || ((!options_page->Sound3->currentText().size()) && (options_page->SayOrder->currentText()=="After third")) ) {
return; return;
else } else {
notification->setSayOrder(options_page->SayOrder->currentText()); notification->setSayOrder(options_page->SayOrder->currentText());
}
privListNotifications.append(notification); privListNotifications.append(notification);
emit entryAdded(privListNotifications.size()-1); emit entryAdded(privListNotifications.size() - 1);
notifyRulesSelection->setCurrentIndex(notifyRulesModel->index(privListNotifications.size()-1,0,QModelIndex()), notifyRulesSelection->setCurrentIndex(notifyRulesModel->index(privListNotifications.size()-1,0,QModelIndex()),
QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows); QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows);
} }
@ -455,7 +415,9 @@ void NotifyPluginOptionsPage::on_buttonAddNotification_clicked()
void NotifyPluginOptionsPage::on_buttonDeleteNotification_clicked() void NotifyPluginOptionsPage::on_buttonDeleteNotification_clicked()
{ {
notifyRulesModel->removeRow(notifyRulesSelection->currentIndex().row()); notifyRulesModel->removeRow(notifyRulesSelection->currentIndex().row());
if(!notifyRulesModel->rowCount() && (notifyRulesSelection->currentIndex().row() > 0 && notifyRulesSelection->currentIndex().row() < notifyRulesModel->rowCount())) if (!notifyRulesModel->rowCount()
&& (notifyRulesSelection->currentIndex().row() > 0
&& notifyRulesSelection->currentIndex().row() < notifyRulesModel->rowCount()) )
{ {
options_page->buttonDelete->setEnabled(false); options_page->buttonDelete->setEnabled(false);
options_page->buttonModify->setEnabled(false); options_page->buttonModify->setEnabled(false);
@ -466,7 +428,7 @@ void NotifyPluginOptionsPage::on_buttonDeleteNotification_clicked()
void NotifyPluginOptionsPage::on_buttonModifyNotification_clicked() void NotifyPluginOptionsPage::on_buttonModifyNotification_clicked()
{ {
NotifyPluginConfiguration* notification = new NotifyPluginConfiguration; NotificationItem* notification = new NotificationItem;
getOptionsPageValues(notification); getOptionsPageValues(notification);
notification->setRepeatFlag(privListNotifications.at(notifyRulesSelection->currentIndex().row())->getRepeatFlag()); notification->setRepeatFlag(privListNotifications.at(notifyRulesSelection->currentIndex().row())->getRepeatFlag());
privListNotifications.replace(notifyRulesSelection->currentIndex().row(),notification); privListNotifications.replace(notifyRulesSelection->currentIndex().row(),notification);

View File

@ -45,7 +45,7 @@
class NotifyTableModel; class NotifyTableModel;
class NotifyPluginConfiguration; class NotificationItem;
class SoundNotifyPlugin; class SoundNotifyPlugin;
namespace Ui { namespace Ui {
@ -59,7 +59,7 @@ class NotifyPluginOptionsPage : public IOptionsPage
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit NotifyPluginOptionsPage(/*NotifyPluginConfiguration *config, */QObject *parent = 0); explicit NotifyPluginOptionsPage(/*NotificationItem *config, */QObject *parent = 0);
QString id() const { return QLatin1String("settings"); } QString id() const { return QLatin1String("settings"); }
QString trName() const { return tr("settings"); } QString trName() const { return tr("settings"); }
@ -73,8 +73,8 @@ public:
void finish(); void finish();
void restoreFromSettings(); void restoreFromSettings();
void updateConfigView(NotifyPluginConfiguration* notification); void updateConfigView(NotificationItem* notification);
void getOptionsPageValues(NotifyPluginConfiguration* notification); void getOptionsPageValues(NotificationItem* notification);
private: private:
UAVObjectManager *objManager; UAVObjectManager *objManager;
@ -90,24 +90,18 @@ private:
QStringList delegateItems; QStringList delegateItems;
NotifyTableModel* notifyRulesModel; NotifyTableModel* notifyRulesModel;
QItemSelectionModel *notifyRulesSelection; QItemSelectionModel *notifyRulesSelection;
QList<NotifyPluginConfiguration*> privListNotifications; QList<NotificationItem*> privListNotifications;
Ui::NotifyPluginOptionsPage *options_page; Ui::NotifyPluginOptionsPage *options_page;
//NotifyPluginConfiguration *notify;
signals: signals:
void updateNotifications(QList<NotifyPluginConfiguration*> list); void updateNotifications(QList<NotificationItem*> list);
void resetNotification(void); void resetNotification(void);
void entryUpdated(int index); void entryUpdated(int index);
void entryAdded(int position); void entryAdded(int position);
private slots: private slots:
void showPersistentComboBox( const QModelIndex & parent, int start, int end );
void showPersistentComboBox2 ( const QModelIndex & topLeft, const QModelIndex & bottomRight );
// void on_buttonTestSound1_clicked();
// void on_buttonTestSound2_clicked();
void on_buttonTestSoundNotification_clicked(); void on_buttonTestSoundNotification_clicked();
void on_buttonAddNotification_clicked(); void on_buttonAddNotification_clicked();
@ -119,6 +113,9 @@ private slots:
void on_UAVObject_indexChanged(QString val); void on_UAVObject_indexChanged(QString val);
void changeButtonText(Phonon::State newstate, Phonon::State oldstate); void changeButtonText(Phonon::State newstate, Phonon::State oldstate);
void on_chkEnableSound_toggled(bool state); void on_chkEnableSound_toggled(bool state);
void onFinishedPlaying(void);
}; };
#endif // NOTIFYPLUGINOPTIONSPAGE_H #endif // NOTIFYPLUGINOPTIONSPAGE_H

View File

@ -24,7 +24,7 @@
<rect> <rect>
<x>10</x> <x>10</x>
<y>10</y> <y>10</y>
<width>501</width> <width>551</width>
<height>81</height> <height>81</height>
</rect> </rect>
</property> </property>
@ -36,7 +36,7 @@
<rect> <rect>
<x>10</x> <x>10</x>
<y>20</y> <y>20</y>
<width>481</width> <width>531</width>
<height>51</height> <height>51</height>
</rect> </rect>
</property> </property>
@ -89,7 +89,7 @@ p, li { white-space: pre-wrap; }
<rect> <rect>
<x>10</x> <x>10</x>
<y>220</y> <y>220</y>
<width>501</width> <width>551</width>
<height>211</height> <height>211</height>
</rect> </rect>
</property> </property>
@ -101,7 +101,7 @@ p, li { white-space: pre-wrap; }
<rect> <rect>
<x>10</x> <x>10</x>
<y>180</y> <y>180</y>
<width>481</width> <width>531</width>
<height>26</height> <height>26</height>
</rect> </rect>
</property> </property>
@ -203,7 +203,7 @@ p, li { white-space: pre-wrap; }
<rect> <rect>
<x>10</x> <x>10</x>
<y>20</y> <y>20</y>
<width>481</width> <width>531</width>
<height>151</height> <height>151</height>
</rect> </rect>
</property> </property>
@ -226,7 +226,7 @@ p, li { white-space: pre-wrap; }
<rect> <rect>
<x>10</x> <x>10</x>
<y>100</y> <y>100</y>
<width>501</width> <width>551</width>
<height>31</height> <height>31</height>
</rect> </rect>
</property> </property>
@ -272,7 +272,7 @@ p, li { white-space: pre-wrap; }
<rect> <rect>
<x>7</x> <x>7</x>
<y>130</y> <y>130</y>
<width>501</width> <width>551</width>
<height>20</height> <height>20</height>
</rect> </rect>
</property> </property>
@ -285,7 +285,7 @@ p, li { white-space: pre-wrap; }
<rect> <rect>
<x>10</x> <x>10</x>
<y>180</y> <y>180</y>
<width>501</width> <width>551</width>
<height>31</height> <height>31</height>
</rect> </rect>
</property> </property>
@ -390,7 +390,7 @@ p, li { white-space: pre-wrap; }
<rect> <rect>
<x>10</x> <x>10</x>
<y>150</y> <y>150</y>
<width>501</width> <width>551</width>
<height>31</height> <height>31</height>
</rect> </rect>
</property> </property>

View File

@ -26,17 +26,30 @@
*/ */
#include "notifytablemodel.h" #include "notifytablemodel.h"
#include <qdebug.h>
NotifyTableModel::NotifyTableModel(QList<NotificationItem*>* parentList, QObject* parent)
: QAbstractTableModel(parent)
{
_headerStrings << "Name" << "Repeats" << "Lifetime,sec" << "Enable";
_list.reset(parentList);
}
bool NotifyTableModel::setData(const QModelIndex &index, bool NotifyTableModel::setData(const QModelIndex &index,
const QVariant &value, int role) const QVariant &value, int role)
{ {
if (index.isValid() && role == Qt::EditRole) { if (index.isValid() && role == Qt::EditRole) {
if(index.column()==1) if(eREPEAT_VALUE == index.column())
_list->at(index.row())->setRepeatFlag(value.toString()); _list->at(index.row())->setRepeatFlag(value.toString());
else else {
if(index.column()==2) if(eEXPIRE_TIME == index.column())
_list->at(index.row())->setExpireTimeout(value.toInt()); _list->at(index.row())->setExpireTimeout(value.toInt());
else {
if(eENABLE_NOTIFICATION == index.column())
_list->at(index.row())->setEnableFlag(value.toBool());
}
}
emit dataChanged(index, index); emit dataChanged(index, index);
return true; return true;
} }
@ -45,9 +58,10 @@ bool NotifyTableModel::setData(const QModelIndex &index,
QVariant NotifyTableModel::data(const QModelIndex &index, int role) const QVariant NotifyTableModel::data(const QModelIndex &index, int role) const
{ {
if (!index.isValid()) {
if (!index.isValid()) qWarning() << "NotifyTableModel::data - index.isValid()";
return QVariant(); return QVariant();
}
if (index.row() >= _list->size()) if (index.row() >= _list->size())
return QVariant(); return QVariant();
@ -56,15 +70,18 @@ QVariant NotifyTableModel::data(const QModelIndex &index, int role) const
{ {
switch(index.column()) switch(index.column())
{ {
case 0: case eMESSAGE_NAME:
return _list->at(index.row())->parseNotifyMessage(); return _list->at(index.row())->parseNotifyMessage();
case 1: case eREPEAT_VALUE:
return _list->at(index.row())->getRepeatFlag(); return _list->at(index.row())->getRepeatFlag();
case 2: case eEXPIRE_TIME:
return _list->at(index.row())->getExpireTimeout(); return _list->at(index.row())->getExpireTimeout();
case eENABLE_NOTIFICATION:
return _list->at(index.row())->getEnableFlag();
default: default:
return QVariant(); return QVariant();
} }
@ -72,12 +89,8 @@ QVariant NotifyTableModel::data(const QModelIndex &index, int role) const
else else
{ {
if (Qt::SizeHintRole == role){ if (Qt::SizeHintRole == role){
//QVariant size = data(index, Qt::SizeHintRole);
return QVariant(10); return QVariant(10);
} }
// if(role == Qt::DecorationRole)
// if (index.column() == 0)
// return defectsIcons[defectList->at(index.row()).id-1];
} }
return QVariant(); return QVariant();
} }
@ -88,7 +101,7 @@ QVariant NotifyTableModel::headerData(int section, Qt::Orientation orientation,
return QVariant(); return QVariant();
if (orientation == Qt::Horizontal) if (orientation == Qt::Horizontal)
return headerStrings.at(section); return _headerStrings.at(section);
else else
if(orientation == Qt::Vertical) if(orientation == Qt::Vertical)
return QString("%1").arg(section); return QString("%1").arg(section);
@ -100,12 +113,6 @@ bool NotifyTableModel::insertRows(int position, int rows, const QModelIndex &ind
{ {
Q_UNUSED(index); Q_UNUSED(index);
beginInsertRows(QModelIndex(), position, position+rows-1); beginInsertRows(QModelIndex(), position, position+rows-1);
// for (int row=0; row < rows; ++row) {
// _list->append(position);
// }
endInsertRows(); endInsertRows();
return true; return true;
} }

View File

@ -31,26 +31,28 @@
#include <QAbstractTableModel> #include <QAbstractTableModel>
#include <QList> #include <QList>
#include "notifypluginconfiguration.h" #include "notificationitem.h"
enum ColumnNames { eMESSAGE_NAME, eREPEAT_VALUE, eEXPIRE_TIME, eENABLE_NOTIFICATION };
class NotifyTableModel : public QAbstractTableModel class NotifyTableModel : public QAbstractTableModel
{ {
Q_OBJECT Q_OBJECT
public:
NotifyTableModel(QList<NotifyPluginConfiguration*> *parentList, const QStringList& parentHeaderList, QObject *parent = 0)
: QAbstractTableModel(parent),
_list(parentList),
headerStrings(parentHeaderList)
{ }
int rowCount(const QModelIndex &parent = QModelIndex()) const enum {eColumnCount = 4 };
public:
NotifyTableModel(QList<NotificationItem*>* parentList, QObject* parent = 0);
int rowCount(const QModelIndex& parent = QModelIndex()) const
{ {
return _list->count(); return _list->count();
} }
int columnCount(const QModelIndex &/*parent*/) const int columnCount(const QModelIndex &/*parent*/) const
{ {
return 3; return eColumnCount;
} }
Qt::ItemFlags flags(const QModelIndex &index) const Qt::ItemFlags flags(const QModelIndex &index) const
@ -71,8 +73,8 @@ private slots:
void entryUpdated(int offset); void entryUpdated(int offset);
void entryAdded(int position); void entryAdded(int position);
private: private:
QList<NotifyPluginConfiguration*> *_list; QScopedPointer<QList<NotificationItem*> > _list;
QStringList headerStrings; QStringList _headerStrings;
}; };

3
openpilotgcs.bat Normal file
View File

@ -0,0 +1,3 @@
cd D:\Qt\4.7.3\bin\
call D:\!Work\OpenSource\OpenPilot\OpenPilot\build\ground\openpilotgcs\bin\openpilotgcs.exe