This commit is contained in:
2026-04-17 14:55:32 -04:00
commit bc3ac1d4c9
18017 changed files with 4371742 additions and 0 deletions

View File

@@ -0,0 +1,71 @@
using System;
using System.Collections.Generic;
using System.Text;
using DTS.Common.Utils;
using DTS.DASLib.Command.SLICE;
namespace DTS.Slice.Service
{
public class Attribute
{
protected enum AttributeInterface { Arm, Event, System, User }
protected AttributeInterface Store { get; set; }
protected AttributeTypes.AttributeDataTypes datatype;
protected ushort key;
protected object value;
public const int MaxSingleAttributeSize = 500;
public const int BulkAttributeStartNumber = 3000;
//public AttributeStore Store { get { return _store; } }
//public UInt16 StoreNumber { get { return _storenumber; } set { _storenumber = value; } }
//public UInt16 Location { get { return _location; } set { _location = value; } }
//public AttributeTypes.AttributeDataTypes DataType { get { return _datatype; } }
//public string Description { get { return _description; } }
//public byte TypeValue { get { return _typevalue; } }
//protected byte[] Data { get { return _data; } set { _data = value; } }
//public int Length { get { if (null == _data) return 0; else return _data.Length; } }
protected Dictionary<byte, double> ByteArrayToDict(byte[] bytes)
{
// The dictionary will be transported as
// pairs consisting of one byte + 8 bytes for the double
byte k;
double val;
const int PairLength = sizeof(byte) + sizeof(double);
int NumberOfPairs = bytes.Length / PairLength;
int offset = 0;
var dict = new Dictionary<byte, double>(NumberOfPairs);
for (int idx = 0; idx < NumberOfPairs; idx++)
{
ByteConvertor.Convert(bytes, offset, out k);
offset += sizeof(byte);
ByteConvertor.Convert(bytes, offset, out val);
offset += sizeof(double);
dict.Add(k, val);
}
return dict;
}
protected byte[] DictToByteArray(Dictionary<byte, double> dict)
{
var NumberOfPairs = dict.Count;
var byteArray = new byte[(sizeof(byte) + sizeof(double)) * NumberOfPairs];
int offset = 0;
foreach (var pair in dict)
{
byteArray[offset] = pair.Key;
offset += sizeof(byte);
Array.Copy(ByteConvertor.ToByteArray(pair.Value), 0, byteArray, offset, sizeof(double));
offset += sizeof(double);
}
return byteArray;
}
protected Attribute()
{
}
}
}

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<ClassDiagram MajorVersion="1" MinorVersion="1">
<Class Name="DTS.Slice.Service.Attribute" Collapsed="true">
<Position X="1.75" Y="0.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AIAAAAAIAAAAAAAAIAAEAIAAAAAAACAAAAAAIQAAAAA=</HashCode>
<FileName>Attribute.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="DTS.Slice.Service.EventAttribute" Collapsed="true">
<Position X="2.75" Y="1.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>EventAttribute.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="DTS.Slice.Service.SystemAttribute" Collapsed="true">
<Position X="0.5" Y="1.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>SystemAttribute.cs</FileName>
</TypeIdentifier>
</Class>
<Font Name="Segoe UI" Size="9" />
</ClassDiagram>

View File

@@ -0,0 +1,359 @@
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;
// }
}
}

View File

@@ -0,0 +1,35 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("SLICE Service")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SLICE Service")]
[assembly: AssemblyCopyright("Copyright © 2008")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("f4f93524-9676-4060-8024-0f4c818cd154")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.06.0081")]
[assembly: AssemblyFileVersion("1.06.0081")]

View File

@@ -0,0 +1,132 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{6583CDE9-5662-41B1-80CA-4300E562DE3D}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DTS.Slice.Service</RootNamespace>
<AssemblyName>SLICE Service</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
<TargetFrameworkProfile />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<SccProjectName>
</SccProjectName>
<SccLocalPath>
</SccLocalPath>
<SccAuxPath>
</SccAuxPath>
<SccProvider>
</SccProvider>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Attribute.cs" />
<Compile Include="EventAttribute.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SystemAttribute.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Common\DTS.Common\DTS.Common.csproj">
<Project>{f7a0804f-61a4-40ae-83d0-f1137622b592}</Project>
<Name>DTS.Common</Name>
</ProjectReference>
<ProjectReference Include="..\..\SLICECommands\SLICECommands.csproj">
<Project>{D015F93D-9507-4484-977B-4CF1BDC0B30E}</Project>
<Name>SLICECommands</Name>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<None Include="Design\SliceServiceClassDiagram.cd" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -0,0 +1,67 @@
using System;
using System.Collections.Generic;
using System.Text;
using DTS.DASLib.Command.SLICE;
namespace DTS.Slice.Service
{
public class SystemAttribute : Attribute
{
// public enum TypeValues
// {
// SerialNumber = 0x00, SliceType, FlashTechnology, FlashSizeInBytes,
// FlashSerialNumber, MaximumSampleRate, TemperatureScaleFactor,
// TemperatureOffset, TotalEventsStored,
// }
// public SystemAttribute()
// : base()
// {
// _store = AttributeStore.System;
// }
//}
//public class SerialNumberAttribute : SystemAttribute
//{
// public string Value
// {
// get
// {
// string tmp;
// ByteConvertor.Convert(Data, 0, out tmp);
// return tmp;
// }
// set { Data = ByteConvertor.ToByteArray(value); }
// }
// public SerialNumberAttribute()
// : base()
// {
// _description = "SerialNumberAttribute";
// _typevalue = (byte)TypeValues.SerialNumber;
// _datatype = AttributeTypes.AttributeDataTypes.Ascii;
// }
//}
//public class TotalEventsStoredAttribute : SystemAttribute
//{
// public UInt16 Value
// {
// get
// {
// UInt16 tmp;
// ByteConvertor.Convert(Data, 0, out tmp);
// return tmp;
// }
// set { Data = ByteConvertor.ToByteArray(value); }
// }
// public TotalEventsStoredAttribute()
// : base()
// {
// _description = "TotalEventsStoredAttribute";
// _typevalue = (byte)TypeValues.TotalEventsStored;
// _datatype = AttributeTypes.AttributeDataTypes.UInt16;
// }
}
}

View File

@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = "")]

View File

@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]