SetParametersRegular() public method

TimeSeriesLibrary is responsible for ensuring that a certain set of meta-parameters (which are saved as database fields) are coordinated with the BLOB of timeseries data. This method records all of the meta-parameters of a regular timeseries into the fields of this TSParameters object, using the input parameters given to the method.
public SetParametersRegular ( TSDateCalculator timeStepUnit, short timeStepQuantity, int timeStepCount, System.DateTime blobStartDate, int compressionCode ) : void
timeStepUnit TSDateCalculator
timeStepQuantity short
timeStepCount int
blobStartDate System.DateTime
compressionCode int
return void
Exemplo n.º 1
0
        /// <summary>
        /// This method writes a new record to the database table for a regular time series.
        /// The method will record extra parameters (other than those that are saved
        /// as class-level properties of this object) into the database record using the strings
        /// in the method parameters extraParamNames and extraParamValues.  This method does not
        /// make any changes to the trace table.
        /// </summary>
        /// <param name="doWriteToDB">true if the method should actually save the timeseries to the database</param>
        /// <param name="tsImport">TSImport object into which the method will record values that it has computed.
        /// If this parameter is null, then the method will skip the recording of such paramters to an object.</param>
        /// <param name="timeStepUnit">TSDateCalculator.TimeStepUnitCode value for Minute,Hour,Day,Week,Month, or Year</param>
        /// <param name="timeStepQuantity">The number of the given unit that defines the time step.
        /// For instance, if the time step is 6 hours long, then this value is 6.</param>
        /// <param name="timeStepCount">The number of time steps in the time series</param>
        /// <param name="outStartDate">date of the first time step in the series</param>
        /// <param name="extraParamNames">A list of field names that the the method should fill, in addition
        /// to the fields that the TimeSeriesLibrary is designed to maintain.  Every item in this list must
        /// be matched to an item in extraParamValues.</param>
        /// <param name="extraParamValues">A list of field values that the the method should fill, in addition
        /// to the fields that the TimeSeriesLibrary is designed to maintain.  Every item in this list must
        /// be matched to an item in extraParamNames.</param>
        /// <returns>the primary key Id value of the new record that was created</returns>
        public unsafe int WriteParametersRegular(
            bool doWriteToDB, TSImport tsImport,
            short timeStepUnit, short timeStepQuantity,
            int timeStepCount, DateTime outStartDate,
            String extraParamNames, String extraParamValues)
        {
            ErrorCheckWriteValues(doWriteToDB, tsImport);
            // The method's parameters are used to compute the meta-parameters of this time series
            TSParameters.SetParametersRegular(
                (TSDateCalculator.TimeStepUnitCode)timeStepUnit, timeStepQuantity,
                timeStepCount, outStartDate,
                // new time series are always compressed by the current compression technique
                TSBlobCoder.currentCompressionCode);
            IsInitialized = true;
            // Compute the Checksum for this time series ensemble.  Because this is a newly
            // written series, there are not yet any traces to incorporate into the checksum
            // (presumably those will be added later).
            Checksum = TSBlobCoder.ComputeChecksum(TSParameters, new List <ITimeSeriesTrace>());
            // WriteParameters method will handle all of the database interaction
            if (doWriteToDB)
            {
                WriteParameters(extraParamNames, extraParamValues);
            }

            return(Id);
        }