00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #include "SIO_definitions.h"
00011 #include "SIO_functions.h"
00012
00013 #include "LCD_detector_ID.hh"
00014
00015
00016
00017
00018
00019
00020 LCD_detector_ID::LCD_detector_ID( const char* i_name ) : SIO_block( i_name )
00021 {
00022
00023 type = "<unknown>";
00024 major = -1;
00025 minor = -1;
00026
00027 }
00028
00029
00030
00031
00032
00033
00034 LCD_detector_ID::~LCD_detector_ID() {}
00035
00036
00037
00038
00039
00040
00041 int LCD_detector_ID::getMajor() { return major; }
00042
00043
00044
00045
00046
00047 int LCD_detector_ID::getMinor() { return minor; }
00048
00049
00050
00051
00052
00053 const char* LCD_detector_ID::getType() { return type.c_str(); }
00054
00055
00056
00057
00058
00059
00060 void LCD_detector_ID::setMajor( int i_major ) { major = i_major; return; }
00061
00062
00063
00064
00065
00066
00067 void LCD_detector_ID::setMinor( int i_minor ) { minor = i_minor; return; }
00068
00069
00070
00071
00072
00073 void LCD_detector_ID::setType
00074 (
00075 char* i_type
00076 )
00077 {
00078
00079
00080
00081
00082 if( i_type == NULL )
00083 return;
00084
00085
00086
00087
00088 type = i_type;
00089
00090
00091
00092
00093 return;
00094 }
00095
00096
00097
00098
00099
00100 unsigned int LCD_detector_ID::xfer
00101 (
00102 SIO_stream* stream,
00103 SIO_operation op,
00104 unsigned int version
00105 )
00106 {
00107 if(version) ;
00108 int
00109 nchr;
00110
00111 char
00112 *temp;
00113
00114 unsigned int
00115 status;
00116
00117
00118
00119
00120 if( op == SIO_OP_WRITE )
00121 nchr = type.size();
00122
00123 SIO_DATA( stream, &nchr, 1 );
00124
00125
00126
00127
00128 if( op == SIO_OP_WRITE )
00129 {
00130 SIO_DATA( stream, const_cast<char*>(type.c_str()), nchr );
00131 }
00132
00133 else if( op == SIO_OP_READ )
00134 {
00135 temp = static_cast<char*>(malloc( nchr + 1 ));
00136 SIO_DATA( stream, temp, nchr );
00137 temp[nchr] = '\0';
00138 type = temp;
00139 free( temp );
00140 }
00141
00142
00143
00144
00145 SIO_DATA( stream, &major, 1 );
00146 SIO_DATA( stream, &minor, 1 );
00147
00148
00149
00150
00151 return( SIO_BLOCK_SUCCESS );
00152 }
00153
00154
00155
00156 #define LCD_DETECTOR_ID_MAJOR 1
00157 #define LCD_DETECTOR_ID_MINOR 0
00158
00159
00160
00161
00162 unsigned int LCD_detector_ID::version()
00163 { return( SIO_VERSION_ENCODE( LCD_DETECTOR_ID_MAJOR,
00164 LCD_DETECTOR_ID_MINOR ) ); }