Exemple #1
0
OGRHTFMetadataLayer::OGRHTFMetadataLayer(std::vector<CPLString> aosMDIn) :
    poFeatureDefn(new OGRFeatureDefn( "metadata" )),
    aosMD(aosMDIn),
    nNextFID(0)
{
    SetDescription( poFeatureDefn->GetName() );
    poFeatureDefn->Reference();
    poFeatureDefn->SetGeomType( wkbNone  );

    std::vector<CPLString>::const_iterator oIter = aosMD.begin();
    std::vector<CPLString>::const_iterator oEndIter = aosMD.end();
    while(oIter != oEndIter)
    {
        const CPLString& osStr = *oIter;
        char* pszStr = CPLStrdup(osStr.c_str());
        char* pszSep = strstr(pszStr, ": ");
        if (pszSep)
        {
            *pszSep = 0;
            int i = 0, j = 0;
            for(;pszStr[i];i++)
            {
                if (pszStr[i] == ' ' || pszStr[i] == '-' || pszStr[i] == '&')
                {
                    if (j > 0 && pszStr[j-1]  == '_')
                        continue;
                    pszStr[j++] = '_';
                }
                else if (pszStr[i] == '(' || pszStr[i] == ')')
                    ;
                else
                    pszStr[j++] = pszStr[i];
            }
            pszStr[j] = 0;
            OGRFieldDefn    oField( pszStr, OFTString);
            poFeatureDefn->AddFieldDefn( &oField );
        }
        CPLFree(pszStr);
        ++oIter;
    }

    poFeature = new OGRFeature(poFeatureDefn);
    oIter = aosMD.begin();
    oEndIter = aosMD.end();
    int nField = 0;
    while(oIter != oEndIter)
    {
        const CPLString& osStr = *oIter;
        const char* pszStr = osStr.c_str();
        const char* pszSep = strstr(pszStr, ": ");
        if (pszSep)
        {
            if (pszSep[2] != '*')
                poFeature->SetField( nField, pszSep + 2 );

            nField ++;
        }
        ++oIter;
    }
}
/************************************************************************************************
 * CRMObjective::CRMObjective
 *	Constructs a random mission objective and fills in the default properties
 *
 * inputs:
 *  none
 *
 * return:
 *	none
 *
 ************************************************************************************************/
CRMObjective::CRMObjective ( CGPGroup* group )
{	
	SetPriority(atoi(group->FindPairValue("priority", "0")));
	SetMessage( group->FindPairValue("message",va("Objective %i Completed", GetPriority()) ) );
	SetDescription(group->FindPairValue("description",va("Objective %i", GetPriority()) ) );
	SetInfo(group->FindPairValue("info",va("Info %i", GetPriority()) ) );
	SetTrigger(group->FindPairValue("trigger",""));
	SetName(group->GetName());
	
/*	const char * soundPath = group->FindPairValue("completed_sound", "" ); 
	if (soundPath)
		mCompleteSoundID = G_SoundIndex(soundPath); 
*/

	mCompleted  = false;
	mOrderIndex = -1;

	// If no priority was specified for this objective then its active by default.
	if ( GetPriority ( ) )
	{
		mActive	= false;
	}
	else
	{
		mActive = true;
	}
}
Exemple #3
0
CPLErr VRTRasterBand::CopyCommonInfoFrom( GDALRasterBand * poSrcBand )

{
    SetMetadata( poSrcBand->GetMetadata() );
    const char* pszNBits = poSrcBand->GetMetadataItem("NBITS", "IMAGE_STRUCTURE");
    SetMetadataItem( "NBITS", pszNBits, "IMAGE_STRUCTURE" );
    const char* pszPixelType = poSrcBand->GetMetadataItem("PIXELTYPE", "IMAGE_STRUCTURE");
    SetMetadataItem( "PIXELTYPE", pszPixelType, "IMAGE_STRUCTURE" );
    SetColorTable( poSrcBand->GetColorTable() );
    SetColorInterpretation(poSrcBand->GetColorInterpretation());
    if( strlen(poSrcBand->GetDescription()) > 0 )
        SetDescription( poSrcBand->GetDescription() );

    int bSuccess;
    double dfNoData;
    dfNoData = poSrcBand->GetNoDataValue( &bSuccess );
    if( bSuccess )
        SetNoDataValue( dfNoData );

    SetOffset( poSrcBand->GetOffset() );
    SetScale( poSrcBand->GetScale() );
    SetCategoryNames( poSrcBand->GetCategoryNames() );
    if( !EQUAL(poSrcBand->GetUnitType(),"") )
        SetUnitType( poSrcBand->GetUnitType() );

    return CE_None;
}
Exemple #4
0
cAction::cAction(const char *Id, cDevice *Device, const char *DevId)
{
  device=Device; devId=DevId;
  id=bprintf("%s %s",Id,DevId);
  unique=0; pri=-1;
  SetDescription("%s filter",id);
}
Exemple #5
0
/**
 * constructor, prepare parameters
 */
TMOMM16::TMOMM16()
{
	SetName(L"MM16");
	SetDescription(L"Co jsem si napsal");

	red.SetName(L"red");
	red.SetDescription(L"RED");
	red.SetDefault(0.299);
	red=0.299;
	red.SetRange(0.0,1.0);
	this->Register(red);

	green.SetName(L"green");
	green.SetDescription(L"GREEN");
	green.SetDefault(0.587);
	green=0.587;
	green.SetRange(0.0,1.0);
	this->Register(green);

	blue.SetName(L"blue");
	blue.SetDescription(L"BLUE");
	blue.SetDefault(0.114);
	blue=0.114;
	blue.SetRange(0.0,1.0);
	this->Register(blue);
	
	negative.SetName(L"neg");
	negative.SetDescription(L"Negative");
	negative.SetDefault(false);
	negative=false;	
	this->Register(negative);
}
OGRNTFFeatureClassLayer::OGRNTFFeatureClassLayer( OGRNTFDataSource *poDSIn )

{
    poFilterGeom = NULL;

    poDS = poDSIn;

    iCurrentFC = 0;

/* -------------------------------------------------------------------- */
/*      Establish the schema.                                           */
/* -------------------------------------------------------------------- */
    poFeatureDefn = new OGRFeatureDefn( "FEATURE_CLASSES" );
    SetDescription( poFeatureDefn->GetName() );
    poFeatureDefn->SetGeomType( wkbNone );
    poFeatureDefn->Reference();

    OGRFieldDefn      oFCNum( "FEAT_CODE", OFTString );

    oFCNum.SetWidth( 4 );
    poFeatureDefn->AddFieldDefn( &oFCNum );
    
    OGRFieldDefn      oFCName( "FC_NAME", OFTString );

    oFCNum.SetWidth( 80 );
    poFeatureDefn->AddFieldDefn( &oFCName );
}
Exemple #7
0
OGRSUALayer::OGRSUALayer( VSILFILE* fp )

{
    fpSUA = fp;
    nNextFID = 0;
    bEOF = FALSE;
    bHasLastLine = FALSE;

    poSRS = new OGRSpatialReference(SRS_WKT_WGS84);

    poFeatureDefn = new OGRFeatureDefn( "layer" );
    SetDescription( poFeatureDefn->GetName() );
    poFeatureDefn->Reference();
    poFeatureDefn->SetGeomType( wkbPolygon );
    poFeatureDefn->GetGeomFieldDefn(0)->SetSpatialRef(poSRS);

    OGRFieldDefn    oField1( "TYPE", OFTString);
    poFeatureDefn->AddFieldDefn( &oField1 );
    OGRFieldDefn    oField2( "CLASS", OFTString);
    poFeatureDefn->AddFieldDefn( &oField2 );
    OGRFieldDefn    oField3( "TITLE", OFTString);
    poFeatureDefn->AddFieldDefn( &oField3 );
    OGRFieldDefn    oField4( "TOPS", OFTString);
    poFeatureDefn->AddFieldDefn( &oField4 );
    OGRFieldDefn    oField5( "BASE", OFTString);
    poFeatureDefn->AddFieldDefn( &oField5 );
}
Exemple #8
0
//------------------------------------------------------------------------------
EStatus &  EStatus::operator=  (const EStatus &  statIn)
  {
  eStatusCode = statIn.eStatusCode;

  SetDescription  (statIn.pstrDescription == NULL ? NULL : statIn.pstrDescription->AsChar ());

  return *this;
  };
Exemple #9
0
cDBusOsdProvider::cDBusOsdProvider(cDBusObject *Object)
{
  _provider = this;
  _object = Object;
  isyslog("dbus2vdr: new DBus-OSD-provider");
  SetDescription("dbus2vdr: osd-provider signal");
  Start();
}
OGRCARTODBResultLayer::OGRCARTODBResultLayer( OGRCARTODBDataSource* poDS,
                                              const char * pszRawQueryIn ) :
                                              OGRCARTODBLayer(poDS)
{
    osBaseSQL = pszRawQueryIn;
    SetDescription( "result" );
    poFirstFeature = NULL;
}
OGRAmigoCloudResultLayer::OGRAmigoCloudResultLayer(
    OGRAmigoCloudDataSource* poDSIn,
    const char * pszRawQueryIn ) :
    OGRAmigoCloudLayer(poDSIn)
{
    osBaseSQL = pszRawQueryIn;
    SetDescription( "result" );
    poFirstFeature = nullptr;
}
Exemple #12
0
CPL_C_END

/* ******************************************************************** */
/*                     GDALProxyPoolDataset                             */
/* ******************************************************************** */

GDALProxyPoolDataset::GDALProxyPoolDataset(const char* pszSourceDatasetDescription,
                                   int nRasterXSize, int nRasterYSize,
                                   GDALAccess eAccess, int bShared,
                                   const char * pszProjectionRef,
                                   double * padfGeoTransform)
{
    GDALDatasetPool::Ref();

    SetDescription(pszSourceDatasetDescription);

    this->nRasterXSize = nRasterXSize;
    this->nRasterYSize = nRasterYSize;
    this->eAccess = eAccess;

    this->bShared = bShared;

    this->responsiblePID = GDALGetResponsiblePIDForCurrentThread();

    if (pszProjectionRef)
    {
        this->pszProjectionRef = NULL;
        bHasSrcProjection = FALSE;
    }
    else
    {
        this->pszProjectionRef = CPLStrdup(pszProjectionRef);
        bHasSrcProjection = TRUE;
    }
    if (padfGeoTransform)
    {
        memcpy(adfGeoTransform, padfGeoTransform,6 * sizeof(double));
        bHasSrcGeoTransform = TRUE;
    }
    else
    {
        adfGeoTransform[0] = 0;
        adfGeoTransform[1] = 1;
        adfGeoTransform[2] = 0;
        adfGeoTransform[3] = 0;
        adfGeoTransform[4] = 0;
        adfGeoTransform[5] = 1;
        bHasSrcGeoTransform = FALSE;
    }

    pszGCPProjection = NULL;
    nGCPCount = 0;
    pasGCPList = NULL;
    metadataSet = NULL;
    metadataItemSet = NULL;
    cacheEntry = NULL;
}
Exemple #13
0
void CTaskModel::SetAttributes(unsigned __int64 parentID, const TCHAR *pTitle, const TCHAR *pDesc, int priority, 
		unsigned __int64 start, unsigned __int64 due, const TCHAR *pOwner, TASK_STATE state, 
		unsigned __int64 estimate, const TCHAR *pAssignee, unsigned __int64 assigned, unsigned __int64 modified, 
		const TCHAR *pGroup)
{
	if(!m_pNode)DebugBreak();
	StringBuffer temp(32);
	SetAttribute(PARENTID, ModelUtils::toHexString(parentID, temp));
	temp.flush();
	if(pTitle)
	{
		SetTitle(pTitle);
	}
	if(pDesc)
	{
		SetDescription(pDesc, false);
	}
	if(pOwner)
	{
		//TODO: review setting of pOwner, is there a reason not to set this value?
		SetOwner(pOwner);
	}
	temp.appendInt(priority);
	SetAttribute(PRIORITY, temp);
	temp.flush();
	temp.appendInt(static_cast<int>(state));
	SetAttribute(STATE, temp);
	temp.flush();
	SetAttribute(ESTIMATE, ModelUtils::toHexString(estimate, temp));
	temp.flush();
	SetAttribute(DUE, ModelUtils::toHexString(due, temp));
	temp.flush();
	SetAttribute(START, ModelUtils::toHexString(start, temp));
	temp.flush();
	SetAttribute(ASSIGNED, ModelUtils::toHexString(assigned, temp));
	temp.flush();
	//TODO: figure out what this is doing...
	TaskEvent::ChangeType ct = TaskEvent::AllAttributesNoNetwork;
	if(modified)
	{
		SetAttribute(MODIFIED, modified);
	}
	else
	{
		ct = TaskEvent::AllAttributes;
		SetAttribute(MODIFIED, ModelUtils::CurrentUTC());
	}
	SetAttribute(GROUP, pGroup? pGroup: XMLHelper::EMPTY_STR);
	if(pAssignee)
	{
		SetAttribute(ASSIGNEE, pAssignee);
	}

//TODO: what is the no network value for??
	TaskEvent te(TaskEvent::AllAttributes, m_id);
	notifyTaskListeners(&te);
}
Exemple #14
0
cThread::cThread(const char *Description)
{
  active = running = false;
  childTid = 0;
  childThreadId = 0;
  description = NULL;
  if (Description)
     SetDescription("%s", Description);
}
ProcessReader::ProcessReader(Timer& timer, ILineBuffer& linebuffer, const std::wstring& pathName, const std::wstring& args) :
	PassiveLogSource(timer, SourceType::Pipe, linebuffer, 40),
	m_process(pathName, args),
	m_stdout(timer, linebuffer, m_process.GetStdOut(), m_process.GetProcessId(), Str(m_process.GetName()).str() + ":stdout", 0),
	m_stderr(timer, linebuffer, m_process.GetStdErr(), m_process.GetProcessId(), Str(m_process.GetName()).str() + ":stderr", 0)
{
	SetDescription(m_process.GetName() + L" stdout/stderr");
	StartThread();
}
	void Buffer::SetDescription(const System::string& value)
	{
	    #ifdef HAS_AUDIO_BUFFER
		impl->SetDescription(value);
		#else
        (void)value;
		throw System::PunkException(L"Audio buffer not supported");
		#endif
	}
Exemple #17
0
bool IStrategy::Load(std::istream& s)
{
	int emptyLineCount(0);
	std::map<std::string, std::string> configurePairs;
	std::string line;
	while (std::getline(s, line))
	{
		Trim(line);
		if (!line.empty())
		{
			emptyLineCount = 0;
			if ('#' != line[0])
			{
				auto splitPos = line.find_first_of(':');
				if (std::string::npos != splitPos)
				{
					auto key = line.substr(0, splitPos);
					auto value = line.substr(splitPos + 1);

					Trim(key);
					Trim(value);
					configurePairs[key] = value;
				}
			}
		}
		else
		{
			emptyLineCount++;
			if (1 == emptyLineCount)
			{
				break;
			}
		}
	}

	auto itName = configurePairs.find("Name");
	if (itName != configurePairs.end())
	{
		SetName(itName->second);
	}
	else
	{
		return false;
	}

	auto itDescription = configurePairs.find("Description");
	if (itDescription != configurePairs.end())
	{
		SetDescription(itDescription->second);
	}
	else
	{
		return false;
	}

	return DoLoad(configurePairs);
}
ExportFFmpeg::ExportFFmpeg()
:  ExportPlugin()
{
   mEncFormatCtx = NULL;			// libavformat's context for our output file
   mEncFormatDesc = NULL;			// describes our output file to libavformat
   mEncAudioStream = NULL;			// the output audio stream (may remain NULL)
   mEncAudioCodecCtx = NULL;		// the encoder for the output audio stream
   mEncAudioEncodedBuf = NULL;	// buffer to hold frames encoded by the encoder
   #define MAX_AUDIO_PACKET_SIZE (128 * 1024)
   mEncAudioEncodedBufSiz = 4*MAX_AUDIO_PACKET_SIZE;
   mEncAudioFifoOutBuf = NULL;	// buffer to read _out_ of the FIFO into
   mSampleRate = 0;
   mSupportsUTF8 = true;

   PickFFmpegLibs(); // DropFFmpegLibs() call is in ExportFFmpeg::Destroy()
   int newfmt;
   // Adds export types from the export type list
   for (newfmt = 0; newfmt < FMT_LAST; newfmt++)
   {
      wxString shortname(ExportFFmpegOptions::fmts[newfmt].shortname);
      //Don't hide export types when there's no av-libs, and don't hide FMT_OTHER
      if (newfmt < FMT_OTHER && FFmpegLibsInst->ValidLibsLoaded())
      {
         // Format/Codec support is compiled in?
         AVOutputFormat *avoformat = FFmpegLibsInst->guess_format(shortname.mb_str(), NULL, NULL);
         AVCodec *avcodec = FFmpegLibsInst->avcodec_find_encoder(ExportFFmpegOptions::fmts[newfmt].codecid);
         if (avoformat == NULL || avcodec == NULL)
         {
            ExportFFmpegOptions::fmts[newfmt].compiledIn = false;
            continue;
         }
      }
      int fmtindex = AddFormat() - 1;
      SetFormat(ExportFFmpegOptions::fmts[newfmt].name,fmtindex);
      AddExtension(ExportFFmpegOptions::fmts[newfmt].extension,fmtindex);
      // For some types add other extensions
      switch(newfmt)
      {
      case FMT_M4A:
         AddExtension(wxString(wxT("3gp")),fmtindex);
         AddExtension(wxString(wxT("m4r")),fmtindex);
         AddExtension(wxString(wxT("mp4")),fmtindex);
         break;
      case FMT_WMA2:
         AddExtension(wxString(wxT("asf")),fmtindex);
         AddExtension(wxString(wxT("wmv")),fmtindex);
         break;
      default:
         break;
      }

     SetMaxChannels(ExportFFmpegOptions::fmts[newfmt].maxchannels,fmtindex);
     SetCanMetaData(ExportFFmpegOptions::fmts[newfmt].canmetadata,fmtindex);
     SetDescription(ExportFFmpegOptions::fmts[newfmt].description,fmtindex);
   }
}
Exemple #19
0
ExportFLAC::ExportFLAC()
:  ExportPlugin()
{
   AddFormat();
   SetFormat(wxT("FLAC"),0);
   AddExtension(wxT("flac"),0);
   SetMaxChannels(FLAC__MAX_CHANNELS,0);
   SetCanMetaData(true,0);
   SetDescription(_("FLAC Files"),0);
}
Exemple #20
0
void BatchPrecip_UnitDef::GetOptions()
  {
  SetDefaultTag("BP", true);
  SetDrawing("Tank", BatchPrecipDraw);
  SetTreeDescription("Process:Unit:Alcan Batch Precipitator");
  SetDescription("Alcan Batch Precipitator based on Hyprod model");
  SetModelSolveMode(MSolveMode_Probal);
  SetModelGroup(MGroup_Alumina);
  SetModelLicense(MLicense_HeatExchange|MLicense_Alumina|MLicense_Alcan);
  };
Exemple #21
0
ExportMP2::ExportMP2()
:  ExportPlugin()
{
   AddFormat();
   SetFormat(wxT("MP2"),0);
   AddExtension(wxT("mp2"),0);
   SetMaxChannels(2,0);
   SetCanMetaData(true,0);
   SetDescription(_("MP2 Files"),0);
}
Exemple #22
0
void CPSDUnit_UnitDef::GetOptions()
{
    SetDefaultTag("PC");
    SetDrawing("Tank", Drw_CPSDUnit);
    SetTreeDescription("Worsley:PSDUnit");
    SetDescription("Worsley Precip Model: PSD Generation and Display");
    SetModelSolveMode(MSolveMode_Probal);
    SetModelGroup(MGroup_Alumina);
    SetModelLicense(MLicense_HeatExchange|MLicense_Alumina);
};
Exemple #23
0
void QualChange_UnitDef::GetOptions()
{
    SetDefaultTag("QC");
    SetDrawing("HeatExchange", Drw_QualChange);
    SetTreeDescription("Demo:Simple Heater");
    SetDescription("TODO: A description");
    SetModelSolveMode(MSolveMode_Probal);
    SetModelGroup(MGroup_Energy);
    SetModelLicense(MLicense_HeatExchange);
};
Exemple #24
0
void SimpleReactor_UnitDef::GetOptions()
{
    SetDefaultTag("SR", true);
    SetDrawing("Tank", Drw_SimpleReactor);
    SetTreeDescription("Demo:Simple Reactor");
    SetDescription("TODO: A description");
    SetModelSolveMode(MSolveMode_Probal);
    SetModelGroup(MGroup_General);
    SetModelLicense(MLicense_Standard);
};
Exemple #25
0
cThread::cThread(const char *Description, bool LowPriority)
{
    active = running = false;
    childTid = 0;
    childThreadId = 0;
    description = NULL;
    if (Description)
        SetDescription("%s", Description);
    lowPriority = LowPriority;
}
Exemple #26
0
ExportOGG::ExportOGG()
:  ExportPlugin()
{
   AddFormat();
   SetFormat(wxT("OGG"),0);
   AddExtension(wxT("ogg"),0);
   SetMaxChannels(255,0);
   SetCanMetaData(true,0);
   SetDescription(_("Ogg Vorbis Files"),0);
}
CGXStandardObisCode::CGXStandardObisCode(std::vector< std::string > obis,
    std::string& desc,
    std::string& interfaces, std::string& dataType)
{
    m_OBIS.clear();
    m_OBIS.insert(m_OBIS.end(), obis.begin(), obis.end());
    SetDescription(desc);
    SetInterfaces(interfaces);
    SetDataType(dataType);
}
Exemple #28
0
void CDocumentPreview::NewDocPreview(CPmwDoc* pDoc, BOOL fEncloseObjects /*=FALSE*/)
{
	m_pDoc = pDoc;

	m_fCloseDoc = FALSE;
	m_fEncloseObjects = fEncloseObjects;
	m_fForceToFront = TRUE;
	SetDescription(NULL, NULL);
	SizeDocPreview();
}
Exemple #29
0
CpuTemperature::CpuTemperature(uint8_t nSensor): RDMSensor(nSensor) {
	SetType(E120_SENS_TEMPERATURE);
	SetUnit(E120_UNITS_CENTIGRADE);
	SetPrefix(E120_PREFIX_NONE);
	SetRangeMin(RDM_SENSOR_TEMPERATURE_ABS_ZERO);
	SetRangeMax(RDM_SENSOR_RANGE_MAX);
	SetNormalMin(RDM_SENSOR_TEMPERATURE_ABS_ZERO);
	SetNormalMax((int16_t) Hardware::Get()->GetCoreTemperatureMax());
	SetDescription("CPU");
}
OVRError::OVRError(ovrResult code, const char* pFormat, ...)
    : OVRError(code)
{
    va_list argList;
    va_start(argList, pFormat);
    StringBuffer strbuff;
    strbuff.AppendFormatV(pFormat, argList);
    SetDescription(strbuff.ToCStr());
    va_end(argList);
}