Example #1
0
core::Error readParams(const json::Array& params, T1* pValue1, T2* pValue2)
{
   core::Error error = readParam(params, 0, pValue1) ;
   if (error)
      return error ;

   return readParam(params, 1, pValue2) ;
}
Example #2
0
//------------------------------------------------------------------------------
bool RectCommand::execute()
{
  signed int id, group_id, x, y, width, height, int_value;
  std::string fill, stroke, id_str, stroke_width;
  Coordinates *coord = new Coordinates(0,0);
  
  while(true)
  {
    while(true)
    {
      ui_->getParam("  id? ", false, false, int_value, id_str, false);
      if(!ui_->checkIfIdExists(id_str))
        break;
      error_->idAlreadyExist();
    }
    if(ui_->stringToSignedInt(id_str, id))
      break;
    error_->invalidParameter();
  }
  
  x = readParam("  x? ");
  coord->setX(x);
  
  y = readParam("  y? ");
  coord->setY(y);
  
  coordinates_.push_back(*coord);
  delete coord;
  
  width = readParam("  width? ");
  height = readParam("  height? ");
  ui_->getParam("  fill? ", false, false, int_value, fill, false);
  ui_->getParam("  stroke? ", false, false, int_value, stroke, false);
  ui_->getParam("  stroke-width? ", false, false, int_value, stroke_width,
                false);
  group_id = readParam("  group? ");

  try
  {
    SVGRect *rect = new SVGRect(ui_, db_, svgh_, id, group_id, coordinates_,
                                width, height, fill, stroke, stroke_width);
    db_->setSVGObject(rect);
    coordinates_.clear();
  }
  catch(std::bad_alloc& exception)
  {
    svgh_->setErrors(OUT_OF_MEMORY);
  }
  return true;
}
Example #3
0
 /*
 * Open, read and close a parameter file.
 */
 void System::readParam(const char* filename)
 {
    std::ifstream in;
    in.open(filename);
    readParam(in);
    in.close();
 }
Example #4
0
//************************************************************************
// read the number of voxels in each subdivision's side of a target object
int Param::readBoxSizeModel( const char* filename ){
  int val;
  if( readParam( filename, "box_size(model):", val ) ){
    if( val < 1 ){
      std::cerr << "ERR (in Param::readBoxSizeModel): box_size must be larger than 0." << std::endl;
      return -1;
    }
    return val;
  }
  std::cerr << "ERR (in Param::readBoxSizeModel): fail" << std::endl;
  return -1;
}
Example #5
0
//*************************************************
// read the dimension of compressed feature vectors
int Param::readDim( const char* filename ){
  int val;
  if( readParam( filename, "dim:", val ) ){
    if( val < 1 ){
      std::cerr << "ERR (in Param::readDim): dim must be larger than 0." << std::endl;
      return -1;
    }
    return val;
  }
  std::cerr << "ERR (in Param::readDim): fail" << std::endl;
  return -1;
}
Example #6
0
//******************************
// read the length of voxel side
float Param::readVoxelSize( const char* filename ){
  float val;
  if( readParam( filename, "voxel_size:", val ) ){
    if( val <= 0 ){
      std::cerr << "ERR (in Param::readVoxelSize): voxel_size must be larger than 0." << std::endl;
      return -1;
    }
    return val;
  }
  std::cerr << "ERR (in Param::readVoxelSize): fail" << std::endl;
  return -1;
}
Example #7
0
//***********************************************************
// read the number for synthetic rotation in learning objects
int Param::readRotateNum( const char* filename ){
  int val;
  if( readParam( filename, "rotate_num:", val ) ){
    if( val < 1 ){
      std::cerr << "ERR (in Param::readRotateNum): rotate_num must be larger than 0." << std::endl;
      return -1;
    }
    return val;
  }
  std::cerr << "ERR (in Param::readRotateNum): fail" << std::endl;
  return -1;
}
Example #8
0
core::Error readParams(const json::Array& params, 
                       T1* pValue1, 
                       T2* pValue2, 
                       T3* pValue3,
                       T4* pValue4)
{
   core::Error error = readParams(params, pValue1, pValue2, pValue3) ;
   if (error)
      return error ;
   
   return readParam(params, 3, pValue4) ;
}
Example #9
0
core::Error readParams(const json::Array& params,
                       T1* pValue1,
                       T2* pValue2,
                       T3* pValue3,
                       T4* pValue4,
                       T5* pValue5,
                       T6* pValue6)
{
   core::Error error = readParams(params,
                                  pValue1,
                                  pValue2,
                                  pValue3, 
                                  pValue4,
                                  pValue5) ;
   if (error)
      return error ;
   
   return readParam(params, 5, pValue6) ;
}   
Example #10
0
//*************************************************************
void MINDsetup::init(bhep::gstore pstore, bhep::prlevel level) {
//*************************************************************
    
  _msetup=bhep::messenger(level);
  
  _msetup.message("++MINDsetup Messenger generated++",bhep::VERBOSE);
  
  _pstore=pstore;
  
  readParam();

  //--------------- generate recpack setup -----------//
    
  _gsetup.set_name("main");
  
  // create volumes and surfaces
  
  createGeom();
  
  // define detector resolutions

  setResolution();
  
  // add properties to volumes and surfaces
  
  addProperties();

  // std::cout << _gsetup.volume("Detector").parameter("BField") << std::endl;
  // dict::mixdictionary smell = _gsetup.volume_properties("IRON_plane0");
  
  // const double XX = _gsetup.volume_properties("IRON_plane0").retrieve(thing_name);
  // std::cout << _gsetup.volume_properties("IRON_plane0").retrieve(thing_name) << std::endl;
  
  //     std::cout << _gsetup << std::endl;
  
  _msetup.message("++ Setup has been generated !! ++",bhep::VERBOSE);
  
  //_msetup.message("MIND Setup:", _gsetup,bhep::VERBOSE);
}
Example #11
0
//*********************************
// read flag for c3_hlac extraction
int Param::readC3HLACFlag( const char* filename ){
  int val;
  if( readParam( filename, "c3_hlac_flg:", val ) ) return val;
  std::cerr << "ERR (in Param::readC3HLACFlag): fail" << std::endl;
  return -1;
}
Example #12
0
void runExternalCommandsPersistent(EthernetServer* _server, systemState* _state) 
{
	// local variables
	int i, buffer_ptr;
	int room, radiatorState, automaticMode;
	float temperature;
	int commandError = 0;
	
	
	EthernetClient client = _server->available(); // is non-blocking
	if(client.available() > 2)
	{
		#ifdef DEBUG
		Serial.println("Connection established");
		Serial.print("Available: ");
		Serial.println(client.available());
		#endif
		
		char buffer[32];
		
		// read command field
		if( readParam(buffer, 3, client) < 0 ) {commandError = 1; goto errorHandler;}
		
		// switch case on commands
		if(strcmp(buffer, "STM") == 0) // set temperature
		{
			#ifdef DEBUG
			Serial.println("Set temperature command received");
			#endif
			
			// read fisrt param: room number (one digit)
			if( readParam(buffer, 1, client) < 0 ) {commandError = 1; goto errorHandler;}
			room = atoi(buffer);
			
			// read second param: temperature (format xx.y)
			if( readParam(buffer, 4, client) < 0 ) {commandError = 1; goto errorHandler;}
			temperature = atof(buffer);
			
			_state->desiredTemp[room] = temperature;
			
			client.write((unsigned char*)"STM", 3);
			client.write((unsigned char*)"OOK", 3);
		}
		else if(strcmp(buffer, "RTM") == 0) // read temperature
		{
			#ifdef DEBUG
			Serial.println("Read temperature command received");
			#endif
			// read fisrt param: room number (one digit)
			if( readParam(buffer, 1, client) < 0 ) {commandError = 1; goto errorHandler;}
			
			room = atoi(buffer);
			
			temperature = _state->actualTemp[room];
			//buffer_ptr = sprintf(buffer, "%4.1f", temperature);
			ttoa(buffer, temperature);
			
			client.write((unsigned char*)"RTM", 3);
			client.write((unsigned char*)"OOK", 3);
			client.write((unsigned char*)buffer, 4);
		}
		else if(strcmp(buffer, "SRD") == 0) // set radiator
		{
			#ifdef DEBUG
			Serial.println("Set radiator command received");
			#endif
			// read fisrt param: room number (one digit)
			if( readParam(buffer, 1, client) < 0 ) {commandError = 1; goto errorHandler;}
			room = atoi(buffer);
			
			// read second param: radiator state (one digit)
			if( readParam(buffer, 1, client) < 0 ) {commandError = 1; goto errorHandler;}
			radiatorState = atoi(buffer);
			
			_state->radiatorState[room] = radiatorState;
			digitalWrite(radiatorPinByRoom(room), (radiatorState == 1) ? LOW : HIGH);
			
			// set zone valve
			int someoneIsOn = 0;
			for(room = 0; room < 6; room++) 
			{
				if(_state->radiatorState[room] == ON) someoneIsOn = 1;
			}
			digitalWrite(ZONE_VALVE_NO1, someoneIsOn ? LOW : HIGH);
			
			client.write((unsigned char*)"SRD", 3);
			client.write((unsigned char*)"OOK", 3);
		}
		else if(strcmp(buffer, "RRD") == 0) // read radiator
		{
			#ifdef DEBUG
			Serial.println("Read radiator command received");
			#endif
			// read fisrt param: room number (one digit)
			if( readParam(buffer, 1, client) < 0 ) {commandError = 1; goto errorHandler;}
			room = atoi(buffer);

			radiatorState = _state->radiatorState[room];
			sprintf(buffer, "%d", radiatorState);
			
			client.write((unsigned char*)"RRD", 3);
			client.write((unsigned char*)"OOK", 3);
			client.write((unsigned char*)buffer, 1);
		}
		else if(strcmp(buffer, "SAM") == 0) // set automatic mode
		{
			#ifdef DEBUG
			Serial.println("Set automatic mode command received");
			#endif
			// read second param: radiator state (one digit)
			if( readParam(buffer, 1, client) < 0 ) {commandError = 1; goto errorHandler;}
			automaticMode = atoi(buffer);
			
			_state->automaticMode = automaticMode;
			
			client.write((unsigned char*)"SAM", 3);
			client.write((unsigned char*)"OOK", 3);
		}
		else if(strcmp(buffer, "RAM") == 0) // read automatic mode
		{
			#ifdef DEBUG
			Serial.println("Read automatic mode command received");
			#endif
			automaticMode = _state->automaticMode;
			
			sprintf(buffer, "%d", automaticMode);
			
			client.write((unsigned char*)"RAM", 3);
			client.write((unsigned char*)"OOK", 3);
			client.write((unsigned char*)buffer, 1);
		}
		else if(strcmp(buffer, "RDT") == 0) // read desired temperature
		{
			#ifdef DEBUG
			Serial.println("Read desired temperature command received");
			#endif
			// read fisrt param: room number (one digit)
			if( readParam(buffer, 1, client) < 0 ) {commandError = 1; goto errorHandler;}
			room = atoi(buffer);
			
			temperature = _state->desiredTemp[room];
			//buffer_ptr = sprintf(buffer, "%4.1f", temperature);
			ttoa(buffer, temperature);
			
			client.write((unsigned char*)"RDT", 3);
			client.write((unsigned char*)"OOK", 3);
			client.write((unsigned char*)buffer, 4);
		}
		else if(strcmp(buffer, "CLS") == 0) // Close connection
		{
			#ifdef DEBUG
			Serial.println("Close connection command received");
			#endif
			
			client.write((unsigned char*)"CLS", 3);
			client.write((unsigned char*)"OOK", 3);
			
			client.flush(); // NEW to verify ---> it seems not working
			delay(2000);
			while(client.connected())
			{
				client.stop();
				delay(2000);
			}
		}
		else
		{
			#ifdef DEBUG
			Serial.print("Invalid command received: ");
			Serial.print(buffer[0]);
			Serial.print(buffer[1]);
			Serial.print(buffer[2]);
			Serial.println();
			#endif
			client.write((unsigned char*)"ERR", 3);
			client.write((unsigned char*)"INV", 3);
		}
		
		// =============================================
		errorHandler:
		if(commandError)
		{
			
			#ifdef DEBUG
			Serial.print("Invalid command received: ");
			Serial.print(buffer[0]);
			Serial.print(buffer[1]);
			Serial.print(buffer[2]);
			Serial.println();
			#endif
			client.write((unsigned char*)"ERR", 3);
			client.write((unsigned char*)"GEN", 3);
		}
		// =============================================
	}
	
}
Example #13
0
bool  TiffEncoder::writeLibTiff( const Mat& img, const vector<int>& params)
{
    int channels = img.channels();
    int width = img.cols, height = img.rows;
    int depth = img.depth();

    int bitsPerChannel = -1;
    switch (depth)
    {
        case CV_8U:
        {
            bitsPerChannel = 8;
            break;
        }
        case CV_16U:
        {
            bitsPerChannel = 16;
            break;
        }
        default:
        {
            return false;
        }
    }

    const int bitsPerByte = 8;
    size_t fileStep = (width * channels * bitsPerChannel) / bitsPerByte;

    int rowsPerStrip = (int)((1 << 13)/fileStep);
    readParam(params, TIFFTAG_ROWSPERSTRIP, rowsPerStrip);

    if( rowsPerStrip < 1 )
        rowsPerStrip = 1;

    if( rowsPerStrip > height )
        rowsPerStrip = height;


    // do NOT put "wb" as the mode, because the b means "big endian" mode, not "binary" mode.
    // http://www.remotesensing.org/libtiff/man/TIFFOpen.3tiff.html
    TIFF* pTiffHandle = TIFFOpen(m_filename.c_str(), "w");
    if (!pTiffHandle)
    {
        return false;
    }

    // defaults for now, maybe base them on params in the future
    int   compression  = COMPRESSION_LZW;
    int   predictor    = PREDICTOR_HORIZONTAL;

    readParam(params, TIFFTAG_COMPRESSION, compression);
    readParam(params, TIFFTAG_PREDICTOR, predictor);

    int   colorspace = channels > 1 ? PHOTOMETRIC_RGB : PHOTOMETRIC_MINISBLACK;

    if ( !TIFFSetField(pTiffHandle, TIFFTAG_IMAGEWIDTH, width)
      || !TIFFSetField(pTiffHandle, TIFFTAG_IMAGELENGTH, height)
      || !TIFFSetField(pTiffHandle, TIFFTAG_BITSPERSAMPLE, bitsPerChannel)
      || !TIFFSetField(pTiffHandle, TIFFTAG_COMPRESSION, compression)
      || !TIFFSetField(pTiffHandle, TIFFTAG_PHOTOMETRIC, colorspace)
      || !TIFFSetField(pTiffHandle, TIFFTAG_SAMPLESPERPIXEL, channels)
      || !TIFFSetField(pTiffHandle, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG)
      || !TIFFSetField(pTiffHandle, TIFFTAG_ROWSPERSTRIP, rowsPerStrip)
      || !TIFFSetField(pTiffHandle, TIFFTAG_PREDICTOR, predictor)
       )
    {
        TIFFClose(pTiffHandle);
        return false;
    }

    // row buffer, because TIFFWriteScanline modifies the original data!
    size_t scanlineSize = TIFFScanlineSize(pTiffHandle);
    AutoBuffer<uchar> _buffer(scanlineSize+32);
    uchar* buffer = _buffer;
    if (!buffer)
    {
        TIFFClose(pTiffHandle);
        return false;
    }

    for (int y = 0; y < height; ++y)
    {
        switch(channels)
        {
            case 1:
            {
                memcpy(buffer, img.data + img.step * y, scanlineSize);
                break;
            }

            case 3:
            {
                if (depth == CV_8U)
                    icvCvt_BGR2RGB_8u_C3R( img.data + img.step*y, 0, buffer, 0, cvSize(width,1) );
                else
                    icvCvt_BGR2RGB_16u_C3R( (const ushort*)(img.data + img.step*y), 0, (ushort*)buffer, 0, cvSize(width,1) );
                break;
            }

            case 4:
            {
                if (depth == CV_8U)
                    icvCvt_BGRA2RGBA_8u_C4R( img.data + img.step*y, 0, buffer, 0, cvSize(width,1) );
                else
                    icvCvt_BGRA2RGBA_16u_C4R( (const ushort*)(img.data + img.step*y), 0, (ushort*)buffer, 0, cvSize(width,1) );
                break;
            }

            default:
            {
                TIFFClose(pTiffHandle);
                return false;
            }
        }

        int writeResult = TIFFWriteScanline(pTiffHandle, buffer, y, 0);
        if (writeResult != 1)
        {
            TIFFClose(pTiffHandle);
            return false;
        }
    }

    TIFFClose(pTiffHandle);
    return true;
}
 /*
 * Read default parameter file.
 */
 void McSimulation::readParam()
 {  readParam(fileMaster().paramFile()); }
Example #15
0
/*
 * Parse the given binary file and fill the simulator data classes accordingly
 */
int parseInput(Memory& memory, bool DEBUG){
    char byte;
    uint32_t index = 0;
    int ret = 0;
    char header[4] = {0};
    std::ifstream infile("input", std::ios::binary);
    uint16_t code_sz = 0;
    uint16_t cdata = 0;
    uint16_t cdata_sz = 0;
    uint16_t smc = 0;
    uint16_t data = 0;
    uint16_t data_sz = 0;
    uint16_t mem = 0;
    uint16_t dbg_sz = 0;


    // reading the filetype=header string
    while (index < 4){
        if (infile.get(byte)){
            header[index] = byte;
            index++;
        }
        else{
            break;
        }
    }
    if ((header[0] != 'T') || (header[1] != 'o') || (header[2] != 'y') || (header[3] != '1') || (index != 4)){
        std::cout << "Wrong input file format =" << header << std::endl;
        infile.close();
        return 1;
    }

    // read 8 control fields 2 bytes each
    ret += readParam(infile, code_sz);
    ret += readParam(infile, cdata);
    ret += readParam(infile, cdata_sz);
    ret += readParam(infile, smc);
    ret += readParam(infile, data);
    ret += readParam(infile, data_sz);
    ret += readParam(infile, mem);
    ret += readParam(infile, dbg_sz);
    if (ret != 0){
        infile.close();
        std::cout << "Control section cannot be read" << std::endl;
        return 1;
    }

    // look what we've read so far
    if (DEBUG){
        std::cout << " header   = "   << header << std::endl
                  << " code_sz  = "   << std::dec << code_sz  << std::endl
                  << " cdata    = 0x" << std::hex << cdata    << std::endl
                  << " cdata_sz = "   << std::dec << cdata_sz << std::endl
                  << " smc      = 0x" << std::hex << smc      << std::endl
                  << " data     = 0x" << std::hex << data     << std::endl
                  << " data_sz  = "   << std::dec << data_sz  << std::endl
                  << " mem      = 0x" << std::hex << mem      << std::endl
                  << " dbg_sz   = "   << std::dec << dbg_sz   << std::endl;
    }

    // sanity and parameters pre-requirements check

    // non-zero code section, shall 4-bytes aligned
    if (code_sz == 0){
        std::cout << "code_sz cannot be zero" << std::endl;
        infile.close();
        return 1;
    }
    if (code_sz % 4){
        std::cout << "code_sz shall be 4-bytes aligned" << std::endl;
        infile.close();
        return 1;
    }

    // couple of extra flags, showing that the section shall be created (non-zero)
    bool cdata_nz = cdata != 0;
    bool smc_nz = smc != 0;
    bool data_nz = data != 0;
    bool mem_nz = mem != 0;

    // sanity check
    if (!cdata_nz && cdata_sz != 0){
        std::cout << "cdata_sz cannot be non-zero for cdata = 0" << std::endl;
        infile.close();
        return 1;
    }
    if (!data_nz && data_sz != 0){
        std::cout << "data_sz cannot be non-zero for data = 0" << std::endl;
        infile.close();
        return 1;
    }

    // check for monotonous section address raise
    if (smc_nz){
        if (smc <= cdata){
            std::cout << "smc must be > cdata" << std::endl;
            infile.close();
            return 1;
        }
    }
    if (data_nz){
        if (data <= smc){
            std::cout << "data must be > smc" << std::endl;
            infile.close();
            return 1;
        }
        if (data <= cdata){
            std::cout << "data must be > cdata" << std::endl;
            infile.close();
            return 1;
        }
    }
    if (mem_nz){
        if (mem <= data){
            std::cout << "mem must be > data" << std::endl;
            infile.close();
            return 1;
        }
        if (mem <= smc){
            std::cout << "mem must be > smc" << std::endl;
            infile.close();
            return 1;
        }
        if (mem <= cdata){
            std::cout << "mem must be > cdata" << std::endl;
            infile.close();
            return 1;
        }
    }

    // check section sizes and their representaions in the file
    uint16_t section_data_size = 0;
    uint16_t section_code_size = 0;
    uint16_t section_cdata_size = 0;
    
    section_data_size = mem_nz ? mem - data : 0xf000 - data;
    section_cdata_size = smc_nz ? smc - cdata : data_nz ? data - cdata : mem_nz ? mem - cdata : 0xf000 - cdata;
    section_code_size = cdata_nz ? cdata - 4 : smc_nz ? smc - 4 : data_nz ? data - 4 : mem_nz ? mem - 4 : 0xeffc;

    if (section_data_size < data_sz){
        std::cout << "data_sz is more than the actual section size = " << section_data_size << std::endl;
        infile.close();
        return 1;
    }

    if (section_code_size < code_sz){
        std::cout << "code_sz is more than the actual code size = " << section_code_size << std::endl;
        infile.close();
        return 1;
    }

    if (section_cdata_size < cdata_sz){
        std::cout << "cdata_sz is more than the actual section size = " << section_cdata_size << std::endl;
        infile.close();
        return 1;
    }



    // as we've got to this point, everyting shall be correct
    // create described memory regions and add them to the memory map
    ret = 0;
    uint16_t border_hi = 0xffff;
    MemoryRange* range;

    // I/O section
    range = new MemoryRange(0xf000, border_hi, 8, "i/o");
    ret += memory.registerMemoryRange(range);
    border_hi = 0xefff;

    // heap section
    if (mem_nz){
        range = new MemoryRange(mem, 0xefff, 6, "heap");
        ret += memory.registerMemoryRange(range);
        border_hi = mem - 1;
    }

    // data section
    if (data_nz){
        range = new MemoryRange(data, border_hi, 6, "data");
        ret += memory.registerMemoryRange(range);
        border_hi = data - 1;
    }

    // aux code section
    if (smc_nz){
        range = new MemoryRange(smc, border_hi, 7, "smc");
        ret += memory.registerMemoryRange(range);
        border_hi = smc - 1;
    }

    // constant data section
    if (cdata_nz){
        range = new MemoryRange(cdata, border_hi, 4, "cdata");
        ret += memory.registerMemoryRange(range);
        border_hi = cdata - 1;
    }

    // code section
    range = new MemoryRange(4, border_hi, 5, "code");
    ret += memory.registerMemoryRange(range);
    border_hi = 3;

    // reserved first segment
    range = new MemoryRange(0, border_hi, 0, "reserved");
    ret += memory.registerMemoryRange(range);

    if (ret){
        std::cout << "There were errors while registering memory regions" << std::endl;
        infile.close();
        return 1;
    }


    // fill the memory with pre-defined data from the file
    ret = 0;

    // code section
    ret = loadMemoryRange(infile, memory, "code", code_sz);
    if (ret){
        if (ret == 2) std::cout << "Insufficient data in the file, code section" << std::endl;
        else          std::cout << "Cannot locate previously registered memory range 'code'" << std::endl;
        infile.close();
        return 1;
    }
    // cdata section
    if (cdata_nz)
        ret = loadMemoryRange(infile, memory, "cdata", cdata_sz);
    else
        ret = 0;
    if (ret){
        if (ret == 2) std::cout << "Insufficient data in the file, cdata section" << std::endl;
        else          std::cout << "Cannot locate previously registered memory range 'cdata'" << std::endl;
        infile.close();
        return 1;
    }
    // data section
    if (data_nz)
        ret = loadMemoryRange(infile, memory, "data", data_sz);
    else
        ret = 0;
    if (ret){
        if (ret == 2) std::cout << "Insufficient data in the file, data section" << std::endl;
        else          std::cout << "Cannot locate previously registered memory range 'data'" << std::endl;
        infile.close();
        return 1;
    }
    // dbg section
    index = 0;
    while (index < dbg_sz){
        if (infile.get(byte)) index++;
        else                  break;
    }
    if (dbg_sz != index){
        std::cout << "Insufficient data in the file, dbg section" << std::endl;
        infile.close();
        return 1;
    }

    if (infile.get(byte)){
        std::cout << "Excessive data in the file" << std::endl;
        infile.close();
        return 1;
    }

    infile.close();
    return 0;    
}
Example #16
0
core::Error readParams(const json::Array& params, T1* pValue1)
{
   return readParam(params, 0, pValue1) ;
}