Commit 4c2d587b authored by 潘栩锋's avatar 潘栩锋 🚴

重新添加FLY.Thick.BulkData

parent 4865a4ad
using FObjBase;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
/// <summary>
/// 公共类型
/// </summary>
namespace FLY.Thick.BulkDataModule
{
/// <summary>
/// 一幅数据是否有效
/// </summary>
public enum FR_DATA_TYPE
{
/// <summary>
/// 无效
/// </summary>
INVALID = 0,
/// <summary>
/// 有效
/// </summary>
VALID = 1
}
/// <summary>
///
/// </summary>
public class FR_DATA : IPack2
{
public FR_DATA_TYPE type;
public int bookmark;// bookmark ID
public DateTime timemark;
public int[] m_data;
public override string ToString()
{
return bookmark.ToString();
}
public FR_DATA(int bm, int[] data, FR_DATA_TYPE type)
{
bookmark = bm;
timemark = DateTime.Now;
m_data = (int[])data.Clone();
this.type = type;
}
public FR_DATA()
{
}
public bool TryParse(byte[] value, int index, out int cnt)
{
cnt = 4 + 8 + 4;
if (index + cnt > value.Length)
return false;
int idx = index;
bookmark = BitConverter.ToInt32(value, idx);
idx += 4;
try
{
timemark = new DateTime(BitConverter.ToInt64(value, idx));
}
catch
{
timemark = DateTime.MinValue;
}
idx += 8;
type = (FR_DATA_TYPE)BitConverter.ToInt32(value, idx);
idx += 4;
//data
cnt += 4;
if (index + cnt > value.Length)
return false;
int len = BitConverter.ToInt32(value, idx);
idx += 4;
cnt += len * 4;
if (index + cnt > value.Length)
return false;
if (len > 0)
{
m_data = new int[len];
for (int i = 0; i < len; i++)
{
m_data[i] = BitConverter.ToInt32(value, idx);
idx += 4;
}
}
return true;
}
public byte[] ToBytes()
{
List<byte> buf = new List<byte>();
buf.AddRange(BitConverter.GetBytes(bookmark));
buf.AddRange(BitConverter.GetBytes(timemark.Ticks));
buf.AddRange(BitConverter.GetBytes((int)type));
if (m_data == null)
{
buf.AddRange(BitConverter.GetBytes(0));
}
else
{
buf.AddRange(BitConverter.GetBytes(m_data.Length));
for (int i = 0; i < m_data.Length; i++)
{
buf.AddRange(BitConverter.GetBytes(m_data[i]));
}
}
return buf.ToArray();
}
public bool TryParse(byte[] value)
{
int cnt;
return TryParse(value, 0, out cnt);
}
}
/// <summary>
/// 它是 struct, 值类型,所以不用 Clone!!!!!
/// </summary>
public struct TrendDataCell
{
/// <summary>
/// 时间
/// </summary>
public DateTime Time;
/// <summary>
/// 平均值
/// </summary>
public int Avg;
/// <summary>
/// sigma
/// </summary>
public int Sigma;
/// <summary>
/// 类型
/// </summary>
public FR_DATA_TYPE Type;
/// <summary>
///
/// </summary>
/// <returns></returns>
public override string ToString()
{
return Time.ToShortTimeString() + " " + Avg.ToString();
}
#region IPack 成员
/// <summary>
/// 输出20个字节
/// </summary>
/// <returns></returns>
public byte[] ToBytes()
{
List<byte> buf = new List<byte>();
buf.AddRange(BitConverter.GetBytes(Time.Ticks));
buf.AddRange(BitConverter.GetBytes(Avg));
buf.AddRange(BitConverter.GetBytes(Sigma));
buf.AddRange(BitConverter.GetBytes((int)Type));
return buf.ToArray();
}
/// <summary>
/// 使用20个字节转换
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public bool TryParse(byte[] value, int startIndex )
{
int count = 8 + 4 * 3;
if (value.Length < count)
return false;
int idx = startIndex;
Time = new DateTime(BitConverter.ToInt64(value, idx));
idx += 8;
Avg = BitConverter.ToInt32(value, idx);
idx += 4;
Sigma = BitConverter.ToInt32(value, idx);
idx += 4;
Type = (FR_DATA_TYPE)BitConverter.ToInt32(value, idx);
idx += 4;
return true;
}
public TrendDataCell Clone()
{
return new TrendDataCell()
{
Time = Time,
Avg = Avg,
Sigma = Sigma,
Type = Type
};
}
#endregion
}
/// <summary>
/// 获取模式
/// </summary>
public enum PushMode
{
/// <summary>
/// 获取并且推送
/// </summary>
GetAndPush,
/// <summary>
/// 只获取
/// </summary>
Get
}
/// <summary>
/// 它是 struct, 值类型,所以不用 Clone!!!!!
/// </summary>
public struct FrameDataCell
{
/// <summary>
/// 平均值
/// </summary>
public int Avg;
/// <summary>
/// sigma
/// </summary>
public int Sigma;
/// <summary>
///
/// </summary>
/// <returns></returns>
public override string ToString()
{
return Avg.ToString();
}
#region IPack 成员
/// <summary>
/// 输出20个字节
/// </summary>
/// <returns></returns>
public byte[] ToBytes()
{
List<byte> buf = new List<byte>();
buf.AddRange(BitConverter.GetBytes(Avg));
buf.AddRange(BitConverter.GetBytes(Sigma));
return buf.ToArray();
}
/// <summary>
/// 使用8个字节转换
/// </summary>
/// <param name="value"></param>
/// <param name="startIndex"></param>
/// <returns></returns>
public bool TryParse(byte[] value, int startIndex)
{
int count = 4 * 2;
if (value.Length < count)
return false;
int idx = startIndex;
Avg = BitConverter.ToInt32(value, idx);
idx += 4;
Sigma = BitConverter.ToInt32(value, idx);
idx += 4;
return true;
}
/// <summary>
/// 复制
/// </summary>
/// <returns></returns>
public FrameDataCell Clone()
{
return new FrameDataCell()
{
Avg = Avg,
Sigma = Sigma,
};
}
#endregion
}
}
<?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>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{2F88B5EC-85BC-4B5E-B254-06D2F2771F67}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>FLY.Thick.BulkDataModule</RootNamespace>
<AssemblyName>FLY.Thick.BulkDataModule</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Debug\FLY.Thick.BulkDataModule.XML</DocumentationFile>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Server\BulkDataService.cs" />
<Compile Include="Client\BulkDataServiceClient.cs" />
<Compile Include="Client\BulkDataServiceClientAdv.cs" />
<Compile Include="Server.OBJProxy\BulkDataService_OBJProxy.cs" />
<Compile Include="OBJ_INTERFACE\BULKDATA_OBJ_INTERFACE.cs" />
<Compile Include="Common\Common.cs" />
<Compile Include="IService\IBulkDataService.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Project.FLY.FObjSys\FObjSys\FObjBase.csproj">
<Project>{ABFE87D4-B692-4AE9-A8C0-1F470B8ACBB8}</Project>
<Name>FObjBase</Name>
</ProjectReference>
<ProjectReference Include="..\..\Project.FLY.Misc\MISC\Misc.csproj">
<Project>{5EE61AC6-5269-4F0F-B8FA-4334FE4A678F}</Project>
<Name>Misc</Name>
</ProjectReference>
</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>
\ No newline at end of file
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的常规信息通过以下
// 特性集控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("FLY.Thick.BulkDataModule")]
[assembly: AssemblyDescription("测厚仪.服务器.扫描数据缓存")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("佛山枫莱尔自动化技术有限公司")]
[assembly: AssemblyProduct("测厚仪")]
[assembly: AssemblyCopyright("Copyright © 2016 FLYAutomation")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 使此程序集中的类型
// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
// 则将该类型上的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("b9afccbb-da4a-4ac6-9fda-37f13bc0c54f")]
// 程序集的版本信息由下面四个值组成:
//
// 主版本
// 次版本
// 内部版本号
// 修订号
//
// 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.1.0.0")]
[assembly: AssemblyFileVersion("1.1.0.0")]

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FLY.Thick.BulkDataModule", "FLY.Thick.BulkData\FLY.Thick.BulkDataModule.csproj", "{2F88B5EC-85BC-4B5E-B254-06D2F2771F67}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FObjBase", "..\Project.FLY.FObjSys\FObjSys\FObjBase.csproj", "{ABFE87D4-B692-4AE9-A8C0-1F470B8ACBB8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Misc", "..\Project.FLY.Misc\MISC\Misc.csproj", "{5EE61AC6-5269-4F0F-B8FA-4334FE4A678F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WpfApplication1", "WpfApplication1\WpfApplication1.csproj", "{6830D176-D4E6-4FD7-A650-CB925139E6ED}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|Mixed Platforms = Debug|Mixed Platforms
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|Mixed Platforms = Release|Mixed Platforms
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{2F88B5EC-85BC-4B5E-B254-06D2F2771F67}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2F88B5EC-85BC-4B5E-B254-06D2F2771F67}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2F88B5EC-85BC-4B5E-B254-06D2F2771F67}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{2F88B5EC-85BC-4B5E-B254-06D2F2771F67}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{2F88B5EC-85BC-4B5E-B254-06D2F2771F67}.Debug|x86.ActiveCfg = Debug|Any CPU
{2F88B5EC-85BC-4B5E-B254-06D2F2771F67}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2F88B5EC-85BC-4B5E-B254-06D2F2771F67}.Release|Any CPU.Build.0 = Release|Any CPU
{2F88B5EC-85BC-4B5E-B254-06D2F2771F67}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{2F88B5EC-85BC-4B5E-B254-06D2F2771F67}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{2F88B5EC-85BC-4B5E-B254-06D2F2771F67}.Release|x86.ActiveCfg = Release|Any CPU
{ABFE87D4-B692-4AE9-A8C0-1F470B8ACBB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ABFE87D4-B692-4AE9-A8C0-1F470B8ACBB8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ABFE87D4-B692-4AE9-A8C0-1F470B8ACBB8}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{ABFE87D4-B692-4AE9-A8C0-1F470B8ACBB8}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{ABFE87D4-B692-4AE9-A8C0-1F470B8ACBB8}.Debug|x86.ActiveCfg = Debug|Any CPU
{ABFE87D4-B692-4AE9-A8C0-1F470B8ACBB8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ABFE87D4-B692-4AE9-A8C0-1F470B8ACBB8}.Release|Any CPU.Build.0 = Release|Any CPU
{ABFE87D4-B692-4AE9-A8C0-1F470B8ACBB8}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{ABFE87D4-B692-4AE9-A8C0-1F470B8ACBB8}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{ABFE87D4-B692-4AE9-A8C0-1F470B8ACBB8}.Release|x86.ActiveCfg = Release|Any CPU
{5EE61AC6-5269-4F0F-B8FA-4334FE4A678F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5EE61AC6-5269-4F0F-B8FA-4334FE4A678F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5EE61AC6-5269-4F0F-B8FA-4334FE4A678F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{5EE61AC6-5269-4F0F-B8FA-4334FE4A678F}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{5EE61AC6-5269-4F0F-B8FA-4334FE4A678F}.Debug|x86.ActiveCfg = Debug|Any CPU
{5EE61AC6-5269-4F0F-B8FA-4334FE4A678F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5EE61AC6-5269-4F0F-B8FA-4334FE4A678F}.Release|Any CPU.Build.0 = Release|Any CPU
{5EE61AC6-5269-4F0F-B8FA-4334FE4A678F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{5EE61AC6-5269-4F0F-B8FA-4334FE4A678F}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{5EE61AC6-5269-4F0F-B8FA-4334FE4A678F}.Release|x86.ActiveCfg = Release|Any CPU
{6830D176-D4E6-4FD7-A650-CB925139E6ED}.Debug|Any CPU.ActiveCfg = Debug|x86
{6830D176-D4E6-4FD7-A650-CB925139E6ED}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{6830D176-D4E6-4FD7-A650-CB925139E6ED}.Debug|Mixed Platforms.Build.0 = Debug|x86
{6830D176-D4E6-4FD7-A650-CB925139E6ED}.Debug|x86.ActiveCfg = Debug|x86
{6830D176-D4E6-4FD7-A650-CB925139E6ED}.Debug|x86.Build.0 = Debug|x86
{6830D176-D4E6-4FD7-A650-CB925139E6ED}.Release|Any CPU.ActiveCfg = Release|x86
{6830D176-D4E6-4FD7-A650-CB925139E6ED}.Release|Mixed Platforms.ActiveCfg = Release|x86
{6830D176-D4E6-4FD7-A650-CB925139E6ED}.Release|Mixed Platforms.Build.0 = Release|x86
{6830D176-D4E6-4FD7-A650-CB925139E6ED}.Release|x86.ActiveCfg = Release|x86
{6830D176-D4E6-4FD7-A650-CB925139E6ED}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
****************************************************************************************************
产品版本:Project.FLY.Thick.BulkData_v1.2.0_20180722
****************************************************************************************************
1.增强 多了FrameMix 推送,也就是扫描图的混合图除了平均值还有每个位置的sigma(07-22)
****************************************************************************************************
产品版本:Project.FLY.Thick.BulkData_v1.1.0_20171009
****************************************************************************************************
1.修复 负数的bookmark 没法推送(10-09)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment