CaptureNumberOfFrames.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * ArmarX is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  *
8  * ArmarX is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * @package VisionX::PointCloud
17  * @author Markus Grotz ( markus dot grotz at kit dot edu )
18  * @date 2016
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #include "CaptureNumberOfFrames.h"
24 #include "PointCloudStatechartContext.generated.h"
26 {
27  // DO NOT EDIT NEXT LINE
28  CaptureNumberOfFrames::SubClassRegistry CaptureNumberOfFrames::Registry(CaptureNumberOfFrames::GetName(), &CaptureNumberOfFrames::CreateInstance);
29 
30 
31 
33  {
34  std::string providerName = in.getProviderName();
35  int numberOfFrames = in.getNumberOfFrames();
36  PointCloudStatechartContext* context = getContext<PointCloudStatechartContext>();
37 
38  visionx::CapturingPointCloudProviderInterfacePrx providerPrx;
39 
40  try
41  {
42  providerPrx = context->getIceManager()->getProxy<visionx::CapturingPointCloudProviderInterfacePrx>(providerName);
43  }
44  catch (...)
45  {
46 
47  }
48 
49  if (providerPrx)
50  {
51  providerPrx->startCaptureForNumFrames(numberOfFrames);
52  emitSuccess();
53  }
54  else
55  {
56  emitFailure();
57  }
58  }
59 
60 
62  {
63  // put your user code for the exit point here
64  // execution time should be short (<100ms)
65  }
66 
67 
68  // DO NOT EDIT NEXT FUNCTION
70  {
71  return XMLStateFactoryBasePtr(new CaptureNumberOfFrames(stateData));
72  }
73 }
armarx::PointCloud::CaptureNumberOfFrames::Registry
static SubClassRegistry Registry
Definition: CaptureNumberOfFrames.h:50
armarx::XMLStateConstructorParams
Definition: XMLState.h:50
armarx::PointCloud::CaptureNumberOfFrames::onExit
void onExit() override
Definition: CaptureNumberOfFrames.cpp:61
IceInternal::Handle
Definition: forward_declarations.h:8
armarx::PointCloud::CaptureNumberOfFrames::CreateInstance
static XMLStateFactoryBasePtr CreateInstance(XMLStateConstructorParams stateData)
Definition: CaptureNumberOfFrames.cpp:69
armarx::PointCloud::CaptureNumberOfFrames::onEnter
void onEnter() override
Definition: CaptureNumberOfFrames.cpp:32
armarx::PointCloud::CaptureNumberOfFrames::CaptureNumberOfFrames
CaptureNumberOfFrames(const XMLStateConstructorParams &stateData)
Definition: CaptureNumberOfFrames.h:37
armarx::XMLStateFactoryBasePtr
IceInternal::Handle< XMLStateFactoryBase > XMLStateFactoryBasePtr
Definition: XMLState.h:65
CaptureNumberOfFrames.h
armarx::PointCloud
Definition: CaptureNumberOfFrames.cpp:25