Commit 6ee4605b authored by fw4splbot's avatar fw4splbot
Browse files

merge(dev): release 15.0.0

parents bc9d2d1c ea06a07d
fwLoadProperties()
find_package(Qt5 COMPONENTS Core Gui Widgets REQUIRED)
find_package(Qt5 QUIET COMPONENTS Core Gui Widgets REQUIRED)
fwForwardInclude(
${Qt5Core_INCLUDE_DIRS}
......
fwLoadProperties()
find_package (Boost COMPONENTS regex REQUIRED)
find_package(Boost QUIET COMPONENTS regex REQUIRED)
fwForwardInclude(${Boost_INCLUDE_DIRS})
......
/* ***** BEGIN LICENSE BLOCK *****
* FW4SPL - Copyright (C) IRCAD, 2009-2017.
* FW4SPL - Copyright (C) IRCAD, 2009-2018.
* Distributed under the terms of the GNU Lesser General Public License (LGPL) as
* published by the Free Software Foundation.
* ****** END LICENSE BLOCK ****** */
#ifndef __GUI_ACTION_SSTARTER_HPP__
#define __GUI_ACTION_SSTARTER_HPP__
#pragma once
#include "gui/config.hpp"
......@@ -34,6 +33,14 @@ namespace action
* If the service is stopped, the service specified by "Uid_of_the_service" is started and updated. Otherwise it is just
* updated.
*
* - Only start a service :
* @code{.xml}
<service uid="actionUid" type="::fwGui::IActionSrv" impl="::gui::action::SStarter" autoConnect="no">
<start_only uid="Uid_of_the_service" />
</service>
@endcode
* If the service is stopped, the service specified by "Uid_of_the_service" is started. Otherwise nothing happens.
*
* - Start a service if exists :
* @code{.xml}
<service uid="actionUid" type="::fwGui::IActionSrv" impl="::gui::action::SStarter" autoConnect="no">
......@@ -58,15 +65,23 @@ namespace action
@endcode
* Test if the service specified by "Uid_of_the_service" exists before stopping it.
*
* - Start or stop the service:
* - Start and update or stop the service:
* @code{.xml}
<service uid="actionUid" type="::fwGui::IActionSrv" impl="::gui::action::SStarter" autoConnect="no">
<start_or_stop uid="Uid_of_the_service" />
</service>
@endcode
* If the service is stopped, this works as start the service. If the service is started, this works as stop the
* If the service is stopped, this starts and updates the service. If the service is started, this stops the
* service.
*
* - Only start or stop the service:
* @code{.xml}
<service uid="actionUid" type="::fwGui::IActionSrv" impl="::gui::action::SStarter" autoConnect="no">
<start_only_or_stop uid="Uid_of_the_service" />
</service>
@endcode
* If the service is stopped, this starts the service. If the service is started, this stops the
* service.
* To notice : when the starterActionService is stopped, it stops all the associated services which have been started by
* itself.
*/
......@@ -97,6 +112,8 @@ protected:
STOP,
START_OR_STOP,
START_IF_EXISTS,
START_ONLY,
START_ONLY_OR_STOP,
STOP_IF_EXISTS,
DO_NOTHING
};
......@@ -138,5 +155,3 @@ private:
} // namespace action
} // namespace gui
#endif /*__GUI_ACTION_SSTARTER_HPP__*/
......@@ -18,6 +18,8 @@
#include <fwTools/fwID.hpp>
#include <boost/range/adaptor/reversed.hpp>
namespace gui
{
namespace action
......@@ -50,7 +52,7 @@ void SStarter::stopping()
{
std::vector< ::fwServices::IService::SharedFutureType > futures;
for( VectPairIDActionType::value_type serviceUid : m_uuidServices)
for( VectPairIDActionType::value_type serviceUid : ::boost::adaptors::reverse(m_uuidServices) )
{
bool srv_exists = ::fwTools::fwID::exist(serviceUid.first );
if (srv_exists && (m_idStartedSrvSet.find(serviceUid.first) != m_idStartedSrvSet.end()) )
......@@ -132,6 +134,20 @@ void SStarter::updating()
}
break;
}
case START_ONLY_OR_STOP:
{
if(service->isStopped())
{
service->start();
m_idStartedSrvSet.insert(uid);
}
else
{
service->stop();
m_idStartedSrvSet.erase(uid);
}
break;
}
case START:
{
if(service->isStopped())
......@@ -158,6 +174,19 @@ void SStarter::updating()
}
break;
}
case START_ONLY:
{
if(service->isStopped())
{
service->start();
m_idStartedSrvSet.insert(uid);
}
else
{
OSLM_WARN("Service " << service->getID() << " is not stopped");
}
break;
}
default:
{
OSLM_FATAL("There is no action ("<< action
......@@ -203,6 +232,10 @@ void SStarter::configuring()
{
action = START_OR_STOP;
}
else if ( actionType == "start_only_or_stop" )
{
action = START_ONLY_OR_STOP;
}
else if ( actionType == "start_if_exists" )
{
action = START_IF_EXISTS;
......@@ -211,6 +244,10 @@ void SStarter::configuring()
{
action = STOP_IF_EXISTS;
}
else if ( actionType == "start_only" )
{
action = START_ONLY;
}
else
{
OSLM_WARN("The \"actionType\":" << actionType <<" is not managed by SStarter");
......
fwLoadProperties()
find_package (Boost COMPONENTS regex REQUIRED)
find_package(Boost QUIET COMPONENTS regex REQUIRED)
fwForwardInclude(
......
fwLoadProperties()
find_package (Boost COMPONENTS regex REQUIRED)
find_package(Boost QUIET COMPONENTS regex REQUIRED)
fwLink(${Boost_REGEX_LIBRARY})
fwLoadProperties()
find_package(Qt5 COMPONENTS Core Gui Widgets REQUIRED)
find_package(Qt5 QUIET COMPONENTS Core Gui Widgets REQUIRED)
fwLink(
${Qt5Core_LIBRARIES}
${Qt5Gui_LIBRARIES}
......
fwLoadProperties()
find_package(Qt5 COMPONENTS Core Gui Widgets REQUIRED)
find_package(Qt5 QUIET COMPONENTS Core Gui Widgets REQUIRED)
fwLink(
${Qt5Core_LIBRARIES}
......
fwLoadProperties()
find_package(DCMTK REQUIRED)
find_package(DCMTK QUIET REQUIRED)
fwInclude( ${DCMTK_config_INCLUDE_DIRS} )
fwLink( ${DCMTK_LIBRARIES} )
find_package(Qt5 COMPONENTS Core Gui Widgets REQUIRED)
find_package(Qt5 QUIET COMPONENTS Core Gui Widgets REQUIRED)
fwForwardInclude(
${Qt5Core_INCLUDE_DIRS}
${Qt5Gui_INCLUDE_DIRS}
......
fwLoadProperties()
find_package(CppUnit)
find_package(CppUnit QUIET REQUIRED)
fwInclude(${CPPUNIT_INCLUDE_DIR})
fwLink(${CPPUNIT_LIBRARY})
fwLoadProperties()
find_package(Qt5 COMPONENTS PrintSupport REQUIRED)
find_package(Qt5 QUIET COMPONENTS PrintSupport REQUIRED)
fwForwardInclude(
${Qt5PrintSupport_INCLUDE_DIRS}
......
fwLoadProperties()
if(NOT ANDROID)
find_package(VTK COMPONENTS vtkIOImport REQUIRED NO_MODULE)
find_package(VTK QUIET COMPONENTS vtkIOImport REQUIRED NO_MODULE)
include(${VTK_USE_FILE})
endif()
......
fwLoadProperties()
find_package(VTK COMPONENTS vtkInteractionWidgets NO_MODULE)
find_package(VTK QUIET COMPONENTS vtkInteractionWidgets NO_MODULE)
include(${VTK_USE_FILE})
......
fwLoadProperties()
find_package(Qt5 COMPONENTS Core Gui Widgets REQUIRED)
find_package(ITK REQUIRED)
find_package(VTK COMPONENTS vtkCommonDataModel NO_MODULE REQUIRED)
find_package(Qt5 QUIET COMPONENTS Core Gui Widgets REQUIRED)
find_package(ITK QUIET REQUIRED)
find_package(VTK QUIET COMPONENTS vtkCommonDataModel NO_MODULE REQUIRED)
include(${VTK_USE_FILE})
fwForwardInclude(
......
......@@ -231,9 +231,19 @@ void SPointListRegistration::computeRegistration(::fwCore::HiResClock::HiResCloc
}
else
{
::fwGui::dialog::MessageDialog::showMessageDialog("Error",
"You must enter 2 or more points for the registration to work.",
::fwGui::dialog::IMessageDialog::WARNING);
if(registeredPL->getPoints().size() < 3)
{
::fwGui::dialog::MessageDialog::showMessageDialog("Error",
"You must enter 3 or more points for the registration to work.",
::fwGui::dialog::IMessageDialog::WARNING);
}
else
{
std::string msg = "The pointlists doesn't have the same number of points : ";
msg += std::to_string(registeredPL->getPoints().size()) + " != " + std::to_string(
referencePL->getPoints().size());
::fwGui::dialog::MessageDialog::showMessageDialog("Error", msg, ::fwGui::dialog::IMessageDialog::WARNING);
}
}
}
......
fwLoadProperties()
find_package(Qt5 COMPONENTS Core REQUIRED)
find_package(Qt5 QUIET COMPONENTS Core REQUIRED)
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/${BUNDLE_RC_PREFIX}/${${FWPROJECT_NAME}_FULLNAME}")
......
fwLoadProperties()
find_package(Boost COMPONENTS Regex REQUIRED)
find_package(Qt5 COMPONENTS Core Gui Widgets REQUIRED)
find_package(Boost QUIET COMPONENTS Regex REQUIRED)
find_package(Qt5 QUIET COMPONENTS Core Gui Widgets REQUIRED)
fwForwardInclude(
......
fwLoadProperties()
find_package(Qt5 COMPONENTS Core Gui Widgets REQUIRED)
find_package(Qt5 QUIET COMPONENTS Core Gui Widgets REQUIRED)
fwInclude(
${Qt5Core_INCLUDE_DIRS}
......
fwLoadProperties()
find_package(Qt5 COMPONENTS Core Gui Widgets REQUIRED)
find_package (LibXml2)
find_package(Qt5 QUIET COMPONENTS Core Gui Widgets REQUIRED)
find_package(LibXml2 QUIET REQUIRED)
fwForwardInclude(
${Qt5Core_INCLUDE_DIRS}
......
fwLoadProperties()
find_package(Qt5 COMPONENTS Core Gui Help Widgets REQUIRED)
find_package(Qt5 QUIET COMPONENTS Core Gui Help Widgets REQUIRED)
fwForwardInclude(
${Qt5Core_INCLUDE_DIRS}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment