Beispiel #1
0
		public WAFErrors UpdateValues(ref WAFValue[] vals, WAFUpdateOption UpdateOption)
		{
			List<WAFValue> wafVals = vals.ToList<WAFValue>();

			List<AFValue> afVals = new List<AFValue>();
			foreach (WAFValue wafVal in wafVals)
			{
				AFValue afVal = m_Pipt.RecordedValue(new AFTime(wafVal.Timestamp), AFRetrievalMode.Exact);
				afVals.Add(afVal);
			}

			AFUpdateOption opt =  (AFUpdateOption)Enum.ToObject(typeof(AFUpdateOption), (byte)UpdateOption);

			AFErrors<AFValue> errs = m_Pipt.UpdateValues(afVals, opt, AFBufferOption.Buffer);

			WAFErrors retVal = new WAFErrors(errs);
			return (retVal);
		}
Beispiel #2
0
		public void RecordedValues(WAFTime start, WAFTime end, WAFBoundryType boundryType, string filterExp, bool includeFiltVals, int maxCount, ref WAFValue[] output)
		{
			List<WAFValue> retVals = null;

			try
			{
				AFTimeRange range = new AFTimeRange(start.ToString(), end.ToString());
				AFBoundaryType opt = (AFBoundaryType)Enum.ToObject(typeof(AFBoundaryType), (byte)boundryType);

				AFValues vals = m_Pipt.RecordedValues(range, AFBoundaryType.Interpolated, filterExp, includeFiltVals, maxCount);

				retVals = vals.ConvertAll(new Converter<AFValue, WAFValue>(WAFValue.AFValueToWAFValue));
			}
			catch (Exception ex)
			{
				System.Console.WriteLine(ex.Message);
			}

			output = retVals.ToArray();
			return;
		}
Beispiel #3
0
		public WAFValue Snapshot()
		{
			try
			{
				AFValue val = m_Pipt.Snapshot();
				WAFValue wVal = new WAFValue();
				wVal.setAFValue(val);

				return (wVal);
			}
			catch (Exception)
			{
				return (null);
			}
		}
Beispiel #4
0
		public void InterpolatedValues(WAFTime start, WAFTime end, string interval, string filterExp, bool includeFiltVals, ref WAFValue[] values)
		{
			List<WAFValue> retVals = null;

			try
			{
				AFTimeRange range = new AFTimeRange(start.ToString(), end.ToString());
				
				AFTimeSpan span = new AFTimeSpan();
				if (!AFTimeSpan.TryParse(interval, out span))
				{
					span = AFTimeSpan.Parse("1h");
				}

				AFValues vals = m_Pipt.InterpolatedValues(range, span, filterExp, includeFiltVals);

				retVals = vals.ConvertAll(new Converter<AFValue, WAFValue>(WAFValue.AFValueToWAFValue));
			}
			catch (Exception ex)
			{
				
				System.Console.WriteLine(ex.Message);
			}

			values = retVals.ToArray();
			return;
		}
Beispiel #5
0
		public static WAFValue AFValueToWAFValue(AFValue val)
		{
			WAFValue cVal = new WAFValue();

			try
			{
				cVal.setAFValue(val);
			}
			catch (Exception ex)
			{
				System.Console.WriteLine(ex.Message);
				cVal = null;
			}

			return (cVal);
		}