Laelaps  2.3.5
RoadNarrows Robotics Small Outdoor Mobile Robot Project
diagCam.cxx
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // Package: Laelaps
4 //
5 // Program: laelaps_diag
6 //
7 // File: diagCam.cxx
8 //
9 /*! \file
10  *
11  * $LastChangedDate: 2016-02-01 15:14:45 -0700 (Mon, 01 Feb 2016) $
12  * $Rev: 4289 $
13  *
14  * \brief Perform Laelaps cameras diagnostics.
15  *
16  * \author Robin Knight (robin.knight@roadnarrows.com)
17  *
18  * \par Copyright
19  * \h_copy 2015-2017. RoadNarrows LLC.\n
20  * http://www.roadnarrows.com\n
21  * All Rights Reserved
22  */
23 /*
24  * @EulaBegin@
25  *
26  * Unless otherwise stated explicitly, all materials contained are copyrighted
27  * and may not be used without RoadNarrows LLC's written consent,
28  * except as provided in these terms and conditions or in the copyright
29  * notice (documents and software) or other proprietary notice provided with
30  * the relevant materials.
31  *
32  * IN NO EVENT SHALL THE AUTHOR, ROADNARROWS LLC, OR ANY
33  * MEMBERS/EMPLOYEES/CONTRACTORS OF ROADNARROWS OR DISTRIBUTORS OF THIS SOFTWARE
34  * BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR
35  * CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
36  * DOCUMENTATION, EVEN IF THE AUTHORS OR ANY OF THE ABOVE PARTIES HAVE BEEN
37  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38  *
39  * THE AUTHORS AND ROADNARROWS LLC SPECIFICALLY DISCLAIM ANY WARRANTIES,
40  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
41  * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN
42  * "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO
43  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
44  *
45  * @EulaEnd@
46  */
47 ////////////////////////////////////////////////////////////////////////////////
48 
49 #include <unistd.h>
50 #include <termios.h>
51 #include <string.h>
52 #include <stdio.h>
53 #include <stdlib.h>
54 #include <stdarg.h>
55 
56 #include <iostream>
57 #include <fstream>
58 #include <string>
59 #include <vector>
60 
61 #include "rnr/rnrconfig.h"
62 #include "rnr/log.h"
63 #include "rnr/opts.h"
64 #include "rnr/pkg.h"
65 
66 // common
67 #include "Laelaps/laelaps.h"
68 #include "Laelaps/laeUtils.h"
69 
70 // hardware
71 #include "Laelaps/laeCams.h"
72 
73 #include "laelaps_diag.h"
74 
75 using namespace std;
76 using namespace laelaps;
77 
78 static const char *SubSysName = "Camera";
79 
80 static DiagStats initCams()
81 {
82  DiagStats stats;
83 
84  printSubHdr("Initialize Cameras");
85 
86  printTestResult(FatalTag, "%s diagnostics not supported yet.", SubSysName);
87 
88  ++stats.testCnt;
89  stats.fatal = true;
90 
91  return stats;
92 }
93 
94 DiagStats runCamDiagnostics()
95 {
96  DiagStats statsTest;
97  DiagStats statsTotal;
98 
99  printHdr("Camera Diagnostics");
100 
101  //
102  // Init Tests
103  //
104  statsTest = initCams();
105 
106  printSubTotals(statsTest);
107 
108  statsTotal += statsTest;
109 
110 #if 0
111  //
112  // X Tests
113  //
114  if( !statsTotal.fatal )
115  {
116  statsTest = readInfo();
117 
118  printSubTotals(statsTest);
119 
120  statsTotal += statsTest;
121  }
122 #endif
123 
124  //
125  // Summary
126  //
127  printTotals(statsTotal);
128 
129  return statsTotal;
130 }
Diagnotics header file.
The <b><i>Laelaps</i></b> namespace encapsulates all <b><i>Laelaps</i></b> related constructs...
Definition: laeAlarms.h:64
Simple diagnostics statistics class.
Definition: laelaps_diag.h:106
Laelaps common utilities.
Laelaps supported cameras.
Top-level package include file.