360 lines
12 KiB
C#
360 lines
12 KiB
C#
|
|
using System;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using System.Text;
|
|||
|
|
using DTS.DASLib.Command.SLICE;
|
|||
|
|
|
|||
|
|
namespace DTS.Slice.Service
|
|||
|
|
{
|
|||
|
|
public class EventAttribute : Attribute
|
|||
|
|
{
|
|||
|
|
// public enum TypeValues
|
|||
|
|
// {
|
|||
|
|
// EventNumber = 0x01, EventName, EventDescription, SampleRate,
|
|||
|
|
// TotalSamples, TriggerSampleNumber, StartRecordSampleNumber,
|
|||
|
|
// EventTime, FilterFrequency, TotalChannels, PreScaleFactors, PostScaleFactors, Offsets,
|
|||
|
|
// Excitation, ConfigAttributes
|
|||
|
|
// }
|
|||
|
|
|
|||
|
|
// public UInt16 EventNumber
|
|||
|
|
// {
|
|||
|
|
// get { return _storenumber; }
|
|||
|
|
// set { _storenumber = value; }
|
|||
|
|
// }
|
|||
|
|
|
|||
|
|
// public EventAttribute()
|
|||
|
|
// : base()
|
|||
|
|
// {
|
|||
|
|
// _store = AttributeStore.Event;
|
|||
|
|
// }
|
|||
|
|
//}
|
|||
|
|
|
|||
|
|
//public class EventNumber: EventAttribute
|
|||
|
|
//{
|
|||
|
|
// public UInt32 Value
|
|||
|
|
// {
|
|||
|
|
// get
|
|||
|
|
// {
|
|||
|
|
// UInt32 tmp;
|
|||
|
|
// ByteConvertor.Convert (Data, 0, out tmp);
|
|||
|
|
// return tmp;
|
|||
|
|
// }
|
|||
|
|
// set { Data = ByteConvertor.ToByteArray (value); }
|
|||
|
|
// }
|
|||
|
|
|
|||
|
|
// public EventNumber ()
|
|||
|
|
// : base()
|
|||
|
|
// {
|
|||
|
|
// _description = "EventNumber";
|
|||
|
|
// _typevalue = (byte)TypeValues.EventNumber;
|
|||
|
|
// _datatype = AttributeTypes.AttributeDataTypes.UInt16;
|
|||
|
|
// }
|
|||
|
|
|
|||
|
|
//}
|
|||
|
|
|
|||
|
|
//public class EventName : EventAttribute
|
|||
|
|
//{
|
|||
|
|
// public string Value
|
|||
|
|
// {
|
|||
|
|
// get
|
|||
|
|
// {
|
|||
|
|
// string tmp;
|
|||
|
|
// ByteConvertor.Convert(Data, 0, out tmp);
|
|||
|
|
// return tmp;
|
|||
|
|
// }
|
|||
|
|
// set { Data = ByteConvertor.ToByteArray(value); }
|
|||
|
|
// }
|
|||
|
|
|
|||
|
|
// public EventName()
|
|||
|
|
// : base()
|
|||
|
|
// {
|
|||
|
|
// _description = "EventName";
|
|||
|
|
// _typevalue = (byte)TypeValues.EventName;
|
|||
|
|
// _datatype = QueryArmAttribute.AttributeDataTypes.Ascii;
|
|||
|
|
// }
|
|||
|
|
//}
|
|||
|
|
|
|||
|
|
//public class EventSampleRate : EventAttribute
|
|||
|
|
//{
|
|||
|
|
// public UInt32 Value
|
|||
|
|
// {
|
|||
|
|
// get
|
|||
|
|
// {
|
|||
|
|
// UInt32 tmp;
|
|||
|
|
// ByteConvertor.Convert(Data, 0, out tmp);
|
|||
|
|
// return tmp;
|
|||
|
|
// }
|
|||
|
|
// set { Data = ByteConvertor.ToByteArray(value); }
|
|||
|
|
// }
|
|||
|
|
|
|||
|
|
// public EventSampleRate()
|
|||
|
|
// : base()
|
|||
|
|
// {
|
|||
|
|
// _description = "EventSampleRate";
|
|||
|
|
// _typevalue = (byte)TypeValues.SampleRate;
|
|||
|
|
// _datatype = QueryArmAttribute.AttributeDataTypes.UInt32;
|
|||
|
|
// }
|
|||
|
|
//}
|
|||
|
|
|
|||
|
|
//public class EventDescription : EventAttribute
|
|||
|
|
//{
|
|||
|
|
// public string Value
|
|||
|
|
// {
|
|||
|
|
// get
|
|||
|
|
// {
|
|||
|
|
// string tmp;
|
|||
|
|
// ByteConvertor.Convert(Data, 0, out tmp);
|
|||
|
|
// return tmp;
|
|||
|
|
// }
|
|||
|
|
// set { Data = ByteConvertor.ToByteArray(value); }
|
|||
|
|
// }
|
|||
|
|
|
|||
|
|
// public EventDescription()
|
|||
|
|
// : base()
|
|||
|
|
// {
|
|||
|
|
// _description = "EventDescription";
|
|||
|
|
// _typevalue = (byte)TypeValues.EventDescription;
|
|||
|
|
// _datatype = QueryArmAttribute.AttributeDataTypes.Ascii;
|
|||
|
|
// }
|
|||
|
|
//}
|
|||
|
|
|
|||
|
|
//public class EventTotalSamples: EventAttribute
|
|||
|
|
//{
|
|||
|
|
// public UInt64 Value
|
|||
|
|
// {
|
|||
|
|
// get
|
|||
|
|
// {
|
|||
|
|
// UInt64 tmp;
|
|||
|
|
// ByteConvertor.Convert(Data, 0, out tmp);
|
|||
|
|
// return tmp;
|
|||
|
|
// }
|
|||
|
|
// set { Data = ByteConvertor.ToByteArray(value); }
|
|||
|
|
// }
|
|||
|
|
|
|||
|
|
// public EventTotalSamples()
|
|||
|
|
// : base()
|
|||
|
|
// {
|
|||
|
|
// _description = "EventTotalSamples";
|
|||
|
|
// _typevalue = (byte)TypeValues.TotalSamples;
|
|||
|
|
// _datatype = QueryArmAttribute.AttributeDataTypes.UInt64;
|
|||
|
|
// }
|
|||
|
|
//}
|
|||
|
|
|
|||
|
|
//public class EventTriggerSampleNumber: EventAttribute
|
|||
|
|
//{
|
|||
|
|
// public UInt64 Value
|
|||
|
|
// {
|
|||
|
|
// get
|
|||
|
|
// {
|
|||
|
|
// UInt64 tmp;
|
|||
|
|
// ByteConvertor.Convert(Data, 0, out tmp);
|
|||
|
|
// return tmp;
|
|||
|
|
// }
|
|||
|
|
// set { Data = ByteConvertor.ToByteArray(value); }
|
|||
|
|
// }
|
|||
|
|
|
|||
|
|
// public EventTriggerSampleNumber()
|
|||
|
|
// : base()
|
|||
|
|
// {
|
|||
|
|
// _description = "EventTriggerSampleNumber";
|
|||
|
|
// _typevalue = (byte)TypeValues.TriggerSampleNumber;
|
|||
|
|
// _datatype = QueryArmAttribute.AttributeDataTypes.UInt64;
|
|||
|
|
// }
|
|||
|
|
//}
|
|||
|
|
|
|||
|
|
//public class EventStartRecordSampleNumber: EventAttribute
|
|||
|
|
//{
|
|||
|
|
// public UInt64 Value
|
|||
|
|
// {
|
|||
|
|
// get
|
|||
|
|
// {
|
|||
|
|
// UInt64 tmp;
|
|||
|
|
// ByteConvertor.Convert(Data, 0, out tmp);
|
|||
|
|
// return tmp;
|
|||
|
|
// }
|
|||
|
|
// set { Data = ByteConvertor.ToByteArray(value); }
|
|||
|
|
// }
|
|||
|
|
|
|||
|
|
// public EventStartRecordSampleNumber()
|
|||
|
|
// : base()
|
|||
|
|
// {
|
|||
|
|
// _description = "EventStartRecordSampleNumber";
|
|||
|
|
// _typevalue = (byte)TypeValues.StartRecordSampleNumber;
|
|||
|
|
// _datatype = QueryArmAttribute.AttributeDataTypes.UInt64;
|
|||
|
|
// }
|
|||
|
|
//}
|
|||
|
|
|
|||
|
|
//public class EventTotalChannels: EventAttribute
|
|||
|
|
//{
|
|||
|
|
// public byte Value
|
|||
|
|
// {
|
|||
|
|
// get
|
|||
|
|
// {
|
|||
|
|
// byte tmp;
|
|||
|
|
// ByteConvertor.Convert(Data, 0, out tmp);
|
|||
|
|
// return tmp;
|
|||
|
|
// }
|
|||
|
|
// set { Data = ByteConvertor.ToByteArray(value); }
|
|||
|
|
// }
|
|||
|
|
|
|||
|
|
// public EventTotalChannels()
|
|||
|
|
// : base()
|
|||
|
|
// {
|
|||
|
|
// _description = "EventTotalChannels";
|
|||
|
|
// _typevalue = (byte)TypeValues.TotalChannels;
|
|||
|
|
// _datatype = QueryArmAttribute.AttributeDataTypes.UInt8;
|
|||
|
|
// }
|
|||
|
|
//}
|
|||
|
|
|
|||
|
|
//public class EventFilterFrequency: EventAttribute
|
|||
|
|
//{
|
|||
|
|
// public double Value
|
|||
|
|
// {
|
|||
|
|
// get
|
|||
|
|
// {
|
|||
|
|
// double tmp;
|
|||
|
|
// ByteConvertor.Convert(Data, 0, out tmp);
|
|||
|
|
// return tmp;
|
|||
|
|
// }
|
|||
|
|
// set { Data = ByteConvertor.ToByteArray(value); }
|
|||
|
|
// }
|
|||
|
|
|
|||
|
|
// public EventFilterFrequency()
|
|||
|
|
// : base()
|
|||
|
|
// {
|
|||
|
|
// _description = "EventFilterFrequency";
|
|||
|
|
// _typevalue = (byte)TypeValues.FilterFrequency;
|
|||
|
|
// _datatype = QueryArmAttribute.AttributeDataTypes.Float64;
|
|||
|
|
// }
|
|||
|
|
//}
|
|||
|
|
|
|||
|
|
//public class EventStartTime: EventAttribute
|
|||
|
|
//{
|
|||
|
|
// public DateTime Value
|
|||
|
|
// {
|
|||
|
|
// // the time stamp will be returned as 2 numbers
|
|||
|
|
// // one UInt32 for seconds since 1970 00:00 UTC
|
|||
|
|
// // and one UInt32 for milliseconds
|
|||
|
|
// get
|
|||
|
|
// {
|
|||
|
|
// UInt32 seconds;
|
|||
|
|
// ByteConvertor.Convert(Data, 0, out seconds);
|
|||
|
|
// UInt32 fractions;
|
|||
|
|
// ByteConvertor.Convert(Data, 4, out fractions);
|
|||
|
|
// DateTime eventTime = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
|||
|
|
// eventTime.AddSeconds((double)seconds + ((double)fractions / 1000.0));
|
|||
|
|
// return eventTime;
|
|||
|
|
// }
|
|||
|
|
// set
|
|||
|
|
// {
|
|||
|
|
// DateTime baseTime = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
|||
|
|
// TimeSpan leftOver = value.Subtract(baseTime);
|
|||
|
|
// UInt32 seconds = (UInt32)leftOver.TotalSeconds;
|
|||
|
|
// UInt32 fractions = (UInt32)(leftOver.TotalSeconds - (double)seconds);
|
|||
|
|
// byte[] first = ByteConvertor.ToByteArray(seconds);
|
|||
|
|
// byte[] second = ByteConvertor.ToByteArray(fractions);
|
|||
|
|
// Data = new byte[first.Length + second.Length];
|
|||
|
|
// Array.Copy(first, Data, first.Length);
|
|||
|
|
// Array.Copy(second, 0, Data, first.Length, second.Length);
|
|||
|
|
// }
|
|||
|
|
// }
|
|||
|
|
|
|||
|
|
// public EventStartTime()
|
|||
|
|
// : base()
|
|||
|
|
// {
|
|||
|
|
// _description = "EventStartTime";
|
|||
|
|
// _typevalue = (byte)TypeValues.EventTime;
|
|||
|
|
// _datatype = QueryArmAttribute.AttributeDataTypes.UInt32Star;
|
|||
|
|
// }
|
|||
|
|
//}
|
|||
|
|
|
|||
|
|
//public class EventExcitation: EventAttribute
|
|||
|
|
//{
|
|||
|
|
// public double Value
|
|||
|
|
// {
|
|||
|
|
// get
|
|||
|
|
// {
|
|||
|
|
// double tmp;
|
|||
|
|
// ByteConvertor.Convert(Data, 0, out tmp);
|
|||
|
|
// return tmp;
|
|||
|
|
// }
|
|||
|
|
// set { Data = ByteConvertor.ToByteArray(value); }
|
|||
|
|
// }
|
|||
|
|
|
|||
|
|
// public EventExcitation()
|
|||
|
|
// : base()
|
|||
|
|
// {
|
|||
|
|
// _description = "EventExcitation";
|
|||
|
|
// _typevalue = (byte)TypeValues.Excitation;
|
|||
|
|
// _datatype = QueryArmAttribute.AttributeDataTypes.Float64;
|
|||
|
|
// }
|
|||
|
|
//}
|
|||
|
|
|
|||
|
|
//public class PreEventScaleFactors: EventAttribute
|
|||
|
|
//{
|
|||
|
|
// public Dictionary<byte, double> Value
|
|||
|
|
// {
|
|||
|
|
// get
|
|||
|
|
// {
|
|||
|
|
// return ByteArrayToDict(Data);
|
|||
|
|
// }
|
|||
|
|
// set
|
|||
|
|
// {
|
|||
|
|
// Data = DictToByteArray(value);
|
|||
|
|
// }
|
|||
|
|
// }
|
|||
|
|
|
|||
|
|
// public PreEventScaleFactors()
|
|||
|
|
// : base()
|
|||
|
|
// {
|
|||
|
|
// _description = "PreEventScaleFactors";
|
|||
|
|
// _typevalue = (byte)TypeValues.PreScaleFactors;
|
|||
|
|
// _datatype = QueryArmAttribute.AttributeDataTypes.DoubleDict;
|
|||
|
|
// }
|
|||
|
|
//}
|
|||
|
|
|
|||
|
|
//public class PostEventScaleFactors: EventAttribute
|
|||
|
|
//{
|
|||
|
|
// public Dictionary<byte, double> Value
|
|||
|
|
// {
|
|||
|
|
// get
|
|||
|
|
// {
|
|||
|
|
// return ByteArrayToDict(Data);
|
|||
|
|
// }
|
|||
|
|
// set
|
|||
|
|
// {
|
|||
|
|
// Data = DictToByteArray(value);
|
|||
|
|
// }
|
|||
|
|
// }
|
|||
|
|
|
|||
|
|
// public PostEventScaleFactors()
|
|||
|
|
// : base()
|
|||
|
|
// {
|
|||
|
|
// _description = "PostEventScaleFactors";
|
|||
|
|
// _typevalue = (byte)TypeValues.PostScaleFactors;
|
|||
|
|
// _datatype = QueryArmAttribute.AttributeDataTypes.DoubleDict;
|
|||
|
|
// }
|
|||
|
|
//}
|
|||
|
|
|
|||
|
|
//public class EventConfigAttributes: EventAttribute
|
|||
|
|
//{
|
|||
|
|
// public string Value
|
|||
|
|
// {
|
|||
|
|
// get
|
|||
|
|
// {
|
|||
|
|
// string tmp;
|
|||
|
|
// ByteConvertor.Convert(Data, 0, out tmp);
|
|||
|
|
// return tmp;
|
|||
|
|
// }
|
|||
|
|
// set { Data = ByteConvertor.ToByteArray(value); }
|
|||
|
|
// }
|
|||
|
|
|
|||
|
|
// public EventConfigAttributes()
|
|||
|
|
// : base()
|
|||
|
|
// {
|
|||
|
|
// _description = "EventConfigAttributes";
|
|||
|
|
// _typevalue = (byte)TypeValues.ConfigAttributes;
|
|||
|
|
// _datatype = QueryArmAttribute.AttributeDataTypes.Ascii;
|
|||
|
|
// }
|
|||
|
|
}
|
|||
|
|
}
|