cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
osaXML1394.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */
3 
4 /*
5  Author(s): Jonathan Bohren
6  Created on: 2013-06-29
7 
8  (C) Copyright 2013 Johns Hopkins University (JHU), All Rights Reserved.
9 
10 --- begin cisst license - do not edit ---
11 
12 This software is provided "as is" under an open source license, with
13 no warranty. The complete license can be found in license.txt and
14 http://www.cisst.org/cisst/license.txt.
15 
16 --- end cisst license ---
17 */
18 
19 #ifndef _osaXML1394_h
20 #define _osaXML1394_h
21 
22 #include <cisstCommon/cmnXMLPath.h>
25 
26 namespace sawRobotIO1394 {
27 
28  template <typename _elementType>
29  bool osaXML1394GetValue(cmnXMLPath & path, const std::string & context, const std::string & XPath,
30  _elementType & value, bool required = true) {
31  bool found = path.GetXMLValue(context.c_str(), XPath.c_str(), value);
32  if (required && !found) {
33  CMN_LOG_INIT_ERROR << "osaXML1394GetValue: " << XPath << " in context " << context << " is required but not found" << std::endl;
34  return false;
35  }
36  return true;
37  }
38 
39  void osaXML1394ConfigurePort(const std::string & filename,
40  osaPort1394Configuration & config);
41 
42  bool osaXML1394ConfigureRobot(cmnXMLPath & xmlConfig,
43  const int robotIndex,
44  osaRobot1394Configuration & robot);
45 
46  bool osaXML1394ConfigureCoupling(cmnXMLPath & xmlConfig,
47  const int robotIndex,
48  osaRobot1394Configuration & robot);
49 
50  bool osaXML1394ConfigureCouplingMatrix(cmnXMLPath & xmlConfig,
51  const int robotIndex,
52  const char * couplingString,
53  int numRows,
54  int numCols,
55  vctDoubleMat & resultMatrix);
56 
57  bool osaXML1394ConfigureDigitalInput(cmnXMLPath & xmlConfig,
58  const int inputIndex,
59  osaDigitalInput1394Configuration & digitalInput);
60 
61  bool osaXML1394ConfigureDigitalOutput(cmnXMLPath & xmlConfig,
62  const int outputIndex,
63  osaDigitalOutput1394Configuration & digitalOutput);
64 
65 } // namespace sawRobotIO1394
66 
67 #endif // _osaXML1394_h
Defines XMLPath.
bool osaXML1394GetValue(cmnXMLPath &path, const std::string &context, const std::string &XPath, _elementType &value, bool required=true)
Definition: osaXML1394.h:29
void osaXML1394ConfigurePort(const std::string &filename, osaPort1394Configuration &config)
#define CMN_LOG_INIT_ERROR
Definition: cmnLogger.h:162
bool osaXML1394ConfigureCouplingMatrix(cmnXMLPath &xmlConfig, const int robotIndex, const char *couplingString, int numRows, int numCols, vctDoubleMat &resultMatrix)
Typedef for dynamic matrices.
bool osaXML1394ConfigureDigitalOutput(cmnXMLPath &xmlConfig, const int outputIndex, osaDigitalOutput1394Configuration &digitalOutput)
bool osaXML1394ConfigureCoupling(cmnXMLPath &xmlConfig, const int robotIndex, osaRobot1394Configuration &robot)
bool osaXML1394ConfigureDigitalInput(cmnXMLPath &xmlConfig, const int inputIndex, osaDigitalInput1394Configuration &digitalInput)
bool osaXML1394ConfigureRobot(cmnXMLPath &xmlConfig, const int robotIndex, osaRobot1394Configuration &robot)