Ejemplo n.º 1
0
//------------------------------------------------------------------------------
// serialize
//------------------------------------------------------------------------------
std::ostream& IoDevice::serialize(std::ostream& sout, const int i, const bool slotsOnly) const
{
   int j = 0;
   if ( !slotsOnly ) {
      sout << "( " << getFormName() << std::endl;
      j = 4;
   }

   if (adapters != 0) {
      indent(sout,i+j);
      sout << "adapters: ";
      adapters->serialize(sout,(i+j+4));
   }

   if (devices != 0) {
      indent(sout,i+j);
      sout << "devices: ";
      devices->serialize(sout,(i+j+4));
   }

   BaseClass::serialize(sout,i+j,true);

   if ( !slotsOnly ) {
      indent(sout,i);
      sout << ")" << std::endl;
   }

   return sout;
}
Ejemplo n.º 2
0
//------------------------------------------------------------------------------
// serialize
//------------------------------------------------------------------------------
std::ostream& System::serialize(std::ostream& sout, const int i, const bool slotsOnly) const
{
   int j = 0;
   if ( !slotsOnly ) {
      sout << "( " << getFormName() << std::endl;
      j = 4;
   }

   // Power switch (if greater than PWR_LAST then our derived class should handle this)
   if (getPowerSwitch() < PWR_LAST) {
      indent(sout,i+j);
      sout << "powerSwitch: " ;
      switch (getPowerSwitch()) {
         case PWR_OFF : sout << "OFF"; break;
         case PWR_STBY : sout << "STBY"; break;
         case PWR_ON : sout << "ON"; break;
      }
      sout << std::endl;
   }

   BaseClass::serialize(sout,i+j,true);

   if ( !slotsOnly ) {
      indent(sout,i);
      sout << ")" << std::endl;
   }

   return sout;
}
Ejemplo n.º 3
0
//------------------------------------------------------------------------------
// serialize
//------------------------------------------------------------------------------
std::ostream& ScanGimbal::serialize(std::ostream& sout, const int i, const bool slotsOnly) const
{
    int j = 0;
    if ( !slotsOnly ) {
        indent(sout,i);
        sout << "( " << getFormName() << std::endl;
        j = 4;
    }


    // searchVolume:  Scan width & height
    indent(sout,i+j);
    sout << "searchVolume: [ ";
    sout << scanWidth << " " << scanHeight;
    sout << " ]" << std::endl;

    // reference:  Reference angles (center of seach volume)
    indent(sout,i+j);
    sout << "reference: [ ";
    sout << getRefAzimuth() << " " << getRefElevation();
    sout << " ]" << std::endl;


    BaseClass::serialize(sout,i+j,true);

    if ( !slotsOnly ) {
        indent(sout,i);
        sout << ")" << std::endl;
    }

    return sout;
}
Ejemplo n.º 4
0
//------------------------------------------------------------------------------
// serialize
//------------------------------------------------------------------------------
std::ostream& NetIO::serialize(std::ostream& sout, const int i, const bool slotsOnly) const
{
    int j = 0;
    if ( !slotsOnly ) {
        indent(sout,i);
        sout << "( " << getFormName() << std::endl;
        j = 4;
    }

    //if (multicastGroup != 0) {
    //    indent(sout,i+j);
    //    sout << "multicastGroup: \"";
    //    sout << multicastGroup;
    //    sout << "\"" << std::endl;
    //}

    BaseClass::serialize(sout,i+j,true);

    if ( !slotsOnly ) {
        indent(sout,i);
        sout << ")" << std::endl;
    }

    return sout;
}
Ejemplo n.º 5
0
// serializer
std::ostream& Navigation::serialize(std::ostream& sout, const int i, const bool slotsOnly) const
{
    int j = 0;
    if ( !slotsOnly ) {
        indent(sout,i);
        sout << "( " << getFormName() << std::endl;
        j = 4;
    }

    // primary route
    if (priRoute != 0) {
        indent(sout,i+j);
        sout << "route: " << std::endl;
        priRoute->serialize(sout,(i+j),slotsOnly);
    }

    //BaseClass::serialize(sout,i+j,true);

    if ( !slotsOnly ) {
    	indent(sout,i);
    	sout << ")" << std::endl;
    }

    return sout;    
}
Ejemplo n.º 6
0
//------------------------------------------------------------------------------
// serialize() -- print the value of this object to the output stream sout.
//------------------------------------------------------------------------------
std::ostream& Density::serialize(std::ostream& sout, const int i, const bool slotsOnly) const
{
    int j = 0;
    if (!slotsOnly) {
        sout << "( " << getFormName() << std::endl;
        // tab here
        j = 4;
    }
    
    indent(sout, i+j);
    sout << "value: " << val << std::endl;
    
    if (myMass != 0) {
        indent(sout, i+j);
        sout << "mass: " << *myMass << std::endl;
    }
    if (myVolume != 0) {
        indent(sout, i+j);
        sout << "volume: " << *myVolume << std::endl;
    }
    
    if (!slotsOnly) {
        indent(sout,i);
        sout << ")" << std::endl;
    }
            
    return sout;
}
Ejemplo n.º 7
0
//------------------------------------------------------------------------------
// serialize() -- 
//------------------------------------------------------------------------------
std::ostream& Terrain::serialize(std::ostream& sout, const int i, const bool slotsOnly) const
{
    int j = 0;
    if ( !slotsOnly ) {
    	indent(sout,i);
      sout << "( " << getFormName() << std::endl;
      j = 4;
    }

    if (path != 0) {
      indent(sout,i+j);
      sout << "path:  " << path << std::endl;
    }

    if (file != 0) {
      indent(sout,i+j);
      sout << "file:  " << file << std::endl;
    }

    if ( !slotsOnly ) {
    	indent(sout,i);
    	sout << ")" << std::endl;
    }

    return sout;
}
Ejemplo n.º 8
0
//------------------------------------------------------------------------------
// serialize() -- print the value of this object to the output stream sout.
//------------------------------------------------------------------------------
std::ostream& Polynomial::serialize(std::ostream& sout, const int i, const bool slotsOnly) const
{
   int j = 0;
   if (!slotsOnly) {
      sout << "( " << getFormName() << std::endl;
      j = 4;
   }

   int mm = getDegree() + 1;
   if (mm > 0) {
      const double* aa = getCoefficients();
      indent(sout,i+j);
      sout << "coefficients: [ ";
      for (int i = 0; i < mm; i++) {
         std::cout << aa[i] << " ";
      }
      sout << " ]" << std::endl;
   }

   BaseClass::serialize(sout, i + j, true);

   if (!slotsOnly) {
      indent(sout, i);
      sout << ")" << std::endl;
   }

   return sout;
}
Ejemplo n.º 9
0
//------------------------------------------------------------------------------
// serialize
//------------------------------------------------------------------------------
std::ostream& RfSensor::serialize(std::ostream& sout, const int i, const bool slotsOnly) const
{
    int j = 0;
    if ( !slotsOnly ) {
        indent(sout,i);
        sout << "( " << getFormName() << std::endl;
        j = 4;
    }

    BaseClass::serialize(sout,i+j,true);

    if ( !slotsOnly ) {
        indent(sout,i);
        sout << ")" << std::endl;
    }

    return sout;
}
Ejemplo n.º 10
0
//------------------------------------------------------------------------------
// serialize
//------------------------------------------------------------------------------
std::ostream& Page::serialize(std::ostream& sout, const int i, const bool slotsOnly) const
{
    int j = 0;
    if ( !slotsOnly ) {
        //indent(sout,i);
        sout << "( " << getFormName() << std::endl;
        j = 4;
    }

    if (cpName.len() > 0) {
        indent(sout,i+j);
        sout << "page: " << cpName << std::endl;
    }

    BaseClass::serialize(sout,i+j,true);

    if (subpages != 0) {
        indent(sout,i+j);
        sout << "pages: {" << std::endl;
        subpages->serialize(sout,i+j+4,slotsOnly);
        indent(sout,i+j);
        sout << "}" << std::endl;
    }

    if (pageChgEvents != 0) {
        indent(sout,i+j);
        sout << "pagingEvent: {" << std::endl;
        pageChgEvents->serialize(sout,i+j+4,slotsOnly);
        indent(sout,i+j);
        sout << "}" << std::endl;
    }

    if (postDraw1) {
        indent(sout,i+j);
        sout << "subpagesFirst: 1" << std::endl;
    }

    if ( !slotsOnly ) {
        indent(sout,i);
        sout << ")" << std::endl;
    }

    return sout;
}
Ejemplo n.º 11
0
//------------------------------------------------------------------------------
// serialize
//------------------------------------------------------------------------------
std::ostream& Missile::serialize(std::ostream& sout, const int i, const bool slotsOnly) const
{
   int j = 0;
   if ( !slotsOnly ) {
      indent(sout,i);
      sout << "( " << getFormName() << std::endl;
      j = 4;
   }


   indent(sout,i+j);
   sout << "minSpeed: " << vpMin << std::endl;

   indent(sout,i+j);
   sout << "maxSpeed: " << vpMax << std::endl;

   indent(sout,i+j);
   sout << "speedMaxG: " << vpMaxG << std::endl;

   indent(sout,i+j);
   sout << "maxg: " << maxG << std::endl;

   indent(sout,i+j);
   sout << "maxAccel: " << maxAccel << std::endl;

   indent(sout,i+j);
   sout << "cmdPitch: " << cmdPitch << std::endl;

   indent(sout,i+j);
   sout << "cmdHeading: " << cmdHeading << std::endl;

   indent(sout,i+j);
   sout << "cmdSpeed: " << cmdVelocity << std::endl;

   BaseClass::serialize(sout,i+j,true);

   if ( !slotsOnly ) {
      indent(sout,i);
      sout << ")" << std::endl;
   }

   return sout;
}
Ejemplo n.º 12
0
//------------------------------------------------------------------------------
// serialize() -- print functions
//------------------------------------------------------------------------------
std::ostream& AsciiText::serialize(std::ostream& sout, const int i, const bool slotsOnly) const
{
    int j = 0;
    if ( !slotsOnly ) {
        sout << "( " << getFormName() << std::endl;
        j = 4;
    }

    indent(sout,i+j);
    sout << "text: " << origStr << std::endl;

    BaseClass::serialize(sout,i+j,true);

    if ( !slotsOnly ) {
        indent(sout,i);
        sout << ")" << std::endl;
    }
    return sout;
}
Ejemplo n.º 13
0
//------------------------------------------------------------------------------
// serialize
//------------------------------------------------------------------------------
std::ostream& BitmapFont::serialize(std::ostream& sout, const int i, const bool slotsOnly) const
{
    unsigned int j = 0;
    if ( !slotsOnly ) {
        sout << "( " << getFormName() << std::endl;
        j = 4;
    }

    indent(sout,i+j);
    sout << "reverse: " << reverse << std::endl;

    BaseClass::serialize(sout,i+j,true);

    if ( !slotsOnly ) {
        indent(sout,i);
        sout << ")" << std::endl;
    }

    return sout;
}
Ejemplo n.º 14
0
//------------------------------------------------------------------------------
// serialize
//------------------------------------------------------------------------------
std::ostream& AnalogInput::serialize(std::ostream& sout, const int i, const bool slotsOnly) const
{
   int j = 0;
   if ( !slotsOnly ) {
      sout << "( " << getFormName() << std::endl;
      j = 4;
   }

   indent(sout,i+j);
   sout << "ai: " << getLocation() << std::endl;

   indent(sout,i+j);
   sout << "channel: " << getChannel() << std::endl;

   indent(sout,i+j);
   sout << "value: " << getValue() << std::endl;

   indent(sout,i+j);
   sout << "deadband: " << getDeadband() << std::endl;

   indent(sout,i+j);
   sout << "offset: " << getOffset() << std::endl;

   indent(sout,i+j);
   sout << "gain: " << getGain() << std::endl;

   if (table != 0) {
      indent(sout,i+j);
      sout << "table: ";
      table->serialize(sout,(i+j+4));
   }

   BaseClass::serialize(sout,i+j,true);

   if ( !slotsOnly ) {
      indent(sout,i);
      sout << ")" << std::endl;
   }

   return sout;
}
Ejemplo n.º 15
0
//------------------------------------------------------------------------------
// serialize
//------------------------------------------------------------------------------
std::ostream& Antenna::serialize(std::ostream& sout, const int i, const bool slotsOnly) const
{
    int j = 0;
    if ( !slotsOnly ) {
      indent(sout,i);
      sout << "( " << getFormName() << std::endl;
      j = 4;
    }

    // Gain pattern
    if (gainPattern != 0) {
        indent(sout,i+j);
        sout << "gainPattern: " ;
        gainPattern->serialize(sout,(i+j+4));
    }

    // polarization: Antenna Polarization  { none, vertical, horizontal, slant, RHC, LHC }
    indent(sout,i+j);
    if (polar == NONE) sout << "none";
    else if (polar == VERTICAL) sout << "vertical";
    else if (polar == HORIZONTAL) sout << "horizontal";
    else if (polar == SLANT) sout << "slant";
    else if (polar == RHC) sout << "RHC";
    else if (polar == LHC) sout << "LHC";
    sout << std::endl;

    indent(sout,i+j);
   sout << "recycle: " << (isEmissionRecycleEnabled() ? "true" : "false") << std::endl;

    BaseClass::serialize(sout,i+j,true);

    if ( !slotsOnly ) {
    	indent(sout,i);
    	sout << ")" << std::endl;
    }

    return sout;
}
Ejemplo n.º 16
0
//------------------------------------------------------------------------------
// serialize() -- print the value of this object to the output stream sout.
//------------------------------------------------------------------------------
std::ostream& Function::serialize(std::ostream& sout, const int i, const bool slotsOnly) const
{
   int j = 0;
   if (!slotsOnly) {
      sout << "( " << getFormName() << std::endl;
      j = 4;
   }

   if (table != 0) {
      indent(sout, i + j);
      sout << "table: ";
      table->serialize(sout,(i+j+4));
   }

   BaseClass::serialize(sout, i + j, true);

   if (!slotsOnly) {
      indent(sout, i);
      sout << ")" << std::endl;
   }

   return sout;
}
Ejemplo n.º 17
0
//------------------------------------------------------------------------------
// serialize
//------------------------------------------------------------------------------
std::ostream& NetHandler::serialize(std::ostream& sout, const int i, const bool slotsOnly) const
{
    int j = 0;
    if ( !slotsOnly ) {
        indent(sout,i);
        sout << "( " << getFormName() << std::endl;
        j = 4;
    }

    if (port != 0) {
        indent(sout,i+j);
        sout << "port: ";
        sout << port;
        sout << std::endl;
    }

    if (localPort != 0) {
        indent(sout,i+j);
        sout << "localPort: ";
        sout << localPort;
        sout << std::endl;
    }

    indent(sout,i+j);
    sout << "shared: ";
    sout << getSharedFlag();
    sout << std::endl;

    BaseClass::serialize(sout,i+j,true);

    if ( !slotsOnly ) {
        indent(sout,i);
        sout << ")" << std::endl;
    }

    return sout;
}
Ejemplo n.º 18
0
//------------------------------------------------------------------------------
// serialize() -- print the value of this object to the output stream sout.
//------------------------------------------------------------------------------
std::ostream& Yiq::serialize(std::ostream& sout, const int i, const bool slotsOnly) const
{
    int j = 0;
    if ( !slotsOnly ) {
        sout << "( " << getFormName() << std::endl;
        j = 4;
    }

    indent(sout,i+j);
    sout << "y: " << this->y() << std::endl;

    indent(sout,i+j);
    sout << "i: " << this->i() << std::endl;

    indent(sout,i+j);
    sout << "q: " << this->q() << std::endl;

    if ( !slotsOnly ) {
        indent(sout,i);
        sout << ")" << std::endl;
    }

    return sout;
}
Ejemplo n.º 19
0
//------------------------------------------------------------------------------
// serialize
//------------------------------------------------------------------------------
std::ostream& Pareto::serialize(std::ostream& sout, const int i, const bool slotsOnly) const
{
  int j = 0;
  if ( !slotsOnly ) {
//    indent(sout,i);
    sout << "( " << getFormName() << std::endl;
    j = 4;
  }

  // serialize base class
  BaseClass::serialize(sout,i+j,true);

  indent(sout,i+j);
  sout << "alpha: " << alpha << std::endl;
  indent(sout,i+j);
  sout << "beta: " << beta << std::endl;

  if ( !slotsOnly ) {
    indent(sout,i);
    sout << ")" << std::endl;
  }

  return sout;
}
Ejemplo n.º 20
0
//------------------------------------------------------------------------------
// serialize
//------------------------------------------------------------------------------
std::ostream& Uniform::serialize(std::ostream& sout, const int i, const bool slotsOnly) const
{
  int j = 0;
  if ( !slotsOnly ) {
//    indent(sout,i);
    sout << "( " << getFormName() << std::endl;
    j = 4;
  }

  // serialize base class
  BaseClass::serialize(sout,i+j,true);

  indent(sout,i+j);
  sout << "min: " << min << std::endl;
  indent(sout,i+j);
  sout << "max: " << max << std::endl;

  if ( !slotsOnly ) {
    indent(sout,i);
    sout << ")" << std::endl;
  }

  return sout;
}
Ejemplo n.º 21
0
//------------------------------------------------------------------------------
// serialize
//------------------------------------------------------------------------------
std::ostream& Logger::serialize(std::ostream& sout, const int i, const bool slotsOnly) const
{
    int j = 0;
    if ( !slotsOnly ) {
        //indent(sout,i);
        sout << "( " << getFormName() << std::endl;
        j = 4;
    }

    // File name
    if (filename->len() > 0) {
        indent(sout,i+j);
        sout << "filename: \"" << *filename << "\""<< std::endl;
    }

    // Path name
    if (pathname->len() > 0) {
        indent(sout,i+j);
        sout << "pathname: \"" << *pathname << "\"" << std::endl;
    }

    // TopLine
    if (topLine != 0) {
       if (topLine->len() > 0) {
          indent(sout,i+j);
          sout << "topLine: \"" << *topLine << "\"" << std::endl;
       }
    }

    if ( !slotsOnly ) {
        indent(sout,i);
        sout << ")" << std::endl;
    }

    return sout;
}
Ejemplo n.º 22
0
//------------------------------------------------------------------------------
// serialize
//------------------------------------------------------------------------------
std::ostream& RfSystem::serialize(std::ostream& sout, const int i, const bool slotsOnly) const
{
    int j = 0;
    if ( !slotsOnly ) {
        indent(sout,i);
        sout << "( " << getFormName() << std::endl;
        j = 4;
    }

    if (antennaName != 0) {
        indent(sout,i+j);
        sout << "antenna: " << *antennaName << std::endl;
    }

    // DPG #### Need to print slots!!!
    BaseClass::serialize(sout,i+j,true);

    if ( !slotsOnly ) {
        indent(sout,i);
        sout << ")" << std::endl;
    }

    return sout;
}
Ejemplo n.º 23
0
//------------------------------------------------------------------------------
// serialize
//------------------------------------------------------------------------------
std::ostream& Exponential::serialize(std::ostream& sout, const int i, const bool slotsOnly) const
{
  int j = 0;
  if ( !slotsOnly ) {
//    indent(sout,i);
    sout << "( " << getFormName() << std::endl;
    j = 4;
  }

  // serialize base class
  BaseClass::serialize(sout,i+j,true);

  indent(sout,i+j);
  sout << "lambda: " << lambda << std::endl;
  indent(sout,i+j);
  sout << "gamma: " << gamma << std::endl;

  if ( !slotsOnly ) {
    indent(sout,i);
    sout << ")" << std::endl;
  }

  return sout;
}
Ejemplo n.º 24
0
//------------------------------------------------------------------------------
// serialize() -- print the value of this object to the output stream sout.
//------------------------------------------------------------------------------
std::ostream& Cie::serialize(std::ostream& sout, const int i, const bool slotsOnly) const
{
    int j = 0;
    if ( !slotsOnly ) {
        sout << "( " << getFormName() << std::endl;
        j = 4;
    }

    indent(sout,i+j);
    sout << "Luminance: " << luminance() << std::endl;

    indent(sout,i+j);
    sout << "X:         " << x() << std::endl;

    indent(sout,i+j);
    sout << "Y:         " << y() << std::endl;

    if ( !slotsOnly ) {
        indent(sout,i);
        sout << ")" << std::endl;
    }

    return sout;
}
Ejemplo n.º 25
0
//------------------------------------------------------------------------------
// serialize
//------------------------------------------------------------------------------
std::ostream& Station::serialize(std::ostream& sout, const int i, const bool slotsOnly) const
{
    int j = 0;
    if ( !slotsOnly ) {
        indent(sout,i);
        sout << "( " << getFormName() << std::endl;
        j = 4;
    }

    // simulation model
    if (sim != 0) {
        indent(sout,i+j);
        sout << "simulation: " << std::endl;
        
        sim->serialize(sout,(i+j));
    }

    // I/O handlers
    if (ioHandlers != 0) {
        indent(sout,i+j);
        sout << "ioHandler: {" << std::endl;
        ioHandlers->serialize(sout,i+j+4);
        indent(sout,i+j);
        sout << "}" << std::endl;
    }

    // OTW subsystems
    if (otw != 0) {
        indent(sout,i+j);
        sout << "otw: {" << std::endl;
        otw->serialize(sout,i+j+4);
        indent(sout,i+j);
        sout << "}" << std::endl;
    }

    // networks
    if (networks != 0) {
        indent(sout,i+j);
        sout << "networks: {" << std::endl;
        networks->serialize(sout,i+j+4);
        indent(sout,i+j);
        sout << "}" << std::endl;
    }

    // tcRate: Time-critical thread update rate (Hz)
    indent(sout,i+j);
    sout << "tcRate: " << tcRate << std::endl;

    // tcPriority: Time-critical thread priority
    indent(sout,i+j);
    sout << "tcPriority: " << tcPri << std::endl;

    // netRate: Network thread rate (Hz)
    indent(sout,i+j);
    sout << "netRate: " << netRate << std::endl;

    // netPriority: Network thread priority
    indent(sout,i+j);
    sout << "netPriority: " << netPri << std::endl;

    // fastForwardRate:
    if (fastForwardRate != DEFAULT_FAST_FORWARD_RATE) {
      indent(sout,i+j);
      sout << "fastForwardRate: " << fastForwardRate << std::endl;
    }

    // startupResetTime: Startup (initial) RESET pulse timer value (Basic::Time)
    if (startupResetTimer0 != 0) {
        indent(sout,i+j);
        sout << "startupResetTime: " << *startupResetTimer0 << std::endl;
    }

    if (ownshipName != 0) {
        indent(sout,i+j);
        sout << "ownship: " << *ownshipName << std::endl;
    }

    // don't care about component stuff right now
    //BaseClass::serialize(sout,i+j,true);

    if ( !slotsOnly ) {
    	indent(sout,i);
    	sout << ")" << std::endl;
    }

    return sout;
}
Ejemplo n.º 26
0
//------------------------------------------------------------------------------
// serialize() -- print functions
//------------------------------------------------------------------------------
std::ostream& Field::serialize(std::ostream& sout, const int i, const bool slotsOnly) const
{
    int j = 0;
    if ( !slotsOnly ) {
        sout << "( " << getFormName() << std::endl;
        j = 4;
    }

    BaseClass::serialize(sout,i+j,true);

    if (line() > 0 && column() > 0) {
        indent(sout,i+j);
        sout << "position: [ " << line() << " " << column() << " ]" << std::endl;
    }

    if ( width() > 0) {
        indent(sout,i+j);
        sout << "width: "	<< (unsigned int)width()	<< std::endl;
    }

    if ( isHighLighted() ) {
        indent(sout,i+j);
        sout << "highLight: " << isHighLighted() << std::endl;
    }

    if ( isUnderlined() ) {
        indent(sout,i+j);
        sout << "underline: " << isUnderlined() << std::endl;
    }

    if ( isReversed() ) {
        indent(sout,i+j);
        sout << "reversed: " << isReversed() << std::endl;
    }

    if ( isVertical() ) {
        indent(sout,i+j);
        sout << "vertical: " << isVertical() << std::endl;
    }

    if ( areBracketsOn() ) {
        indent(sout,i+j);
        sout << "brackets: " << areBracketsOn() << std::endl;
    }

    indent(sout,i+j);
    sout << "justification: ";
    switch (jmode) {
        case Basic::String::NONE   : sout << "\"none\"";    break;
        case Basic::String::LEFT   : sout << "\"left\"";    break;
        case Basic::String::CENTER : sout << "\"center\"";  break;
        case Basic::String::RIGHT  : sout << "\"right\"";   break;
    }
    sout << std::endl;

    if ( !slotsOnly ) {
        indent(sout,i);
        sout << ")" << std::endl;
    }
    return sout;
}
Ejemplo n.º 27
0
//------------------------------------------------------------------------------
// serialize() -- print functions
//------------------------------------------------------------------------------
std::ostream& NumericReadout::serialize(std::ostream& sout, const int i, const bool slotsOnly) const
{
    int j = 0;
    if ( !slotsOnly ) {
        sout << "( " << getFormName() << std::endl;
        j = 4;
    }

    if (num != 0.0) {
        indent(sout,i+j);
        sout << "value: " << num << std::endl;
    }

    if (maxNum != UNDEFINED_VALUE) {
        indent(sout,i+j);
        sout << "maxValue: " << maxNum << std::endl;
    }

    if (inputExample.len() > 0) {
        indent(sout,i+j);
        sout << "format: " << inputExample << std::endl;
    }

    if (plusChar > 0) {
        indent(sout,i+j);
        sout << "plusChar: " << '\"' << plusChar << '\"' << std::endl;
    }

    if (minusChar > 0) {
        indent(sout,i+j);
        sout << "minusChar: " << '\"' << minusChar << '\"' << std::endl;
    }

    if (dpChar > 0) {
        indent(sout,i+j);
        sout << "dpChar: " << '\"' << dpChar << '\"' << std::endl;
    }

    if (undefinedChar > 0) {
        indent(sout,i+j);
        sout << "undefinedChar: " << '\"' << undefinedChar << '\"' << std::endl;
    }

    if (overflowChar > 0) {
        indent(sout,i+j);
        sout << "overflowChar: " << '\"' << overflowChar << '\"' << std::endl;
    }

    if (maxValid != UNDEFINED_VALUE) {
        indent(sout,i+j);
        sout << "maxValid: " << maxValid << std::endl;
    }

    if (minValid != UNDEFINED_VALUE) {
        indent(sout,i+j);
        sout << "minValid: " << minValid << std::endl;
    }

    if (blankZero) {
        indent(sout,i+j);
        sout << "blankZero: " << blankZero << std::endl;
    }

    BaseClass::serialize(sout,i+j,true);

    if ( !slotsOnly ) {
        indent(sout,i);
        sout << ")" << std::endl;
    }
    return sout;
}
Ejemplo n.º 28
0
//------------------------------------------------------------------------------
// serialize
//------------------------------------------------------------------------------
std::ostream& Component::serialize(std::ostream& sout, const int i, const bool slotsOnly) const
{
    int j = 0;
    if ( !slotsOnly ) {
        //indent(sout,i);
        sout << "( " << getFormName() << std::endl;
        j = 4;
    }

    // List of components
    const PairStream* subcomponents = getComponents();
    if (subcomponents != 0) {
        indent(sout,i+j);
        sout << "components: {" << std::endl;
        subcomponents->serialize(sout,i+j+4,slotsOnly);
        indent(sout,i+j);
        sout << "}" << std::endl;
        subcomponents->unref();
        subcomponents = 0;
    }

    // Selected component
    if (selection != 0) {
        indent(sout,i+j);
        sout << "select: ";
        String* str = dynamic_cast<String*>(selection);
        if (str != 0) {
            sout << *str;
        }
        else {
            Number* num = dynamic_cast<Number*>(selection);
            if (num != 0) sout << num->getInt();
        }
        sout << std::endl;
    }

    // Event logger
    if (elog0 != 0) {
        indent(sout,i+j);
        sout << "logger: " << std::endl;
        elog0->serialize(sout,i+j,slotsOnly);
    }

    // enableTimingStats
    if (isTimingStatsEnabled()) {
        indent(sout,i+j);
        sout << "enableTimingStats: " << isTimingStatsEnabled() << std::endl;
    }

    // printTimingStats
    if (isTimingStatsPrintEnabled()) {
        indent(sout,i+j);
        sout << "printTimingStats: " << isTimingStatsPrintEnabled() << std::endl;
    }

    // Freeze
    if (isFrozen()) {
        indent(sout,i+j);
        sout << "freeze: " << isFrozen() << std::endl;
    }

    {
      unsigned short bits = getMessageEnableBits();

      // Message enable bits (only if anything other than just ERROR is set)
      if (bits != MSG_ERROR) {

         // Standard 
         if ( (bits & MSG_WARNING) != 0 ) {
            indent(sout,i+j);
            sout << "enableMessageType:  WARNING" << std::endl;
         }
         if ( (bits & MSG_INFO) != 0 ) {
            indent(sout,i+j);
            sout << "enableMessageType:  INFO" << std::endl;
         }
         if ( (bits & MSG_DEBUG) != 0 ) {
            indent(sout,i+j);
            sout << "enableMessageType:  DEBUG" << std::endl;
         }
         if ( (bits & MSG_DATA) != 0 ) {
            indent(sout,i+j);
            sout << "enableMessageType:  DATA" << std::endl;
         }
         if ( (bits & MSG_USER) != 0 ) {
            indent(sout,i+j);
            sout << "enableMessageType:  USER" << std::endl;
         }

         // Non-standard
         if ( (bits & ~MSG_STD_ALL) != 0 ) {
            indent(sout,i+j);
            sout << "enableMessageType: " << std::hex << (bits & ~MSG_STD_ALL) << std::dec << std::endl;
         }
      }
    }

    {
      unsigned short bits = getMessageDisableBits();

      // Message disable bits (only if any are set)
      if (bits != 0) {

         // Standard
         if ( (bits & MSG_WARNING) != 0 ) {
            indent(sout,i+j);
            sout << "disableMessageType:  WARNING" << std::endl;
         }
         if ( (bits & MSG_INFO) != 0 ) {
            indent(sout,i+j);
            sout << "disableMessageType:  INFO" << std::endl;
         }
         if ( (bits & MSG_DEBUG) != 0 ) {
            indent(sout,i+j);
            sout << "disableMessageType:  DEBUG" << std::endl;
         }
         if ( (bits & MSG_DATA) != 0 ) {
            indent(sout,i+j);
            sout << "disableMessageType:  DATA" << std::endl;
         }
         if ( (bits & MSG_USER) != 0 ) {
            indent(sout,i+j);
            sout << "disableMessageType:  USER" << std::endl;
         }

         // Non-standard
         if ( (bits & ~MSG_STD_ALL) != 0 ) {
            indent(sout,i+j);
            sout << "disableMessageType: " << std::hex << (bits & ~MSG_STD_ALL) << std::dec << std::endl;
         }
      }
    }

    if ( !slotsOnly ) {
        indent(sout,i);
        sout << ")" << std::endl;
    }

    return sout;
}