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 
25 #include "PointCloudStatechartContext.generated.h"
26 
28 {
29  // DO NOT EDIT NEXT LINE
30  CaptureNumberOfFrames::SubClassRegistry
31  CaptureNumberOfFrames::Registry(CaptureNumberOfFrames::GetName(),
33 
34  void
36  {
37  std::string providerName = in.getProviderName();
38  int numberOfFrames = in.getNumberOfFrames();
39  PointCloudStatechartContext* context = getContext<PointCloudStatechartContext>();
40 
41  visionx::CapturingPointCloudProviderInterfacePrx providerPrx;
42 
43  try
44  {
45  providerPrx =
46  context->getIceManager()
47  ->getProxy<visionx::CapturingPointCloudProviderInterfacePrx>(providerName);
48  }
49  catch (...)
50  {
51  }
52 
53  if (providerPrx)
54  {
55  providerPrx->startCaptureForNumFrames(numberOfFrames);
56  emitSuccess();
57  }
58  else
59  {
60  emitFailure();
61  }
62  }
63 
64  void
66  {
67  // put your user code for the exit point here
68  // execution time should be short (<100ms)
69  }
70 
71  // DO NOT EDIT NEXT FUNCTION
74  {
75  return XMLStateFactoryBasePtr(new CaptureNumberOfFrames(stateData));
76  }
77 } // namespace armarx::PointCloud
armarx::PointCloud::CaptureNumberOfFrames::Registry
static SubClassRegistry Registry
Definition: CaptureNumberOfFrames.h:47
armarx::XMLStateConstructorParams
Definition: XMLState.h:49
armarx::PointCloud::CaptureNumberOfFrames::onExit
void onExit() override
Definition: CaptureNumberOfFrames.cpp:65
armarx::XMLStateFactoryBasePtr
IceInternal::Handle< XMLStateFactoryBase > XMLStateFactoryBasePtr
Definition: XMLState.h:64
IceInternal::Handle
Definition: forward_declarations.h:8
armarx::PointCloud::CaptureNumberOfFrames::CreateInstance
static XMLStateFactoryBasePtr CreateInstance(XMLStateConstructorParams stateData)
Definition: CaptureNumberOfFrames.cpp:73
armarx::PointCloud::CaptureNumberOfFrames::onEnter
void onEnter() override
Definition: CaptureNumberOfFrames.cpp:35
armarx::PointCloud::CaptureNumberOfFrames::CaptureNumberOfFrames
CaptureNumberOfFrames(const XMLStateConstructorParams &stateData)
Definition: CaptureNumberOfFrames.h:33
CaptureNumberOfFrames.h
armarx::PointCloud
Definition: CaptureNumberOfFrames.cpp:27