ReaderLibrary.MyTag.SetSOCVersion C# (CSharp) Method

SetSOCVersion() public method

public SetSOCVersion ( int version ) : void
version int
return void
        public void SetSOCVersion(int version)
        {
            socVersion = version;
        }

Usage Example

Example #1
0
        private void HandleSOCTag(MyTag tag)
        {
            tag.SetSOCVersion(SOCVersion);

            int[] SOCValues = tag.GetSOCData();
            // store current value
            if (SOCValues.Length > 0)
                SOCValue = SOCValues[0];
            // add all the new values to the graph.
            for (int i = 0; i < SOCValues.Length; i++)
            {
                SOCFilteredValue = SOCFilteredValue * SOCFilterAlpha + SOCValues[i] * (1 - SOCFilterAlpha);
            }

            SOCTemperature = Math.Round(SOCFilteredValue * SOCSlope + SOCIntercept, 3);
            
            double valToPlot;
            if (socPlotTemp) valToPlot = SOCTemperature;
            else valToPlot = SOCFilteredValue;

            lock (SOCData)
            {
                // add new point to the graph.
                SOCData.Add(new PointPair(SOCReportNumber++, valToPlot));

                // keep graph data from getting too big, or performance degrades.
                if (SOCData.Count > 1000)
                    SOCData.RemoveAt(0);
            }

            tag.socFilteredValue = SOCFilteredValue; // for logging, etc.
            tag.socFilteredTemperature = SOCTemperature;
        }