Commit ec92c930 authored by 潘栩锋's avatar 潘栩锋 🚴

desp attribute 支持

parent c48ddd92
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\PropertyChanged.Fody.2.5.13\build\PropertyChanged.Fody.props" Condition="Exists('..\packages\PropertyChanged.Fody.2.5.13\build\PropertyChanged.Fody.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{28E4C2E0-5901-4B9A-9BF9-5D43E0102AC8}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Autogen_WS</RootNamespace>
<AssemblyName>Autogen_WS</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<ItemGroup>
<Reference Include="EPPlus, Version=4.5.2.1, Culture=neutral, PublicKeyToken=ea159fdaa78159a1, processorArchitecture=MSIL">
<HintPath>..\packages\EPPlus.4.5.2.1\lib\net40\EPPlus.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="MISC">
<HintPath>..\..\dll\MISC.dll</HintPath>
</Reference>
<Reference Include="PropertyChanged, Version=2.5.13.0, Culture=neutral, PublicKeyToken=ee3ee20bcf148ddd, processorArchitecture=MSIL">
<HintPath>..\packages\PropertyChanged.Fody.2.5.13\lib\net452\PropertyChanged.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.configuration" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Security" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Compile Include="DevMapperRule.cs" />
<Compile Include="WS_ItemInfo.cs" />
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="DataInfos.cs" />
<Compile Include="DeviceAddr.cs" />
<Compile Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Include="PLCGroup.cs" />
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="app.config" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<AppDesigner Include="Properties\" />
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Service References\" />
</ItemGroup>
<ItemGroup>
<Resource Include="FodyWeavers.xml" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\PropertyChanged.Fody.2.5.13\build\PropertyChanged.Fody.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\PropertyChanged.Fody.2.5.13\build\PropertyChanged.Fody.props'))" />
<Error Condition="!Exists('..\packages\Fody.3.2.16\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.3.2.16\build\Fody.targets'))" />
</Target>
<Import Project="..\packages\Fody.3.2.16\build\Fody.targets" Condition="Exists('..\packages\Fody.3.2.16\build\Fody.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
<!DOCTYPE html>
<!-- saved from url=(0014)about:internet -->
<html xmlns:msxsl="urn:schemas-microsoft-com:xslt"><head><meta content="en-us" http-equiv="Content-Language" /><meta content="text/html; charset=utf-16" http-equiv="Content-Type" /><title _locID="NuGetUpgradeReportTitle">
NuGetMigrationLog
</title><style>
/* Body style, for the entire document */
body
{
background: #F3F3F4;
color: #1E1E1F;
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
font-size: 12pt;
padding: 0;
margin: 0;
}
/* Header1 style, used for the main title */
h1
{
padding: 10px 0px 10px 10px;
font-size: 21pt;
background-color: #E2E2E2;
border-bottom: 1px #C1C1C2 solid;
color: #201F20;
margin: 0;
font-weight: normal;
}
/* Header2 style, used for "Overview" and other sections */
h2
{
font-size: 18pt;
font-weight: normal;
padding: 15px 0 5px 0;
margin: 0;
}
/* Header3 style, used for sub-sections, such as project name */
h3
{
font-weight: normal;
font-size: 15pt;
margin: 0;
padding: 15px 0 5px 0;
background-color: transparent;
}
.info-text
{
margin: 0px 0 0.75em 0;
}
/* Color all hyperlinks one color */
a
{
color: #1382CE;
}
/* Table styles */
table
{
border-spacing: 0 0;
border-collapse: collapse;
font-size: 11pt;
}
table th
{
background: #E7E7E8;
text-align: left;
text-decoration: none;
font-weight: normal;
padding: 3px 6px 3px 6px;
}
table td
{
vertical-align: top;
padding: 3px 6px 5px 5px;
margin: 0px;
border: 1px solid #E7E7E8;
background: #F7F7F8;
}
/* Local link is a style for hyperlinks that link to file:/// content, there are lots so color them as 'normal' text until the user mouse overs */
.localLink
{
color: #1E1E1F;
background: #EEEEED;
text-decoration: none;
}
.localLink:hover
{
color: #1382CE;
background: #FFFF99;
text-decoration: none;
}
.issueCell
{
width: 100%;
}
.packageIssue
{
margin-left: 25px;
}
/* Padding around the content after the h1 */
#content
{
padding: 0px 20px 20px 20px;
}
.issues table
{
width: 97%;
}
/* All Icons */
.IconSuccessEncoded, .IconInfoEncoded, .IconWarningEncoded, .IconErrorEncoded
{
min-width:18px;
min-height:18px;
background-repeat:no-repeat;
background-position:center;
}
.IconSuccessEncoded
{
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAA7EAAAOxAGVKw4bAAABcElEQVR4Xq2TsUsCURzHv15g8ZJcBWlyiYYgCIWcb9DFRRwMW5TA2c0/QEFwFkxxUQdxVlBwCYWOi6IhWgQhBLHJUCkhLr/BW8S7gvrAg+N+v8/v+x68Z8MGy+XSCyABQAXgBgHGALoASkIIDWSLeLBetdHryMjd5IxQPWT4rn1c/P7+xxp72Cs9m5SZ0Bq2vPnbPFafK2zDvmNHypdC0BPkLlQhxJsCAhQoZwdZU5mwxh720qGo8MzTxTTKZDPCx2HoVzp6lz0Q9tKhyx0kGs8Ny+TkWRKk8lCROwEduhyg9l/6lunOPSfmH3NUH6uQ0KHLAe7JYvJjevm+DAMGJHToKtigE+vwvIidxLamb8IBY9e+C5LiXREkfho3TSd06HJA13/oh6T51MTsfQbHrsMynQ5dDihFjiK8JJAU9AKIWTp76dCVN7HWHrajmUEGvyF9nkbAE6gLIS7kTUyuf2gscLoJrElZo/Mvj+nPz/kLTmfnEwP3tB0AAAAASUVORK5CYII=);
}
.IconInfoEncoded
{
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABHElEQVR4Xs2TsUoDQRRF7wwoziokjZUKadInhdhukR9YP8DMX1hYW+QvdsXa/QHBbcXC7W0CamWTQnclFutceIQJwwaWNLlwm5k5d94M76mmaeCrrmsLYOocY12FcxZFUeozCqKqqgYA8uevv1H6VuPxcwlfk5N92KHBxfFeCSAxxswlYAW/Xr989x/mv9gkhtyMDhcAxgzRsp7flj8B/HF1RsMXq+NZMkopaHe7lbKxQUEIGbKsYNoGn969060hZBkQex/W8oRQwsQaW2o3Ago2SVcJUzAgY3N0lTCZZm+zPS8HB51gMmS1DEYyOz9acKO1D8JWTlafKIMxdhvlfdyT94Vv5h7P8Ky7nQzACmhvKq3zk3PjW9asz9D/1oigecsioooAAAAASUVORK5CYII=);
}
.IconWarningEncoded
{
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAx0lEQVR4XpWSMQ7CMAxFf4xAyBMLCxMrO8dhaBcuwdCJS3RJBw7SA/QGTCxdWJgiQYWKXJWKIXHIlyw5lqr34tQgEOdcBsCOx5yZK3hCCKdYXneQkh4pEfqzLfu+wVDSyyzFoJjfz9NB+pAF+eizx2Vruts0k15mPgvS6GYvpVtQhB61IB/dk6AF6fS4Ben0uIX5odtFe8Q/eW1KvFeH4e8khT6+gm5B+t3juyDt7n0jpe+CANTd+oTUjN/U3yVaABnSUjFz/gFq44JaVSCXeQAAAABJRU5ErkJggg==);
}
.IconErrorEncoded
{
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABQElEQVR4XqWTvUoEQRCE6wYPZUA80AfwAQz23uCMjA7MDRQEIzPBVEyNTQUFIw00vcQTTMzuAh/AxEQQT8HF/3G/oGGnEUGuoNnd6qoZuqltyKEsyzVJq5I6rnUp6SjGeGhESikzzlc1eL7opfuVbrqbU1Zw9NCgtQMaZpY0eNnaaL2fHusvTK5vKu7sjSS1Y4y3QUA6K3e3Mau5UFDyMP7tYF9o8cAHZv68vipoIJg971PZIZ5HiwdvYGGvFVFHmGmZ2MxwmQYPXubPl9Up0tfoMQGetXd6mRbvhBw+boZ6WF7Mbv1+GsHRk0fQmPAH1GfmZirbCfDJ61tw3Px8/8pZsPAG4jlVhcPgZ7adwNWBB68lkRQWFiTgFlbnLY3DGGM7izIJIyT/jjIvEJw6fdJTc6krDzh6aMwMP9bvDH4ADSsa9uSWVJkAAAAASUVORK5CYII=);
}
</style></head><body><h1>
NuGet Migration Report - Autogen_WS</h1><div id="content"><h2 _locID="OverviewTitle">Overview</h2><div class="info-text">Migration to PackageReference was completed successfully. Please build and run your solution to verify that all packages are available.</div><div class="info-text">
If you run into any problems, have feedback, questions, or concerns, please
<a href="https://github.com/NuGet/Home/issues/">file an issue on the NuGet GitHub repository.</a></div><div class="info-text">
Changed files and this report have been backed up here:
<a href="D:\研发\fly\项目\xxxxxxxx_测厚仪程序\window\项目集.和美吹膜\hemei\Resource\收卷\收卷_辅助代码生成\Project.FLY.Autogen_WS\Autogen_WS\MigrationBackup\4573888c\Autogen_WS">D:\研发\fly\项目\xxxxxxxx_测厚仪程序\window\项目集.和美吹膜\hemei\Resource\收卷\收卷_辅助代码生成\Project.FLY.Autogen_WS\Autogen_WS\MigrationBackup\4573888c\Autogen_WS</a></div><div class="info-text"><a href="https://aka.ms/nuget-pc2pr-migrator-rollback">Help me rollback to packages.config</a></div><h2 _locID="PackagesTitle">Packages processed</h2><h3 _locID="IncludePackagesTitle">Top-level dependencies:</h3><div class="issues"><table><tr><th class="issueCell">Package Id</th><th>Version</th></tr><tr><td class="issueCell"><span>EPPlus</span></td><td><span>
v4.5.2.1</span></td></tr><tr><td class="issueCell"><span>Fody</span></td><td><span>
v3.2.16</span></td></tr><tr><td class="issueCell"><span>PropertyChanged.Fody</span></td><td><span>
v2.5.13</span></td></tr></table></div><p /><h3 _locID="IncludePackagesTitle">Transitive dependencies:</h3><div class="issues"><table><tr><th class="issueCell">Package Id</th><th>Version</th></tr><tr><td class="issueCell">
No transitive dependencies found.
</td><td /></tr></table></div><h2 _locID="IssuesTitle">Package compatibility issues</h2><div class="issues"><table><tr><th /><th class="issueCell" _locID="DescriptionTableHeader">Description</th></tr><tr><td class="IconInfoEncoded" /><td class="issueCell">
No issues were found.
</td></tr></table></div></div></body></html>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EPPlus" version="4.5.2.1" targetFramework="net461" />
<package id="Fody" version="3.2.16" targetFramework="net461" developmentDependency="true" />
<package id="PropertyChanged.Fody" version="2.5.13" targetFramework="net461" />
</packages>
\ No newline at end of file
$files=("Autogen_WS.exe","EPPlus.dll","MISC.dll")
foreach($f in $files)
{
cp -Recurse ($PSScriptRoot + "\\Project.FLY.Autogen_WS\Autogen_WS\Autogen_WS\bin\Debug\" + $f) $PSScriptRoot
}
echo Ƴɹ
pause
\ No newline at end of file
......@@ -12,122 +12,146 @@ namespace FLY.Weight.Common
/// <summary>
/// 总流量设定
/// </summary>
public float TotalFlowSetting { get; set; }
[Description("总流量设定")]
public float TotalFlowSetting{ get; set; }
/// <summary>
/// 总流量显示
/// </summary>
public float TotalFlow { get; set; }
[Description("总流量显示")]
public float TotalFlow{ get; set; }
/// <summary>
/// 总产量
/// </summary>
public float TotalProduction { get; set; }
[Description("总产量")]
public float TotalProduction{ get; set; }
/// <summary>
/// 码轮周长mm
/// </summary>
public float WheelPerimeter { get; set; }
[Description("码轮周长mm")]
public float WheelPerimeter{ get; set; }
/// <summary>
/// 码轮脉冲
/// </summary>
public float WheelPulse { get; set; }
[Description("码轮脉冲")]
public float WheelPulse{ get; set; }
/// <summary>
/// 平均密度
/// </summary>
public float Density { get; set; }
[Description("平均密度")]
public float Density{ get; set; }
/// <summary>
/// 边料不回收
/// </summary>
public bool IsRimNoRecycle { get; set; }
[Description("边料不回收")]
public bool IsRimNoRecycle{ get; set; }
/// <summary>
/// 边料kg/h
/// </summary>
public float RimCharge { get; set; }
[Description("边料kg/h")]
public float RimCharge{ get; set; }
/// <summary>
/// 厚度um
/// </summary>
public float Thickness { get; set; }
[Description("厚度um")]
public float Thickness{ get; set; }
/// <summary>
/// 当前线速度m/min
/// </summary>
public float CurrentVelocity { get; set; }
[Description("当前线速度m/min")]
public float CurrentVelocity{ get; set; }
/// <summary>
/// 当前线速度设置m/min
/// </summary>
public float CurrentVelocitySet { get; set; }
[Description("当前线速度设置m/min")]
public float CurrentVelocitySet{ get; set; }
/// <summary>
/// 吹膜宽度mm
/// </summary>
public float TotalFilmWidth { get; set; }
[Description("吹膜宽度mm")]
public float TotalFilmWidth{ get; set; }
/// <summary>
/// 切边mm
/// </summary>
public float RimWidth { get; set; }
[Description("切边mm")]
public float RimWidth{ get; set; }
/// <summary>
/// 收卷宽度mm
/// </summary>
public float ActFilmWidth { get; set; }
[Description("收卷宽度mm")]
public float ActFilmWidth{ get; set; }
/// <summary>
/// 设定厚度um
/// </summary>
public float SetThickness { get; set; }
[Description("设定厚度um")]
public float SetThickness{ get; set; }
/// <summary>
/// 理论速度m/min
/// </summary>
public float TargetVelocity { get; set; }
[Description("理论速度m/min")]
public float TargetVelocity{ get; set; }
/// <summary>
/// 内收卷当前m
/// </summary>
public float ACurrentLen { get; set; }
[Description("内收卷当前m")]
public float ACurrentLen{ get; set; }
/// <summary>
/// 内收卷当前kg
/// </summary>
public float ACurrent { get; set; }
[Description("内收卷当前kg")]
public float ACurrent{ get; set; }
/// <summary>
/// 内收卷上卷kg
/// </summary>
public float ALast { get; set; }
[Description("内收卷上卷kg")]
public float ALast{ get; set; }
/// <summary>
/// 外收卷当前m
/// </summary>
public float BCurrentLen { get; set; }
[Description("外收卷当前m")]
public float BCurrentLen{ get; set; }
/// <summary>
/// 外收卷当前kg
/// </summary>
public float BCurrent { get; set; }
[Description("外收卷当前kg")]
public float BCurrent{ get; set; }
/// <summary>
/// 外收卷上卷kg
/// </summary>
public float BLast { get; set; }
[Description("外收卷上卷kg")]
public float BLast{ get; set; }
/// <summary>
/// 内收卷清零
/// </summary>
public bool AClear { get; set; }
[Description("内收卷清零")]
public bool AClear{ get; set; }
/// <summary>
/// 外收卷清零
/// </summary>
public bool BClear { get; set; }
[Description("外收卷清零")]
public bool BClear{ get; set; }
#endregion
public event PropertyChangedEventHandler PropertyChanged;
......
#!/bin/bash
cp WeighterAccessory.cs ../../../../Project.FLY.Weight/FLY.Weight/Common
cp WeighterC.cs ../../../../Project.FLY.Weight/FLY.Weight/Common
cp WS.xml ../../../../Project.FLY.Weight/FLY.Weight.UI.Server/bin/Debug/Gage1
$root_path = $PSScriptRoot
$src_path = $root_path + "\WS.xml"
$dest_dir = $root_path + "\..\..\..\..\Project.FLY.Weight\FLY.Weight.UI.Server\bin\Debug\Gage1"
$dest_path = $dest_dir + "\WS.xml"
if(-not (Test-Path $dest_dir))
{
echo $dest_dir
mkdir $dest_dir
}
echo WS.xml
cp $src_path $dest_path
echo Ƴɹ
pause
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
namespace FLY.Weight.Common
{
public class WeighterAccessory:INotifyPropertyChanged
{
#region 辅助代码生成
/// <summary>
/// 总流量设定
/// </summary>
public float TotalFlowSetting { get; set; }
/// <summary>
/// 总流量显示
/// </summary>
public float TotalFlow { get; set; }
/// <summary>
/// 总产量
/// </summary>
public float TotalProduction { get; set; }
/// <summary>
/// 码轮周长mm
/// </summary>
public float WheelPerimeter { get; set; }
/// <summary>
/// 码轮脉冲
/// </summary>
public float WheelPulse { get; set; }
/// <summary>
/// 平均密度
/// </summary>
public float Density { get; set; }
/// <summary>
/// 边料不回收
/// </summary>
public bool IsRimNoRecycle { get; set; }
/// <summary>
/// 边料kg/h
/// </summary>
public float RimCharge { get; set; }
/// <summary>
/// 厚度um
/// </summary>
public float Thickness { get; set; }
/// <summary>
/// 当前线速度m/min
/// </summary>
public float CurrentVelocity { get; set; }
/// <summary>
/// 当前线速度设置m/min
/// </summary>
public float CurrentVelocitySet { get; set; }
/// <summary>
/// 吹膜宽度mm
/// </summary>
public float TotalFilmWidth { get; set; }
/// <summary>
/// 切边mm
/// </summary>
public float RimWidth { get; set; }
/// <summary>
/// 收卷宽度mm
/// </summary>
public float ActFilmWidth { get; set; }
/// <summary>
/// 设定厚度um
/// </summary>
public float SetThickness { get; set; }
/// <summary>
/// 理论速度m/min
/// </summary>
public float TargetVelocity { get; set; }
/// <summary>
/// 内收卷当前m
/// </summary>
public float ACurrentLen { get; set; }
/// <summary>
/// 内收卷当前kg
/// </summary>
public float ACurrent { get; set; }
/// <summary>
/// 内收卷上卷kg
/// </summary>
public float ALast { get; set; }
/// <summary>
/// 外收卷当前m
/// </summary>
public float BCurrentLen { get; set; }
/// <summary>
/// 外收卷当前kg
/// </summary>
public float BCurrent { get; set; }
/// <summary>
/// 外收卷上卷kg
/// </summary>
public float BLast { get; set; }
/// <summary>
/// 内收卷清零
/// </summary>
public bool AClear { get; set; }
/// <summary>
/// 外收卷清零
/// </summary>
public bool BClear { get; set; }
#endregion
public event PropertyChangedEventHandler PropertyChanged;
}
}
This diff is collapsed.
#!/bin/bash
cp ../../../Project.FLY.Weight/FLY.Weight/Common/WeighterAccessory.cs ./
cp ../../../Project.FLY.Weight/FLY.Weight/Common/WeighterC.cs ./
......@@ -143,7 +143,9 @@ namespace Autogen_WS
int i_typeName = 4;//类型
int i_scale = 5;//放大
int i_canWrite = 6;//可写
int i_plc_addr = 7;//PLC寄存器
int i_isError = 7;//报警
int i_trigger = 8;//触发
int i_plcAddr = 9;//PLC寄存器
int weighter_cnt = 0;//
......@@ -152,7 +154,7 @@ namespace Autogen_WS
{
using (ExcelWorksheet sheet = packages.Workbook.Worksheets["各层参数"])
{
int i = i_plc_addr;
int i = i_plcAddr;
Regex r_header_addr = new Regex(@"[A-F]层HMI寄存器");
......@@ -190,6 +192,7 @@ namespace Autogen_WS
{
WS_ItemInfo ii = new WS_ItemInfo();
//描述
try
{
ii.propDescription = sheet.Cells[i, i_propDescription].Value.ToString();
......@@ -200,7 +203,7 @@ namespace Autogen_WS
break;
}
//名称
try
{
ii.propName = sheet.Cells[i, i_propName].Value.ToString();
......@@ -212,6 +215,7 @@ namespace Autogen_WS
}
//类型
try
{
ii.typeName = sheet.Cells[i, i_typeName].Value.ToString();
......@@ -223,6 +227,7 @@ namespace Autogen_WS
}
//放大
try
{
string scale_str = sheet.Cells[i, i_scale].Value.ToString();
......@@ -240,6 +245,41 @@ namespace Autogen_WS
}
//报警
try
{
string isError_str = sheet.Cells[i, i_isError].Value.ToString();
if (!string.IsNullOrEmpty(isError_str))
{
if (Regex.IsMatch(isError_str, "Y"))
{
ii.isError = true;
}
}
}
catch
{
}
//触发
try
{
string trigger_str = sheet.Cells[i, i_trigger].Value.ToString();
if (!string.IsNullOrEmpty(trigger_str))
{
if (Regex.IsMatch(trigger_str, "OFF"))
{
ii.trigger = false;
}
}
}
catch
{
}
//把多余的空格删除
ii.propName = ii.propName.Trim();
ii.typeName = ii.typeName.Trim();
ii.propDescription = ii.propDescription.Trim();
......@@ -258,7 +298,7 @@ namespace Autogen_WS
string plc_addr;
try
{
plc_addr = sheet.Cells[i, i_plc_addr + wi].Value.ToString();
plc_addr = sheet.Cells[i, i_plcAddr + wi].Value.ToString();
}
catch
{
......@@ -299,7 +339,9 @@ namespace Autogen_WS
int i_typeName = 4;//类型
int i_scale = 5;//放大
int i_canWrite = 6;//可写
int i_plc_addr = 7;//PLC寄存器
int i_isError = 7;//报警
int i_trigger = 8;//触发
int i_plcAddr = 9;//PLC寄存器
using (ExcelPackage packages = new ExcelPackage(new FileInfo(xlsxfile)))
{
......@@ -362,6 +404,59 @@ namespace Autogen_WS
}
//放大
try
{
string scale_str = sheet.Cells[i, i_scale].Value.ToString();
if (!string.IsNullOrEmpty(scale_str))
{
double d;
if (double.TryParse(scale_str, out d))
{
ii.scale = d;
}
}
}
catch
{
}
//报警
try
{
string isError_str = sheet.Cells[i, i_isError].Value.ToString();
if (!string.IsNullOrEmpty(isError_str))
{
if (Regex.IsMatch(isError_str, "Y"))
{
ii.isError = true;
}
}
}
catch
{
}
//触发
try
{
string trigger_str = sheet.Cells[i, i_trigger].Value.ToString();
if (!string.IsNullOrEmpty(trigger_str))
{
if (Regex.IsMatch(trigger_str, "OFF"))
{
ii.trigger = false;
}
}
}
catch
{
}
ii.propName = ii.propName.Trim();
ii.typeName = ii.typeName.Trim();
ii.propDescription = ii.propDescription.Trim();
......@@ -379,7 +474,7 @@ namespace Autogen_WS
string plc_addr;
try
{
plc_addr = sheet.Cells[i, i_plc_addr].Value.ToString();
plc_addr = sheet.Cells[i, i_plcAddr].Value.ToString();
}
catch
{
......@@ -413,16 +508,40 @@ namespace Autogen_WS
foreach (KeyValuePair<string, WS_ItemInfo> sii in d)
{
WS_ItemInfo info = sii.Value;
sw.WriteLine(" /// <summary>");
sw.WriteLine(" /// {0}", info.propDescription);
sw.WriteLine(" /// </summary>");
sw.Write(" public {0} {1}", info.GetPropertyType(), info.propName);
sw.WriteLine(" { get; set; }");
string pre = " ";
sw.WriteLine($"{pre}/// <summary>");
if (info.isError)
{
if (info.trigger)
sw.WriteLine($"{pre}/// {info.propDescription} (ON)");
else
sw.WriteLine($"{pre}/// {info.propDescription} (OFF)");
}
else
{
sw.WriteLine($"{pre}/// {info.propDescription}");
}
sw.WriteLine($"{pre}/// </summary>");
sw.WriteLine($"{pre}[Description(\"{ info.propDescription}\")]");
if (info.isError)
{
if (info.trigger)
{
sw.WriteLine($"{pre}[IsError()]");
}
else
{
sw.WriteLine($"{pre}[IsError(offIsError:true)]");
}
}
sw.WriteLine($"{pre}public {info.GetPropertyType()} {info.propName}{{ get; set; }}");
sw.WriteLine();
}
sw.WriteLine(" #endregion");
}
void Gen_CS_WeighterAccessory(StreamWriter sw)
{
......
......@@ -7,15 +7,30 @@ namespace Autogen_WS
{
public class WS_ItemInfo
{
/// <summary>
/// 属性描述
/// </summary>
public string propDescription;
/// <summary>
/// 属性名
/// </summary>
public string propName;
/// <summary>
/// 属性描述
/// 数据类型, bool, float, uint16, int16, uint32, int32
/// </summary>
public string propDescription;
public string typeName;
/// <summary>
/// 放大
/// </summary>
public double scale = 1;
/// <summary>
/// 报警
/// </summary>
public bool isError = false;
/// <summary>
///报警触发条件 true=ON时触发, false=OFF时触发
/// </summary>
public bool trigger = true;
/// <summary>
/// plc 序号
/// </summary>
......@@ -29,14 +44,6 @@ namespace Autogen_WS
/// </summary>
public int mb_addr = -1;
/// <summary>
/// 数据类型, 与寄存器类型不同, bool, float, UInt16
/// </summary>
public string typeName;
/// <summary>
/// 放大
/// </summary>
public double scale = 1;
/// <summary>
/// 对象名
......@@ -49,18 +56,22 @@ namespace Autogen_WS
public WS_ItemInfo Clone()
{
WS_ItemInfo ii = new WS_ItemInfo();
ii.propName = propName;
ii.propDescription = propDescription;
ii.propName = propName;
ii.typeName = typeName;
ii.scale = scale;
ii.isError = isError;
ii.trigger = trigger;
ii.plc_index = plc_index;
ii.reg_type = reg_type;
ii.mb_addr = mb_addr;
ii.typeName = typeName;
ii.scale = scale;
ii.objectName = objectName;
return ii;
}
public string GetPropertyType()
public string GetPropertyType()//转为C#类型,只有bool 与 float
{
if (typeName == "bool")
return "bool";
......
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