00001 /* 00002 ----------------------------------------------------------------------------- 00003 This source file is part of OpenSpace3D 00004 For the latest info, see http://www.openspace3d.com 00005 00006 Copyright (c) 2010 I-maginer 00007 00008 This program is free software; you can redistribute it and/or modify it under 00009 the terms of the GNU Lesser General Public License as published by the Free Software 00010 Foundation; either version 2 of the License, or (at your option) any later 00011 version. 00012 00013 This program is distributed in the hope that it will be useful, but WITHOUT 00014 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00015 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 00016 00017 You should have received a copy of the GNU Lesser General Public License along with 00018 this program; if not, write to the Free Software Foundation, Inc., 59 Temple 00019 Place - Suite 330, Boston, MA 02111-1307, USA, or go to 00020 http://www.gnu.org/copyleft/lesser.txt 00021 00022 You may alternatively use this source under the terms of a specific version of 00023 the OpenSpace3D Unrestricted License provided you have obtained such a license from 00024 I-maginer. 00025 ----------------------------------------------------------------------------- 00026 */ 00027 00028 #ifndef __NONINCOM_H__ 00029 #define __NONINCOM_H__ 00030 00031 #include "plugin.h" 00032 #include "LSerie.h" 00033 #include "ou_thread.h" 00034 #include "NoninStreamParser.h" 00035 00043 class NoninCom : public LSerie, public openutils::Thread 00044 { 00045 public : 00046 00047 enum DisplayType 00048 { 00049 DISPLAY_FULL = 0, 00050 DISPLAY_PARTIAL = 1 00051 }; 00052 00053 enum perfusionFlag 00054 { 00055 RED = 0, 00056 YELLOW = 1, 00057 GREEN = 2 00058 }; 00059 00062 NoninCom(); 00063 00066 ~NoninCom(); 00067 00070 bool connect(); 00071 00074 int parseByte(); 00075 00078 int SendSerialNumberCommand(); 00079 00082 int SetSerialNumber(); 00083 00086 std::string GetSerialNumber(); 00087 00090 int SendOptions(); 00091 00094 int FillConfigurationSector(); 00095 00098 bool dataIsValide(int data); 00099 00102 void disconnect(); 00103 00106 bool safe_connection(); 00107 00108 00111 void run(); 00112 00113 private : 00114 bool state; 00115 bool isRunning; 00116 int timeOut; 00117 std::string serialNumber; 00118 int displayType; 00119 UINT tickData; 00120 NoninStreamParser parser; 00121 00122 bool artifact; 00123 bool oot; 00124 bool snsa; 00125 int perf; 00126 00129 bool IsNoninConnected(int numPort, long speedInBaud); 00130 00133 static void handleDataValueFunc(unsigned char frame,unsigned char plethMSB, unsigned char plethLSB, unsigned char data, void *customData); 00134 00135 protected : 00136 00137 }; 00138 00139 #endif
1.6.3