Commit 72dc1b2b authored by 潘栩锋's avatar 潘栩锋 🚴

添加 测袋模式!!!!

parent f7e046ab
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\packages\PropertyChanged2.Fody.2.5.13\build\PropertyChanged2.Fody.props" Condition="Exists('..\..\packages\PropertyChanged2.Fody.2.5.13\build\PropertyChanged2.Fody.props')" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform> <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
...@@ -31,6 +32,8 @@ ...@@ -31,6 +32,8 @@
<ApplicationVersion>1.0.0.%2a</ApplicationVersion> <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust> <UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled> <BootstrapperEnabled>true</BootstrapperEnabled>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget> <PlatformTarget>x86</PlatformTarget>
...@@ -62,6 +65,9 @@ ...@@ -62,6 +65,9 @@
<Reference Include="Microsoft.Expression.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" /> <Reference Include="Microsoft.Expression.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="Microsoft.Expression.Interactions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" /> <Reference Include="Microsoft.Expression.Interactions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="PresentationFramework.Aero" /> <Reference Include="PresentationFramework.Aero" />
<Reference Include="PropertyChanged2, Version=2.5.13.0, Culture=neutral, PublicKeyToken=ee3ee20bcf148ddd, processorArchitecture=MSIL">
<HintPath>..\..\packages\PropertyChanged2.Fody.2.5.13\lib\net40\PropertyChanged2.dll</HintPath>
</Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
...@@ -184,6 +190,7 @@ ...@@ -184,6 +190,7 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
</EmbeddedResource> </EmbeddedResource>
<None Include="app.config" /> <None Include="app.config" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings"> <None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator> <Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput> <LastGenOutput>Settings.Designer.cs</LastGenOutput>
...@@ -272,8 +279,18 @@ ...@@ -272,8 +279,18 @@
<EmbedInteropTypes>True</EmbedInteropTypes> <EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference> </COMReference>
</ItemGroup> </ItemGroup>
<ItemGroup /> <ItemGroup>
<Resource Include="FodyWeavers.xml" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\..\packages\Fody.3.2.13\build\Fody.targets" Condition="Exists('..\..\packages\Fody.3.2.13\build\Fody.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\Fody.3.2.13\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Fody.3.2.13\build\Fody.targets'))" />
<Error Condition="!Exists('..\..\packages\PropertyChanged2.Fody.2.5.13\build\PropertyChanged2.Fody.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\PropertyChanged2.Fody.2.5.13\build\PropertyChanged2.Fody.props'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- 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. Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild"> <Target Name="BeforeBuild">
......
<?xml version="1.0" encoding="utf-8" ?>
<Weavers>
<PropertyChanged2 />
</Weavers>
...@@ -154,10 +154,10 @@ namespace FLY.Thick.Blowing.UI.Fix.Client ...@@ -154,10 +154,10 @@ namespace FLY.Thick.Blowing.UI.Fix.Client
} }
BlowingFixProfileService mProfile; BlowingFixProfileServiceClient mProfile;
void Init_Border_Profile() void Init_Border_Profile()
{ {
mProfile = new BlowingFixProfileService(); mProfile = new BlowingFixProfileServiceClient();
FObjBase.FObjSys.Current.Connect_to_Another_OBJSys( FObjBase.FObjSys.Current.Connect_to_Another_OBJSys(
gage.mSysParam.ServerIPEP, mProfile.ID); gage.mSysParam.ServerIPEP, mProfile.ID);
......
...@@ -3,8 +3,9 @@ ...@@ -3,8 +3,9 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:common="clr-namespace:FLY.Thick.Blowing.Common;assembly=FLY.Thick.Blowing"
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="768" d:DesignWidth="1024" Background="White" d:DesignHeight="1024" d:DesignWidth="1280" Background="White"
Title="Page_Profile" Loaded="Page_Loaded" Unloaded="Page_Unloaded"> Title="Page_Profile" Loaded="Page_Loaded" Unloaded="Page_Unloaded">
<Page.Resources> <Page.Resources>
<ResourceDictionary> <ResourceDictionary>
...@@ -12,10 +13,14 @@ ...@@ -12,10 +13,14 @@
<ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Themes/Dictionary_MyStyle.xaml"/> <ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Themes/Dictionary_MyStyle.xaml"/>
<ResourceDictionary Source="pack://application:,,,/ThickTcpUiInWindow;component/Converter/Dictionary_MyConv.xaml"/> <ResourceDictionary Source="pack://application:,,,/ThickTcpUiInWindow;component/Converter/Dictionary_MyConv.xaml"/>
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
<common:BlowingFixProfileParam x:Key="param" MMode="Bag"/>
<Geometry x:Key="Geometry_legend">
M1049.886996 1023.827803H91.49417c-50.453812 0-91.49417-39.949776-91.49417-89.026009V89.370404C0 40.29417 41.040359 0.344395 91.49417 0.344395h958.392826c50.453812 0 91.49417 39.949776 91.49417 89.026009v845.43139c0 49.076233-41.040359 89.026009-91.49417 89.026009z m39.203587-934.457399a38.744395 38.744395 0 0 0-39.203587-38.113005H91.49417a38.744395 38.744395 0 0 0-39.203587 38.113005v845.43139c0 1.090583 0.573991 1.95157 0.63139 3.042152l21.869058-31.052915 283.379373-342.959641 360.466367 265.241256 200.896861-176.846637 156.81435 206.349776 12.742601 17.564125V89.370404zM885.840359 438.988341c-46.034081-12.16861-73.241256-58.432287-60.728251-103.260987 12.513004-44.886099 60.039462-71.347085 106.073542-59.178475 46.09148 12.226009 73.298655 58.432287 60.728251 103.318386-12.513004 44.8287-59.982063 71.347085-106.073542 59.121076z
</Geometry>
</ResourceDictionary> </ResourceDictionary>
</Page.Resources> </Page.Resources>
<Grid > <Grid d:DataContext="{StaticResource param}">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="auto" /> <RowDefinition Height="auto" />
<RowDefinition Height="496*" /> <RowDefinition Height="496*" />
...@@ -76,12 +81,33 @@ ...@@ -76,12 +81,33 @@
<Border Background="{StaticResource Color_theme_activity}" Width="150" Margin="0,5,5,5" > <Border Background="{StaticResource Color_theme_activity}" Width="150" Margin="0,5,5,5" >
<TextBlock Style="{StaticResource TextBlockStyle_ItemHeader}" Text="无死区&#x0a;精确计算" FontSize="20"/> <TextBlock Style="{StaticResource TextBlockStyle_ItemHeader}" Text="无死区&#x0a;精确计算" FontSize="20"/>
</Border> </Border>
<StackPanel Orientation="Horizontal" > <StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Vertical" Margin="5"> <StackPanel Orientation="Vertical" Margin="5">
<TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldHeaderEditable}" Text="使能" /> <TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldHeaderEditable}" Text="测量模式" />
<ToggleButton x:Name="togglebutton_solveenable" Style="{StaticResource ToggleButtonStyle1}" HorizontalAlignment="Left" IsChecked="{Binding SolveEnable}" /> <ComboBox MinWidth="120" MinHeight="40" HorizontalAlignment="Left">
<ComboBoxItem IsSelected="{Binding MMode, Converter={StaticResource e2bconv}, ConverterParameter={x:Static common:MeasureMode.Edge}}">
<TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldContent}" FontSize="32" Text="不解方程"/>
</ComboBoxItem>
<ComboBoxItem IsSelected="{Binding MMode, Converter={StaticResource e2bconv}, ConverterParameter={x:Static common:MeasureMode.Normal}}">
<TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldContent}" FontSize="32" Text="测两层"/>
</ComboBoxItem>
<ComboBoxItem IsSelected="{Binding MMode, Converter={StaticResource e2bconv}, ConverterParameter={x:Static common:MeasureMode.Bag}}">
<TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldContent}" FontSize="32" Text="测袋"/>
</ComboBoxItem>
</ComboBox>
</StackPanel>
<Button Style="{StaticResource ButtonStyle_empty}" Margin="5" Click="button_legend_Click" >
<Grid Style="{StaticResource GridStyle_ButtonShadow}">
<Rectangle Fill="White" Height="48"/>
<Path Data="{StaticResource Geometry_legend}" Fill="{StaticResource Color_theme_activity}" Stretch="Uniform" Width="60" Height="60"/>
<TextBlock Text="图例" Padding="3,2" Foreground="White" FontWeight="Bold" VerticalAlignment="Bottom" HorizontalAlignment="Center" Background="{StaticResource Color_theme_activity}" FontSize="12"/>
</Grid>
</Button>
</StackPanel> </StackPanel>
<StackPanel Orientation="Horizontal" Visibility="{Binding IsChecked, ElementName=togglebutton_solveenable, Converter={StaticResource visbilityconv}}">
<StackPanel Orientation="Horizontal" Visibility="{Binding MMode, Converter={StaticResource e2visconv_collapsed}, ConverterParameter={x:Static common:MeasureMode.Normal}}">
<StackPanel Orientation="Vertical" Margin="5"> <StackPanel Orientation="Vertical" Margin="5">
<TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldHeaderEditable}" Text="膜宽" /> <TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldHeaderEditable}" Text="膜宽" />
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
...@@ -97,8 +123,42 @@ ...@@ -97,8 +123,42 @@
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
<StackPanel Orientation="Vertical" Visibility="{Binding MMode, Converter={StaticResource e2visconv_collapsed}, ConverterParameter={x:Static common:MeasureMode.Bag}}">
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Vertical" Margin="5">
<TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldHeaderEditable}" Text="膜宽" />
<StackPanel Orientation="Horizontal">
<TextBox Style="{StaticResource ResourceKey=TextBoxStyle_FieldContent}" Text="{Binding FilmWidth}" />
<TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldContent_mm}" Text="mm" />
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="5">
<TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldHeaderEditable}" Text="探头离膜边" />
<StackPanel Orientation="Horizontal">
<TextBox Style="{StaticResource ResourceKey=TextBoxStyle_FieldContent}" Text="{Binding FilmPosH}" />
<TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldContent_mm}" Text="mm" />
</StackPanel>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Vertical" Margin="5">
<TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldHeaderEditable}" Text="探头下折边" />
<StackPanel Orientation="Horizontal">
<TextBox Style="{StaticResource ResourceKey=TextBoxStyle_FieldContent}" Text="{Binding BagFold0}" />
<TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldContent_mm}" Text="mm" />
</StackPanel>
</StackPanel> </StackPanel>
<StackPanel Orientation="Vertical" Margin="5">
<TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldHeaderEditable}" Text="另一边折边" />
<StackPanel Orientation="Horizontal">
<TextBox Style="{StaticResource ResourceKey=TextBoxStyle_FieldContent}" Text="{Binding BagFold1}" />
<TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldContent_mm}" Text="mm" />
</StackPanel>
</StackPanel>
</StackPanel>
</StackPanel>
</StackPanel>
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
<ListBox Name="listview_profile" Margin="5" MinWidth="400" Grid.Column="1" Background="{StaticResource Background_Title}"> <ListBox Name="listview_profile" Margin="5" MinWidth="400" Grid.Column="1" Background="{StaticResource Background_Title}">
......
...@@ -30,67 +30,22 @@ namespace FLY.Thick.Blowing.UI.Fix.Client ...@@ -30,67 +30,22 @@ namespace FLY.Thick.Blowing.UI.Fix.Client
/// </summary> /// </summary>
public partial class Page_ProfileBlowing : Page, INotifyPropertyChanged public partial class Page_ProfileBlowing : Page, INotifyPropertyChanged
{ {
private double alarmpercent = 3; public double AlarmPercent { get; set; } = 3;
public double AlarmPercent
{
get
{
return alarmpercent;
}
set
{
if (alarmpercent != value)
{
alarmpercent = value;
NotifyPropertyChanged("AlarmPercent");
}
}
}
private double alarm = 3;
public double Alarm
{
get
{
return alarm;
}
set
{
if (alarm != value)
{
alarm = value;
NotifyPropertyChanged("Alarm");
}
}
}
private double target = 30;
public double Target
{
get
{
return target;
}
set
{
if (target != value)
{
target = value;
NotifyPropertyChanged("Target");
}
}
}
public double Alarm { get; set; } = 3;
public double Target { get; set; } = 30;
public ObservableCollection<string> mList = new ObservableCollection<string>(); public ObservableCollection<string> mList = new ObservableCollection<string>();
public BlowingFixProfileService mProfile = null; public BlowingFixProfileServiceClient mProfile = null;
bool NeedKeepContext = false;
public Page_ProfileBlowing() public Page_ProfileBlowing()
{ {
InitializeComponent(); InitializeComponent();
} }
public void Init(IPEndPoint serverep) public void Init(IPEndPoint serverep)
{ {
mProfile = new BlowingFixProfileService(); mProfile = new BlowingFixProfileServiceClient();
FObjBase.FObjSys.Current.Connect_to_Another_OBJSys( FObjBase.FObjSys.Current.Connect_to_Another_OBJSys(
serverep, mProfile.ID); serverep, mProfile.ID);
...@@ -157,11 +112,6 @@ namespace FLY.Thick.Blowing.UI.Fix.Client ...@@ -157,11 +112,6 @@ namespace FLY.Thick.Blowing.UI.Fix.Client
private void Page_Loaded(object sender, RoutedEventArgs e) private void Page_Loaded(object sender, RoutedEventArgs e)
{ {
if (NeedKeepContext)
{
NeedKeepContext = false;
return;
}
} }
private void button_read_Click(object sender, RoutedEventArgs e) private void button_read_Click(object sender, RoutedEventArgs e)
...@@ -189,7 +139,11 @@ namespace FLY.Thick.Blowing.UI.Fix.Client ...@@ -189,7 +139,11 @@ namespace FLY.Thick.Blowing.UI.Fix.Client
mProfile.Param.PropertyChanged += handler_profile; mProfile.Param.PropertyChanged += handler_profile;
//有效性检查 //有效性检查
if (mProfile.Param.SolveEnable) switch (mProfile.Param.MMode)
{
case MeasureMode.Edge:
break;
case MeasureMode.Normal:
{ {
if (mProfile.Param.FilmWidth < 500) if (mProfile.Param.FilmWidth < 500)
{ {
...@@ -201,11 +155,47 @@ namespace FLY.Thick.Blowing.UI.Fix.Client ...@@ -201,11 +155,47 @@ namespace FLY.Thick.Blowing.UI.Fix.Client
FLY.ControlLibrary.Window_WarningTip.Show("参数出错", "探头位置>(膜宽/3) 异常"); FLY.ControlLibrary.Window_WarningTip.Show("参数出错", "探头位置>(膜宽/3) 异常");
return; return;
} }
else if (mProfile.Param.FilmPosH < 0 ) else if (mProfile.Param.FilmPosH < 0)
{ {
FLY.ControlLibrary.Window_WarningTip.Show("参数出错", "探头位置<0 异常"); FLY.ControlLibrary.Window_WarningTip.Show("参数出错", "探头位置<0 异常");
return; return;
} }
}break;
default:
//case MeasureMode.Bag:
{
if (mProfile.Param.FilmWidth < 500)
{
FLY.ControlLibrary.Window_WarningTip.Show("参数出错", "膜宽<500mm 异常");
return;
}
else if (mProfile.Param.FilmPosH > mProfile.Param.FilmWidth / 3)
{
FLY.ControlLibrary.Window_WarningTip.Show("参数出错", "探头位置>(膜宽/3) 异常");
return;
}
else if (mProfile.Param.FilmPosH < 0)
{
FLY.ControlLibrary.Window_WarningTip.Show("参数出错", "探头位置<0 异常");
return;
}
else if (mProfile.Param.BagFold0 < mProfile.Param.FilmPosH)
{
FLY.ControlLibrary.Window_WarningTip.Show("参数出错", "探头下的折边 < 探头位置");
return;
}
else if (mProfile.Param.BagFold1 < mProfile.Param.FilmPosH)
{
FLY.ControlLibrary.Window_WarningTip.Show("参数出错", "另一边的折边 < 探头位置");
return;
}
else if (mProfile.Param.FilmWidth < (mProfile.Param.BagFold0 + mProfile.Param.BagFold1))
{
FLY.ControlLibrary.Window_WarningTip.Show("参数出错", "折边 >(膜宽/2) 异常");
return;
}
}
break;
} }
if (mProfile.Param.Target <= 0) if (mProfile.Param.Target <= 0)
...@@ -259,22 +249,21 @@ namespace FLY.Thick.Blowing.UI.Fix.Client ...@@ -259,22 +249,21 @@ namespace FLY.Thick.Blowing.UI.Fix.Client
private void Page_Unloaded(object sender, RoutedEventArgs e) private void Page_Unloaded(object sender, RoutedEventArgs e)
{ {
if (NeedKeepContext)
return;
mProfile.Dispose(); mProfile.Dispose();
} }
#region INotifyPropertyChanged 成员 #region INotifyPropertyChanged 成员
public event PropertyChangedEventHandler PropertyChanged; public event PropertyChangedEventHandler PropertyChanged;
protected void NotifyPropertyChanged(string propertyname)
{
if (PropertyChanged != null)
{
PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyname));
}
}
#endregion #endregion
private void button_legend_Click(object sender, RoutedEventArgs e)
{
Window_ProfileLegend w = new Window_ProfileLegend();
w.DataContext = mProfile.Param;
w.Owner = FLY.ControlLibrary.COMMON.GetWindow(this);
w.ShowDialog();
}
} }
} }
<flyctrllib:WindowBigClose x:Class="FLY.Thick.Blowing.UI.Fix.Client.Window_ProfileLegend"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:FLY.IBC.UI.Client"
xmlns:flyctrllib="clr-namespace:FLY.ControlLibrary;assembly=FLY.ControlLibrary"
xmlns:common="clr-namespace:FLY.Thick.Blowing.Common;assembly=FLY.Thick.Blowing"
mc:Ignorable="d"
Title="Window_ProfileLegend" SizeToContent="WidthAndHeight" >
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Themes/Dictionary_MyStyle.xaml"/>
<ResourceDictionary Source="pack://application:,,,/ThickTcpUiInWindow;component/Converter/Dictionary_MyConv.xaml"/>
</ResourceDictionary.MergedDictionaries>
<common:BlowingFixProfileParam x:Key="param" MMode="Bag"/>
</ResourceDictionary>
</Window.Resources>
<Grid Width="500" d:DataContext="{StaticResource param}">
<Image Margin="10" Stretch="Uniform" >
<Image.Style>
<Style TargetType="Image">
<Setter Property="Source" Value="image/normal.jpg"/>
<Style.Triggers>
<DataTrigger Binding="{Binding MMode}" Value="Bag">
<Setter Property="Source" Value="image/bag.jpg"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Image.Style>
</Image>
</Grid>
</flyctrllib:WindowBigClose>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace FLY.Thick.Blowing.UI.Fix.Client
{
/// <summary>
/// Window_ProfileLegend.xaml 的交互逻辑
/// </summary>
public partial class Window_ProfileLegend : FLY.ControlLibrary.WindowBigClose
{
public Window_ProfileLegend()
{
InitializeComponent();
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Fody" version="3.2.13" targetFramework="net40" developmentDependency="true" />
<package id="PropertyChanged2.Fody" version="2.5.13" targetFramework="net40" />
</packages>
\ No newline at end of file
...@@ -11,16 +11,16 @@ using System.Text; ...@@ -11,16 +11,16 @@ using System.Text;
namespace FLY.Thick.Blowing.Client namespace FLY.Thick.Blowing.Client
{ {
public class BlowingFixProfileService : FObj, IBlowingFixProfileService public class BlowingFixProfileServiceClient : FObj, IBlowingFixProfileService
{ {
IFConn mConn; IFConn mConn;
UInt32 mServerID; UInt32 mServerID;
public BlowingFixProfileService() public BlowingFixProfileServiceClient()
{ {
mServerID = FLY.Thick.Blowing.OBJ_INTERFACE.OBJ_INTERFACE_ID.BFPROFILE_ID; mServerID = FLY.Thick.Blowing.OBJ_INTERFACE.OBJ_INTERFACE_ID.BFPROFILE_ID;
} }
public BlowingFixProfileService(UInt32 id) public BlowingFixProfileServiceClient(UInt32 id)
{ {
mServerID = id; mServerID = id;
} }
...@@ -68,10 +68,10 @@ namespace FLY.Thick.Blowing.Client ...@@ -68,10 +68,10 @@ namespace FLY.Thick.Blowing.Client
/// <param name="productname"></param> /// <param name="productname"></param>
public void Del(string productname) public void Del(string productname)
{ {
Pack_String p = new Pack_String(); string json = JsonConvert.SerializeObject(productname);
p.data = productname;
CurrObjSys.CallFunctionEx(mConn, mServerID, ID, CurrObjSys.CallFunctionEx(mConn, mServerID, ID,
BLOWINGFIX_PROFILE_OBJ_INTERFACE.CALL_DEL, p.ToBytes()); BLOWINGFIX_PROFILE_OBJ_INTERFACE.CALL_DEL, Misc.Converter.StringToBytes(json));
} }
/// <summary> /// <summary>
...@@ -82,9 +82,11 @@ namespace FLY.Thick.Blowing.Client ...@@ -82,9 +82,11 @@ namespace FLY.Thick.Blowing.Client
/// <param name="AsyncState"></param> /// <param name="AsyncState"></param>
public void Read(string productname, AsyncCBHandler AsyncDelegate, object AsyncState) public void Read(string productname, AsyncCBHandler AsyncDelegate, object AsyncState)
{ {
string json = JsonConvert.SerializeObject(productname);
CurrObjSys.CallFunctionEx(mConn, mServerID, ID, CurrObjSys.CallFunctionEx(mConn, mServerID, ID,
BLOWINGFIX_PROFILE_OBJ_INTERFACE.CALL_READ, BLOWINGFIX_PROFILE_OBJ_INTERFACE.CALL_READ,
new Pack_String() { data = productname }.ToBytes(), Misc.Converter.StringToBytes(json),
AsyncDelegate, AsyncState); AsyncDelegate, AsyncState);
} }
#endregion #endregion
...@@ -140,10 +142,9 @@ namespace FLY.Thick.Blowing.Client ...@@ -140,10 +142,9 @@ namespace FLY.Thick.Blowing.Client
{ {
case BLOWINGFIX_PROFILE_OBJ_INTERFACE.CALL_GETLIST: case BLOWINGFIX_PROFILE_OBJ_INTERFACE.CALL_GETLIST:
{ {
Pack_StringList p = new Pack_StringList(); string json = Misc.Converter.BytesToString(retdata);
if (!p.TryParse(retdata)) List<string> p = JsonConvert.DeserializeObject<List<string>>(json);
return; ((AsyncCBHandler)AsyncDelegate)(AsyncState, p);
((AsyncCBHandler)AsyncDelegate)(AsyncState, p.list);
} }
break; break;
case BLOWINGFIX_PROFILE_OBJ_INTERFACE.CALL_READ: case BLOWINGFIX_PROFILE_OBJ_INTERFACE.CALL_READ:
......
...@@ -36,9 +36,9 @@ namespace FLY.Thick.Blowing.Common ...@@ -36,9 +36,9 @@ namespace FLY.Thick.Blowing.Common
#endregion #endregion
#region 吹膜定点解方程用 #region 吹膜定点解方程用
/// <summary> /// <summary>
/// 使能定点解方程 /// 测量模式
/// </summary> /// </summary>
public bool SolveEnable { get; set; } = false; public MeasureMode MMode { get; set; } = MeasureMode.Edge;
/// <summary> /// <summary>
/// 膜宽 单位 mm, 收卷时,切膜前,测量的宽度 /// 膜宽 单位 mm, 收卷时,切膜前,测量的宽度
...@@ -50,11 +50,6 @@ namespace FLY.Thick.Blowing.Common ...@@ -50,11 +50,6 @@ namespace FLY.Thick.Blowing.Common
/// </summary> /// </summary>
public int FilmPosH { get; set; } = 70; public int FilmPosH { get; set; } = 70;
/// <summary>
/// 袋测量模式
/// </summary>
public bool IsBag { get; set; } = false;
/// <summary> /// <summary>
/// 探头测量位置,袋折叠的宽度 单位 mm /// 探头测量位置,袋折叠的宽度 单位 mm
/// </summary> /// </summary>
...@@ -69,4 +64,23 @@ namespace FLY.Thick.Blowing.Common ...@@ -69,4 +64,23 @@ namespace FLY.Thick.Blowing.Common
public event PropertyChangedEventHandler PropertyChanged; public event PropertyChangedEventHandler PropertyChanged;
} }
/// <summary>
/// 测量模式
/// </summary>
public enum MeasureMode
{
/// <summary>
/// 不解方程,探头距离膜边 0mm
/// </summary>
Edge,
/// <summary>
/// 一般模型,探头测双层
/// </summary>
Normal,
/// <summary>
/// 垃圾袋,两边凹进去,探头测4层
/// </summary>
Bag
}
} }
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Client\BlowingDetectServiceClient.cs" /> <Compile Include="Client\BlowingDetectServiceClient.cs" />
<Compile Include="Client\BlowingFixProfileService.cs" /> <Compile Include="Client\BlowingFixProfileServiceClient.cs" />
<Compile Include="Client\BlowingFixServiceClient.cs" /> <Compile Include="Client\BlowingFixServiceClient.cs" />
<Compile Include="Client\BlowingServiceClient.cs" /> <Compile Include="Client\BlowingServiceClient.cs" />
<Compile Include="Common\BlowingFixProfileParam.cs" /> <Compile Include="Common\BlowingFixProfileParam.cs" />
......
...@@ -82,9 +82,7 @@ namespace FLY.Thick.Blowing.Server.OBJProxy ...@@ -82,9 +82,7 @@ namespace FLY.Thick.Blowing.Server.OBJProxy
new AsyncCBHandler(delegate (object AsyncState, object retdata) new AsyncCBHandler(delegate (object AsyncState, object retdata)
{ {
ConnContext context = (ConnContext)AsyncState; ConnContext context = (ConnContext)AsyncState;
List<string> ss = (List<string>)retdata; string json = JsonConvert.SerializeObject(retdata);
Pack_StringList p = new Pack_StringList();
p.list = (List<string>)retdata;
CurrObjSys.PushCallFunctionEx( CurrObjSys.PushCallFunctionEx(
context.from, context.from,
...@@ -92,30 +90,28 @@ namespace FLY.Thick.Blowing.Server.OBJProxy ...@@ -92,30 +90,28 @@ namespace FLY.Thick.Blowing.Server.OBJProxy
ID, ID,
context.magic, context.magic,
BLOWINGFIX_PROFILE_OBJ_INTERFACE.CALL_GETLIST, BLOWINGFIX_PROFILE_OBJ_INTERFACE.CALL_GETLIST,
p.ToBytes()); Misc.Converter.StringToBytes(json));
}), new ConnContext(from, srcid, magic)); }), new ConnContext(from, srcid, magic));
} }
break; break;
case BLOWINGFIX_PROFILE_OBJ_INTERFACE.CALL_DEL: case BLOWINGFIX_PROFILE_OBJ_INTERFACE.CALL_DEL:
{ {
Pack_String p = new Pack_String(); string json = Misc.Converter.BytesToString(infodata);
if (!p.TryParse(infodata)) string p = JsonConvert.DeserializeObject<string>(json);
return; mProfile.Del(p);
mProfile.Del(p.data);
} }
break; break;
case BLOWINGFIX_PROFILE_OBJ_INTERFACE.CALL_READ: case BLOWINGFIX_PROFILE_OBJ_INTERFACE.CALL_READ:
{ {
Pack_String p = new Pack_String(); string json = Misc.Converter.BytesToString(infodata);
if (!p.TryParse(infodata)) string p = JsonConvert.DeserializeObject<string>(json);
return;
mProfile.Read( mProfile.Read(
p.data, p,
new AsyncCBHandler(delegate (object AsyncState, object retdata) new AsyncCBHandler(delegate (object AsyncState, object retdata)
{ {
ConnContext context = (ConnContext)AsyncState; ConnContext context = (ConnContext)AsyncState;
string json = JsonConvert.SerializeObject(retdata); json = JsonConvert.SerializeObject(retdata);
CurrObjSys.PushCallFunctionEx( CurrObjSys.PushCallFunctionEx(
context.from, context.from,
......
...@@ -11,14 +11,7 @@ namespace FLY.Thick.Blowing.Server ...@@ -11,14 +11,7 @@ namespace FLY.Thick.Blowing.Server
{ {
public class BlowingFixProfile: IBlowingFixProfileService public class BlowingFixProfile: IBlowingFixProfileService
{ {
BlowingFixProfileParam param = new BlowingFixProfileParam(); public BlowingFixProfileParam Param { get; } = new BlowingFixProfileParam();
public BlowingFixProfileParam Param
{
get
{
return param;
}
}
public BlowingFixProfile() public BlowingFixProfile()
{ {
......
...@@ -207,10 +207,9 @@ namespace FLY.Thick.Blowing.Server ...@@ -207,10 +207,9 @@ namespace FLY.Thick.Blowing.Server
//--------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------
//GM_RenZiJiaFix_Create //GM_RenZiJiaFix_Create
mGMRenZiJiaFix = new GM_BlowingFix(mFlyAD); mGMRenZiJiaFix = new GM_BlowingFix(mFlyAD);
Misc.BindingOperations.SetBinding(mProfile.Param, "SolveEnable", mGMRenZiJiaFix, "SolveEnable"); Misc.BindingOperations.SetBinding(mProfile.Param, "MMode", mGMRenZiJiaFix, "MMode");
Misc.BindingOperations.SetBinding(mProfile.Param, "FilmWidth", mGMRenZiJiaFix, "FilmWidth"); Misc.BindingOperations.SetBinding(mProfile.Param, "FilmWidth", mGMRenZiJiaFix, "FilmWidth");
Misc.BindingOperations.SetBinding(mProfile.Param, "FilmPosH", mGMRenZiJiaFix, "FilmPosH"); Misc.BindingOperations.SetBinding(mProfile.Param, "FilmPosH", mGMRenZiJiaFix, "FilmPosH");
Misc.BindingOperations.SetBinding(mProfile.Param, "IsBag", mGMRenZiJiaFix, "IsBag");
Misc.BindingOperations.SetBinding(mProfile.Param, "BagFold0", mGMRenZiJiaFix, "BagFold0"); Misc.BindingOperations.SetBinding(mProfile.Param, "BagFold0", mGMRenZiJiaFix, "BagFold0");
Misc.BindingOperations.SetBinding(mProfile.Param, "BagFold1", mGMRenZiJiaFix, "BagFold1"); Misc.BindingOperations.SetBinding(mProfile.Param, "BagFold1", mGMRenZiJiaFix, "BagFold1");
......
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