Main Page   Hardware Class Hierarchy   Hardware API     Mapping Class Hierarchy  Mapping API 

configfile.h

Go to the documentation of this file.
00001 /*
00002 Object Oriented Mobile Robot Model (OOMRM) C++  Library Copyright (C) 2002-2005  Derek Jones
00003 
00004 This library is free software; you can redistribute it  and/or
00005 modify it under the terms of the GNU Lesser General Public
00006 License  as published by the Free Software Foundation; either
00007 version 2.1 of the  License, or (at your option) any later version.
00008 
00009 This library is  distributed in the hope that it will be useful,
00010 but WITHOUT ANY WARRANTY;  without even the implied warranty of
00011 MERCHANTABILITY or FITNESS FOR A  PARTICULAR PURPOSE.  See the GNU
00012 Lesser General Public License for more  details.
00013 
00014 You should have received a copy of the GNU Lesser General  Public
00015 License along with this library; if not, write to the Free  Software
00016 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA   02111-1307  USA
00017 
00018 $Id: configfile.h,v 1.4 2007/06/10 22:41:29 derek Exp $ 
00019 */
00020 #ifndef _CONFIGFILE_H
00021 #define _CONFIGFILE_H
00022 #include <fstream>
00023 #include <host/importtype.h>
00024 #include <types.h>
00025 #include <os/os.h>
00026 
00027 
00028 struct Camera_Settings
00029 {
00030   short _horizontal;
00031   short _vertical;
00032   short _shutter;
00033   short _ic;
00034   short _c328_color_type;
00035   short _c328_resolution;
00036   short _c328_picture_type;
00037   short _c328_snapshot_type;
00038   short _c328_snapshot;
00039   char _fn[FILENAME_MAX];
00040 };
00041 
00042 struct Playback
00043 {
00044   bool enable;
00045   PLAYBACK_MODE mode;
00046   char fn[FILENAME_MAX];
00047 };
00048 struct Auto_Load
00049 {
00050   bool dxf;
00051   bool scene;
00052 };
00053 struct grid_lines
00054 {
00055 //  bool hide;
00056   bool major;
00057   bool local;
00058   bool global;
00059 };
00061 
00064 class configfile
00065 {
00066 public:
00067   configfile(void);
00068   ~configfile(void);
00069   static void initialize();
00070   static bool load(void);
00071   static void save(void);
00072   static float frequency(void);
00073   static void frequency(float f);
00074   static float steps(void);
00075   static void steps(float f);
00076   // map divisions
00077   static float map_divisions(void);
00078   static void map_divisions(float f);
00079   // map tile size
00080   static float map_tilesize(void);
00081   static void map_tilesize(float f);
00082   // unit type
00083   static float unit(void);
00084   static void unit(float f);
00085 
00086   // Conversion factor
00087   static float conversion(void);
00088   static void conversion(float f);
00089 
00090   // unit type
00091   static int unit_type(void);
00092   static void unit_type(int f);
00093   // DXF pointer
00094   static ImportType* DXF(void);
00095   static ImportType* scene(void);
00096   // w show
00097   static bool WSHOW(void);
00098   static void WSHOW(bool b);
00099   // R show
00100   static bool RSHOW(void);
00101   static void RSHOW(bool b);
00102   // A show
00103   static bool ASHOW(void);
00104   static void ASHOW(bool b);
00105   // Path Area Show
00106   static bool Path_Area(void);
00107   static void Path_Area(bool b);
00108   // Path Show
00109   static bool Path(void);
00110   static void Path(bool b);
00111 
00112   // Invariant show
00113   static bool Invariant_Show(void);
00114   static void Invariant_Show(bool b);
00115   // Simulant show
00116   static bool Simulant_Show(void);
00117   static void Simulant_Show(bool b);
00118   // Localizer show
00119   static bool Localizer_Show(void);
00120   static void Localizer_Show(bool b);
00121   // OS
00122   static OS_NAME os(void);
00123   static void os(OS_NAME o);
00124 
00125   // Checkpoint Image Enable
00126   static bool Checkpoint_Enable(void);
00127   static void Checkpoint_Enable(bool b);
00128   static grid_lines lines;
00129   static Auto_Load autoload;
00130   static double terrain() { return _Terrain; }
00131   static void terrain(double d) { _Terrain = d; }
00132   static bool rx_on(void);
00133   static void rx_on(bool b);
00134   static void scene_mode(SCENE_MODE);
00135   static const char* const scene_fn(void);
00136   static const char* const image_fn(void);
00137   static void image_fn(const char* const);
00138   static SCENE_MODE scene_mode(void);
00139   static void playback_mode(PLAYBACK_MODE);
00140   static void playback_fn(const char* const);
00141   static const char* const playback_fn();
00142   static PLAYBACK_MODE playback_mode(void);
00143   // Playback enable
00144   static bool playback(void);
00145   static void playback(bool b);
00146   static short horizontal_resolution(void);
00147   static short vertical_resolution(void);
00148   static short shutterspeed(void);
00149   static void horizontal_resolution(short);
00150   static void vertical_resolution(short);
00151   static void shutterspeed(short);
00152   static void color_type(short);
00153   static short color_type(void);
00154   static void c328_resolution(short);
00155   static short c328_resolution(void);
00156   static void c328_picture_type(short);
00157   static short c328_picture_type(void);
00158   static void c328_snapshot_type(short);
00159   static short c328_snapshot_type(void);
00160   // Just a boolean for snapshot (yes/no) vs. image keeps moving as transfer data.
00161   static void c328_snapshot(short);
00162   static short c328_snapshot(void);
00163 
00164 private:
00165   static float _frequency;
00166   static float _steps;
00167   static float _map_divisions;
00168   static float _map_tilesize;
00169   static float _unit;
00170   static float _conversion;
00171   static int   _unit_type;
00172   static bool  _auto_open; // whether to automatically open the file on program start.
00173   static ImportType _dxf; // for autocad open
00174   static ImportType _scene; // for scene file format.
00175   static SCENE_MODE _scene_mode;
00176   static bool _wshow;
00177   static bool _rshow;
00178   static bool _ashow;
00179   static bool _ishow; //invariant show
00180   static bool _sshow; //simulant show
00181   static bool _lshow;
00182   static bool _cshow; // checkpoint enable 
00183   static bool _path_area;
00184   static bool _path;
00185   static Playback _playback;
00186   static double _Terrain;
00187   static char filename[];
00188   static bool _OOMRM_RX_ON;
00189   static OS_NAME _os;
00190   static Camera_Settings _cam_settings;
00191 };
00192 
00194 float Unit_Conversion(float s);
00195 
00196 #endif

Generated on Mon Oct 8 19:32:18 2007 for OOMRM Mapping API by doxygen1.3