예제 #1
0
int DLLEXPORT SMO_getSystemAttribute(SMOutputAPI* smoapi, long timeIndex,
	SMO_systemAttribute attr, float* outValueArray)
//
//  Purpose: For the system at given time, get a particular attribute.
//
{
	int errorcode = 0;

	if (smoapi->file == NULL) errorcode = 412;
	else if (outValueArray == NULL) errorcode = 411;
	else
	{
		// don't need to loop since there's only one system
		outValueArray[0] = getSystemValue(smoapi, timeIndex, attr);
	}

	return errorcode;
}
int SMO_getSystemAttribute(SMOutputAPI* smoapi, int timeIndex,
	SMO_systemAttribute attr, float* outValueArray)
//
//  Purpose: For the system at given time, get a particular attribute.
//
{
	if (smoapi->isOpened) 
	{
		// Check memory for outValues
		if (outValueArray == NULL) return 411;

		// don't need to loop since there's only one system
		outValueArray[0] = getSystemValue(smoapi, timeIndex, attr);

		return 0;
	}
	// Error no results to report on binary file not opened
	return 412;

}
예제 #3
0
int DLLEXPORT SMO_getSystemSeries(SMOutputAPI* smoapi, SMO_systemAttribute attr,
	long timeIndex, long length, float *outValueSeries)
//
//  Purpose: Get time series results for particular attribute. Specify series
//  start and length using timeIndex and length respectively.
//
{
	int errorcode = 0;

	long k;

	if (smoapi->file == NULL) errorcode = 412;
	else if (outValueSeries == NULL) errorcode = 411;
	else
	{
		// loop over and build time series
		for (k = 0; k < length; k++)
			outValueSeries[k] = getSystemValue(smoapi, timeIndex + k, attr);
	}

	return errorcode;
}
int SMO_getSystemSeries(SMOutputAPI* smoapi, SMO_systemAttribute attr,
	int timeIndex, int length, float *outValueSeries)
//
//  Purpose: Get time series results for particular attribute. Specify series
//  start and length using timeIndex and length respectively.
//
{
	int k;

	if (smoapi->isOpened) 
	{
		// Check memory for outValues
		if (outValueSeries == NULL) return 411;

		// loop over and build time series
		for (k = 0; k < length; k++)
			outValueSeries[k] = getSystemValue(smoapi, timeIndex + k, attr);

		return 0;
	}
	// Error no results to report on binary file not opened
	return 412;
}