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

修复 KSL 温度设置 需要置位

parent 092af1fa
......@@ -323,6 +323,9 @@
</Resource>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Costura.Fody">
<Version>4.1.0</Version>
</PackageReference>
<PackageReference Include="MahApps.Metro.IconPacks">
<Version>3.2.0</Version>
</PackageReference>
......
......@@ -33,6 +33,92 @@
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="Costura" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:all>
<xs:element minOccurs="0" maxOccurs="1" name="ExcludeAssemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="IncludeAssemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="Unmanaged32Assemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of unmanaged 32 bit assembly names to include, delimited with line breaks.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="Unmanaged64Assemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of unmanaged 64 bit assembly names to include, delimited with line breaks.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="PreloadOrder" type="xs:string">
<xs:annotation>
<xs:documentation>The order of preloaded assemblies, delimited with line breaks.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:all>
<xs:attribute name="CreateTemporaryAssemblies" type="xs:boolean">
<xs:annotation>
<xs:documentation>This will copy embedded files to disk before loading them into memory. This is helpful for some scenarios that expected an assembly to be loaded from a physical file.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="IncludeDebugSymbols" type="xs:boolean">
<xs:annotation>
<xs:documentation>Controls if .pdbs for reference assemblies are also embedded.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="DisableCompression" type="xs:boolean">
<xs:annotation>
<xs:documentation>Embedded assemblies are compressed by default, and uncompressed when they are loaded. You can turn compression off with this option.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="DisableCleanup" type="xs:boolean">
<xs:annotation>
<xs:documentation>As part of Costura, embedded assemblies are no longer included as part of the build. This cleanup can be turned off.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="LoadAtModuleInit" type="xs:boolean">
<xs:annotation>
<xs:documentation>Costura by default will load as part of the module initialization. This flag disables that behavior. Make sure you call CosturaUtility.Initialize() somewhere in your code.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="IgnoreSatelliteAssemblies" type="xs:boolean">
<xs:annotation>
<xs:documentation>Costura will by default use assemblies with a name like 'resources.dll' as a satellite resource and prepend the output path. This flag disables that behavior.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="ExcludeAssemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with |</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="IncludeAssemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of assembly names to include from the default action of "embed all Copy Local references", delimited with |.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="Unmanaged32Assemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of unmanaged 32 bit assembly names to include, delimited with |.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="Unmanaged64Assemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of unmanaged 64 bit assembly names to include, delimited with |.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="PreloadOrder" type="xs:string">
<xs:annotation>
<xs:documentation>The order of preloaded assemblies, delimited with |.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
......
......@@ -446,7 +446,7 @@
<TextBlock Style="{StaticResource Text.FieldHeaderEditable2}" Text="步进" />
<StackPanel Orientation="Horizontal">
<TextBox Style="{StaticResource Text.FieldContentInput}" Text="{Binding Step}"/>
<TextBlock Style="{StaticResource Text.FieldContentMm2}" Text="%" />
<TextBlock Style="{StaticResource Text.FieldContentMm2}" Text="" />
</StackPanel>
</StackPanel>
......
......@@ -279,7 +279,7 @@
LabelFormatter="{Binding YFormatter}"
MinValue="{Binding YMinOffset}" MaxValue="{Binding YMaxOffset}" FontFamily="Courier New" >
<lvc:Axis.Separator>
<lvc:Separator Stroke="{StaticResource Brushes.AxisSeparator}" Step="10"/>
<lvc:Separator Stroke="{StaticResource Brushes.AxisSeparator}" Step ="{Binding YStep}"/>
</lvc:Axis.Separator>
</lvc:Axis>
</lvc:CartesianChart.AxisY>
......@@ -397,9 +397,9 @@
<lvc:CartesianChart.AxisY>
<lvc:Axis Foreground="{StaticResource Brushes.AxisLabel}"
LabelFormatter="{Binding YFormatter}"
MinValue="{Binding YMin}" MaxValue="{Binding YMax}" FontFamily="Courier New" >
MinValue="{Binding YMin}" MaxValue="{Binding YMax}" FontFamily="Courier New" >
<lvc:Axis.Separator>
<lvc:Separator Stroke="{StaticResource Brushes.AxisSeparator}" Step="10"/>
<lvc:Separator Stroke="{StaticResource Brushes.AxisSeparator}" Step ="{Binding YStep}"/>
</lvc:Axis.Separator>
</lvc:Axis>
</lvc:CartesianChart.AxisY>
......
......@@ -30,6 +30,16 @@ namespace FLY.KSL.UI.Client.UiModule
public double YMax => (int)HSvAvg + MaxHeat / 2;
public double YMin => (int)HSvAvg - MaxHeat / 2;
[PropertyChanged.DependsOn(nameof(MaxHeat))]
public double YStep
{
get {
int step = (int)(MaxHeat / 10);
if (step < 10)
step = 10;
return step;
}
}
public double YMaxOffset => MaxHeat / 2;
public double YMinOffset => -MaxHeat / 2;
#endregion
......@@ -60,6 +70,8 @@ namespace FLY.KSL.UI.Client.UiModule
public double Kp { get; private set; } = 3;
private double maxHeat = 100;
public double MaxHeat
{
get {
......@@ -69,7 +81,8 @@ namespace FLY.KSL.UI.Client.UiModule
if (value < 50) {
value = 50;
}
if (value != maxHeat) {
if (value != maxHeat)
{
maxHeat = value;
}
}
......
......@@ -25,7 +25,17 @@ namespace FLY.KSL.UI.Client.UiModule
public double XMin { get; private set; }
public double YMax => (int)(HSvAvg + MaxHeat / 2);
public double YMin => (int)(HSvAvg - MaxHeat / 2);
[PropertyChanged.DependsOn(nameof(MaxHeat))]
public double YStep
{
get
{
int step = (int)(MaxHeat / 10);
if (step < 10)
step = 10;
return step;
}
}
public double YMaxOffset => (int)(MaxHeat / 2);
public double YMinOffset => (int)(-MaxHeat / 2);
......
using System.ComponentModel;
namespace FLY.KSL.Common
{
public class Accessory : INotifyPropertyChanged
{
public Accessory()
{
}
#region 辅助代码生成
/// <summary>
/// 温度设定SV改变
/// </summary>
[Description("温度设定SV改变")]
public bool IsTempSVChanged{ get; set; }
#endregion
public event PropertyChangedEventHandler PropertyChanged;
}
}
......@@ -45,6 +45,7 @@
<Compile Include="Client\FeedbackHeatServiceClient.cs" />
<Compile Include="Client\HeatBufServiceClient.cs" />
<Compile Include="Client\HeatCellServiceClient.cs" />
<Compile Include="Common\Accessory.cs" />
<Compile Include="Common\ERRNOs.cs" />
<Compile Include="Common\FeedbackHeatsMark.cs" />
<Compile Include="Common\FlyData_FeedbackHeat.cs" />
......
......@@ -15,6 +15,12 @@ namespace FLY.KSL.IService
/// 细分炉 1~20区
/// </summary>
ObservableCollection<FurnaceOfSubdivide> Fos { get; }
/// <summary>
/// 辅助设置
/// </summary>
Accessory Accessory { get; }
/// <summary>
/// PLC代理系统
/// </summary>
......
......@@ -399,6 +399,7 @@ namespace FLY.KSL.Server
var heat = heats[i];
plc.Fos[i].TempSV = heat;
}
plc.Accessory.IsTempSVChanged = true;
}
......
......@@ -22,6 +22,11 @@ namespace FLY.KSL.Server
/// </summary>
public ObservableCollection<FurnaceOfSubdivide> Fos { get; } = new ObservableCollection<FurnaceOfSubdivide>();
/// <summary>
/// 辅助设置
/// </summary>
public Accessory Accessory { get; } = new Accessory();
/// <summary>
/// 区数
/// </summary>
......@@ -57,7 +62,9 @@ namespace FLY.KSL.Server
PLCos.SetPlan($"{nameof(Fos)}[{i}]", props, 0);
}
PLCos.SetPlan($"{nameof(Accessory)}", new string[] {
nameof(Accessory.IsTempSVChanged)
}, 0);
//--------------------------------------------------------------------------------
//last step PLC 更新计划服务初始化
......@@ -91,7 +98,7 @@ namespace FLY.KSL.Server
//objname 转 obj
Dictionary<string, INotifyPropertyChanged> objnames = new Dictionary<string, INotifyPropertyChanged>();
objnames.Add(nameof(Fos), Fos);
objnames.Add(nameof(Accessory), Accessory);
for (int i = 0; i < FosCnt; i++)
objnames.Add($"{nameof(Fos)}[{i}]", Fos[i]);
return objnames;
......
......@@ -760,8 +760,11 @@ namespace FLY.KSL.Server
}
//3.有滤波行为,继续求循环,求sigma,判断。。。。。
if(hasChanged)
if (hasChanged)
{
hasChanged2 = true;
heats = heats2.ToArray();
}
} while (hasChanged);
......@@ -794,18 +797,7 @@ namespace FLY.KSL.Server
for (int i = 0; i < ChannelCnt; i++)
{
Offsets[i] = 0;
int heat = PreHeats[i];
if (heat < 0)
{
//需要整体提升
heat = 0;
}
else if (heat > 100)
{
//需要整体调低
heat = 100;
}
Heats[i] = heat;
}
......
......@@ -81,6 +81,9 @@
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="NLog.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
......
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<!--<Costura />-->
<Costura />
</Weavers>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.nlog-project.org/schemas/NLog.xsd NLog.xsd"
autoReload="true"
throwExceptions="false"
internalLogLevel="Off" internalLogFile="c:\temp\nlog-internal.log">
<!-- optional, add some variables
https://github.com/nlog/NLog/wiki/Configuration-file#variables
-->
<variable name="myvar" value="myvalue"/>
<!--
See https://github.com/nlog/nlog/wiki/Configuration-file
for information on customizing logging rules and outputs.
-->
<targets>
<!--
add your targets here
See https://github.com/nlog/NLog/wiki/Targets for possible targets.
See https://github.com/nlog/NLog/wiki/Layout-Renderers for the possible layout renderers.
-->
<!--
Write events to a file with the date in the filename.
<target xsi:type="File" name="f" fileName="${basedir}/logs/${shortdate}.log"
layout="${longdate} ${uppercase:${level}} ${message}" />
-->
<target xsi:type="File" name="f_debug" fileName="${basedir}/logs/debug/${shortdate}.log"
layout="${longdate} ${logger} ${uppercase:${level}} ${message}"
archiveAboveSize="1048576" encoding="utf-8"/>
<target xsi:type="File" name="f_error" fileName="${basedir}/logs/error/${shortdate}.log"
layout="${longdate} ${logger} ${uppercase:${level}} ${message} ${onexception:inner=${newline} *****Error***** ${newline} ${exception:format=ToString}}"
archiveAboveSize="1048576" encoding="utf-8"/>
<target xsi:type="File" name="plcWrite" fileName="${basedir}/logs/plcWrite/${shortdate}.log"
layout="${longdate} ${message}"
archiveAboveSize="1048576" encoding="utf-8"/>
</targets>
<rules>
<!-- add your logging rules here -->
<!--
Write all events with minimal level of Debug (So Debug, Info, Warn, Error and Fatal, but not Trace) to "f"
<logger name="*" minlevel="Debug" writeTo="f" />
-->
<!--<logger name="FObjSysOfClient" minlevel="Debug" writeTo="f_debug" />-->
<!--name 可以用匹配-->
<logger name="FLY.OBJComponents.Server.PLCProxySystem" minlevel="Info" writeTo="plcWrite" />
<logger name="*" minlevel="Error" writeTo="f_error" />
</rules>
</nlog>
using System.ComponentModel;
namespace XXX.Common
{
public class Accessory : INotifyPropertyChanged
{
public Accessory()
{
}
#region 辅助代码生成
/// <summary>
/// 温度设定SV改变
/// </summary>
[Description("温度设定SV改变")]
public bool IsTempSVChanged{ get; set; }
#endregion
public event PropertyChangedEventHandler PropertyChanged;
}
}
using System.ComponentModel;
namespace XXX.Common
{
public class FurnaceOfSubdivide : INotifyPropertyChanged
{
public FurnaceOfSubdivide()
{
}
#region 辅助代码生成
/// <summary>
/// 温度显示PV
/// </summary>
[Description("温度显示PV")]
public float TempPV{ get; set; }
/// <summary>
/// 温度设定SV
/// </summary>
[Description("温度设定SV")]
public float TempSV{ get; set; }
/// <summary>
/// 比例增益P
/// </summary>
[Description("比例增益P")]
public float TempP{ get; set; }
/// <summary>
/// 积分时间I
/// </summary>
[Description("积分时间I")]
public float TempI{ get; set; }
/// <summary>
/// 微分时间D
/// </summary>
[Description("微分时间D")]
public float TempD{ get; set; }
/// <summary>
/// 温度修正TR
/// </summary>
[Description("温度修正TR")]
public float TempCorrect{ get; set; }
/// <summary>
/// 自整定开关
/// </summary>
[Description("自整定开关")]
public bool IsSelfAdjustingOn{ get; set; }
#endregion
public event PropertyChangedEventHandler PropertyChanged;
}
}
......@@ -1264,6 +1264,15 @@
"Scale": 1.0,
"OwnerName": "Fos[19]",
"PropertyName": "IsSelfAdjustingOn"
},
{
"DeviceIndex": 0,
"Mode": "0",
"Addr": 1140,
"Type": "bool",
"Scale": 1.0,
"OwnerName": "Accessory",
"PropertyName": "IsTempSVChanged"
}
]
}
\ No newline at end of file
[General]
BeepWhenClicked=true
BeepWhenAlarm=false
CursorVisible=false
DrawFocus=false
DisplayZero=false
ShowTagToolTips=true
ShowDownloadPage=true
OperationLogEnabled=false
BlackLight=90
currentLanguage=zh_CN
StartLanguage=zh_CN
ScreenList=2, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18
IsRotate=0
AdaptiveResolution=false
isLoginUserComboBoxEnabled=true
isAlarmWindowVisible=true
SystemAlarmWindowBeClosedManually=true
SystemAlarmKeepTime=2
OperationRecordEnable=false
OperationRecordMode=true
OperationRecordCount=10000
DefaultUser=admin
[ScreenSaver]
SCRWaitTime=0
BLWaitTime=0
OnScreenId=-1
[AlarmView]
header\Text=414
header\Time=193
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