Commit 2345c155 authored by 潘栩锋's avatar 潘栩锋 🚴

分离中心收卷主界面,与表面收卷主界面

parent c5fb85fb
...@@ -72,6 +72,10 @@ ...@@ -72,6 +72,10 @@
<Compile Include="PgInterstitialParam\PgInterstitialParam.xaml.cs"> <Compile Include="PgInterstitialParam\PgInterstitialParam.xaml.cs">
<DependentUpon>PgInterstitialParam.xaml</DependentUpon> <DependentUpon>PgInterstitialParam.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="UiModule\MainPanel\MainPanel2.xaml.cs">
<DependentUpon>MainPanel2.xaml</DependentUpon>
</Compile>
<Compile Include="UiModule\MainPanel\UiModule2_MainPanel2.cs" />
<Compile Include="UiModule\MainPanel\UiModule2_MainPanel.cs" /> <Compile Include="UiModule\MainPanel\UiModule2_MainPanel.cs" />
<Compile Include="UiModule\CenterWinderPanel\CenterWinderPanel.xaml.cs"> <Compile Include="UiModule\CenterWinderPanel\CenterWinderPanel.xaml.cs">
<DependentUpon>CenterWinderPanel.xaml</DependentUpon> <DependentUpon>CenterWinderPanel.xaml</DependentUpon>
...@@ -89,6 +93,9 @@ ...@@ -89,6 +93,9 @@
<Compile Include="UiModule\VelocityCtrlPanel\VelocityCtrlPanel.xaml.cs"> <Compile Include="UiModule\VelocityCtrlPanel\VelocityCtrlPanel.xaml.cs">
<DependentUpon>VelocityCtrlPanel.xaml</DependentUpon> <DependentUpon>VelocityCtrlPanel.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="UiModule\WdManual\WdManual2.xaml.cs">
<DependentUpon>WdManual2.xaml</DependentUpon>
</Compile>
<Compile Include="UiModule\WdMeasure.xaml.cs"> <Compile Include="UiModule\WdMeasure.xaml.cs">
<DependentUpon>WdMeasure.xaml</DependentUpon> <DependentUpon>WdMeasure.xaml</DependentUpon>
</Compile> </Compile>
...@@ -138,6 +145,10 @@ ...@@ -138,6 +145,10 @@
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</Page> </Page>
<Page Include="UiModule\MainPanel\MainPanel2.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="UiModule\MainPanel\MainPanelStyle.xaml"> <Page Include="UiModule\MainPanel\MainPanelStyle.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
...@@ -170,6 +181,10 @@ ...@@ -170,6 +181,10 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="UiModule\WdManual\WdManual2.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="UiModule\WdManual\WdManualStyle.xaml"> <Page Include="UiModule\WdManual\WdManualStyle.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
......
...@@ -45,17 +45,10 @@ namespace FLY.Winder.UI.Client.UiModule ...@@ -45,17 +45,10 @@ namespace FLY.Winder.UI.Client.UiModule
winderSystem.PLCos, winderSystem.PLCos,
winderSystem.Items[i], winderSystem.Items[i],
new string[] { new string[] {
"IsTongAuto",
"TurnoverInching", "TurnoverInching",
"CuttingFilm", "CuttingFilm",
"TurnoverOrg", "TurnoverOrg",
"PressureArmOffset", "PressureArmOffset"});
"PushRod",
"TongLoosen",
"TongUp",
"TongDown",
"TongIn",
"TongOut" });
} }
} }
......
...@@ -16,7 +16,7 @@ namespace FLY.Winder.UI.Client.UiModule ...@@ -16,7 +16,7 @@ namespace FLY.Winder.UI.Client.UiModule
/// 控件标题 /// 控件标题
/// 它的值取决于culture /// 它的值取决于culture
/// </summary> /// </summary>
public string Title=>"中心收卷"; public string Title=>"中心收卷设置";
public ComponentType Type => ComponentType.Graph; public ComponentType Type => ComponentType.Graph;
public bool IsUnique => true; public bool IsUnique => true;
/// <summary> /// <summary>
......
using FLY.OBJComponents.Client;
using FLY.Winder.Common;
using FLY.Winder.IService;
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.Navigation;
using System.Windows.Shapes;
using Unity;
namespace FLY.Winder.UI.Client.UiModule
{
/// <summary>
/// MainPanel.xaml 的交互逻辑
/// </summary>
public partial class MainPanel2 : UserControl
{
IUnityContainer container;
IWinderSystemService winderSystem;
SetPLCUpdatePlan setPlan_accessory;
SetPLCUpdatePlan[] setPlan_winders = new SetPLCUpdatePlan[2];
public MainPanel2()
{
InitializeComponent();
}
[InjectionMethod]
public void Init(
IUnityContainer container,
IWinderSystemService winderSystem)
{
this.container = container;
this.winderSystem = winderSystem;
this.DataContext = winderSystem;
grid_winder.DataContext = winderSystem;
//注册属性更新计划
setPlan_accessory = new SetPLCUpdatePlan(
winderSystem.PLCos,
winderSystem.Accessory,
new string[] {
"VelocitySet",
"IsVelocityChanged",
"Velocity",
"RotaryFreqSet",
"IsRotaryFreqChanged",
"RotaryCurrent",
"RotaryFreq",
"IsRotaryOn",
"IsRotaryOrg",
"IsRotaryForw",
"IsRotaryBackw",
"IsRotaryForwLimit",
"IsRotaryForwTurn",
"IsRotaryOrgSign",
"IsRotaryBackwLimit",
"IsRotaryBackwTurn",
"Traction1Current",
"IsTraction1On",
"IsTraction2Manual",
"Traction2TensionKgSet",
"Traction2TensionKg",
"Traction2Current",
"IsTraction2Manual",
"IsTraction2On"
});
for (int i = 0; i < 2; i++)
{
setPlan_winders[i] = new SetPLCUpdatePlan(
winderSystem.PLCos,
winderSystem.Items[i],
new string[] {
"MeasureLenSet",
"MeasurePreWarning",
"MeasureLen",
"MeasureStop",
"TensionKgSet",
"TensionKg",
"Current",
"IsManual",
"IsOn"
});
}
}
private void button_v_set_Click(object sender, RoutedEventArgs e)
{
var w = container.Resolve<WdVelocity>();
w.Owner = FLY.ControlLibrary.COMMON.GetWindow(this);
w.ShowDialog();
}
private void button_manual_Click(object sender, RoutedEventArgs e)
{
var w = container.Resolve<WdManual2>();
w.Owner = FLY.ControlLibrary.COMMON.GetWindow(this);
w.ShowDialog();
}
private void button_freq_Click(object sender, RoutedEventArgs e)
{
var w = container.Resolve<WdFreq>();
w.Owner = FLY.ControlLibrary.COMMON.GetWindow(this);
w.ShowDialog();
}
private void button_measure_Click(object sender, RoutedEventArgs e)
{
Button button = sender as Button;
WinderInsideOutside item = (WinderInsideOutside)(button.Tag);
WdMeasure w = new WdMeasure();
w.Init((int)(item.MeasureLenSet), (int)(item.MeasurePreWarning));
w.Owner = FLY.ControlLibrary.COMMON.GetWindow(this);
if (w.ShowDialog() == true)
{
item.MeasureLenSet = w.viewmodel.MeasureLenSet;
item.MeasurePreWarning = w.viewmodel.MeasurePreWarning;
}
}
}
}
...@@ -26,9 +26,9 @@ namespace FLY.Winder.UI.Client.UiModule ...@@ -26,9 +26,9 @@ namespace FLY.Winder.UI.Client.UiModule
/// <returns></returns> /// <returns></returns>
public FrameworkElement GetComponent(int id, IUnityContainer container) public FrameworkElement GetComponent(int id, IUnityContainer container)
{ {
MainPanel graph = new MainPanel(); var p = container.Resolve<MainPanel>();
container.BuildUp(graph);
return graph; return p;
} }
/// <summary> /// <summary>
......
using MultiLayout.UiModule;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using Unity;
namespace FLY.Winder.UI.Client.UiModule
{
public class UiModule2_MainPanel2 : IUiModule2
{
/// <summary>
/// 控件标题
/// 它的值取决于culture
/// </summary>
public string Title=>"中心收卷主界面";
public ComponentType Type => ComponentType.Graph;
public bool IsUnique => true;
/// <summary>
/// 控件
/// 创建时,需要给它唯一ID,让加载自己的数据
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public FrameworkElement GetComponent(int id, IUnityContainer container)
{
var p = container.Resolve<MainPanel2>();
return p;
}
/// <summary>
/// 控件缩略图,用于编辑界面时,大致看看
/// 创建时,需要给它唯一ID,让加载自己的数据
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public FrameworkElement GetThumbnail()
{
return new System.Windows.Controls.Grid();
}
/// <summary>
/// 给出全部控件ID, 控件自行删除没有的参数
/// </summary>
/// <param name="IDs"></param>
public void MatchParam(int[] IDs)
{
}
}
}
using FLY.OBJComponents.Client;
using FLY.Winder.IService;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
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;
using Unity;
namespace FLY.Winder.UI.Client.UiModule
{
/// <summary>
/// Window_Frequency.xaml 的交互逻辑
/// </summary>
public partial class WdManual2 : FLY.ControlLibrary.WindowBigClose
{
IWinderSystemService winderSystem;
SetPLCUpdatePlan[] setPlan_winders = new SetPLCUpdatePlan[2];
public WdManual2()
{
InitializeComponent();
}
[InjectionMethod]
public void Init(
IWinderSystemService winderSystem)
{
this.winderSystem = winderSystem;
this.DataContext = winderSystem;
//IsTongAuto
//注册属性更新计划
for (int i = 0; i < 2; i++)
{
setPlan_winders[i] = new SetPLCUpdatePlan(
winderSystem.PLCos,
winderSystem.Items[i],
new string[] {
"IsTongAuto",
"TurnoverInching",
"CuttingFilm",
"TurnoverOrg",
"PressureArmOffset",
"PushRod",
"TongLoosen",
"TongUp",
"TongDown",
"TongIn",
"TongOut" });
}
}
private void WindowBigClose_Unloaded(object sender, RoutedEventArgs e)
{
for (int i = 0; i < 2; i++)
{
setPlan_winders[i].Dispose();
}
}
}
}
...@@ -4,10 +4,11 @@ ...@@ -4,10 +4,11 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:flyctrllib="clr-namespace:FLY.ControlLibrary;assembly=FLY.ControlLibrary" xmlns:flyctrllib="clr-namespace:FLY.ControlLibrary;assembly=FLY.ControlLibrary"
xmlns:local="clr-namespace:FLY.Winder.UI.Client" xmlns:iCommon="clr-namespace:FLY.Winder.Common;assembly=FLY.Winder"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors" d:DataContext="{d:DesignInstance iCommon:WinderAccessory}"
xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
mc:Ignorable="d" mc:Ignorable="d"
Title="Window_Frequency" WindowStartupLocation="CenterScreen" d:DesignWidth="334.492" d:DesignHeight="318.246" > Title="Window_Frequency" WindowStartupLocation="CenterScreen" SizeToContent="WidthAndHeight" >
<Window.Resources> <Window.Resources>
<ResourceDictionary> <ResourceDictionary>
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
...@@ -15,37 +16,43 @@ ...@@ -15,37 +16,43 @@
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
</ResourceDictionary> </ResourceDictionary>
</Window.Resources> </Window.Resources>
<StackPanel Orientation="Vertical" Margin="5,20"> <StackPanel Margin="5,20">
<StackPanel Orientation="Vertical" Margin="5"> <StackPanel Margin="5">
<TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldHeader}" Text="速度设置" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="44" /> <TextBlock Style="{StaticResource TextBlockStyle_FieldHeader}" Text="速度设置" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="44" />
</StackPanel> </StackPanel>
<Grid > <Grid >
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/> <ColumnDefinition Width="auto"/>
<ColumnDefinition Width="auto"/> <ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal" Grid.Column="1"> <StackPanel Margin="5">
<TextBlock Style="{StaticResource TextBlockStyle_FieldHeaderEditable}" Text="设定速度" />
<StackPanel Orientation="Vertical" Margin="5"> <StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldHeaderEditable}" Text="设定速度" /> <TextBox Style="{StaticResource TextBoxStyle_FieldContent}" Text="{Binding VelocitySet,StringFormat={}{0:F1}}" MinWidth="60"/>
<StackPanel Orientation="Horizontal"> <TextBlock Style="{StaticResource TextBlockStyle_FieldContent_mm}" Text="m/min" />
<TextBox Style="{StaticResource ResourceKey=TextBoxStyle_FieldContent}" Text="{Binding VelocitySet,StringFormat={}{0:F1}}"/>
<TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldContent_mm}" Text="m/min" />
</StackPanel>
</StackPanel> </StackPanel>
<Button Style="{StaticResource ButtonStyle_empty}" Background="Transparent" Click="button_minus_Click" Margin="5">
<Path Data="{StaticResource Geometry_minus-circle}" Fill="{StaticResource Color_theme_activity}" Stretch="Fill" Height="80" Width="80" />
</Button>
<Button Style="{StaticResource ButtonStyle_empty}" Background="Transparent" Click="button_plus_Click" Margin="5">
<Path Data="{StaticResource Geometry_plus-circle}" Fill="{StaticResource Color_theme_activity}" Stretch="Fill" Height="80" Width="80" />
</Button>
</StackPanel> </StackPanel>
</Grid> </Grid>
<Button x:Name="button_ok" Style="{StaticResource ButtonStyle2}" Content="确定" Width="auto" Margin="5" Click="button_ok_Click" > <StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
<i:Interaction.Behaviors> <Button Style="{StaticResource ButtonStyle_largeIcon}" Foreground="{StaticResource AccentColorBrush}"
<flyctrllib:ResetBehavior Binding="{Binding Accessory.IsVelocityChanged}"/> VerticalAlignment="Top"
</i:Interaction.Behaviors> Click="btnPlusClick" >
</Button> <Grid Style="{StaticResource GridStyle_ButtonShadow}">
<Ellipse Fill="{StaticResource WhiteBrush}" Stretch="Fill" Margin="1"/>
<iconPacks:PackIconMaterial Kind="PlusCircle" Width="60"/>
</Grid>
</Button>
<Button Style="{StaticResource ButtonStyle_largeIcon}" Foreground="{StaticResource ValidationSummaryColor5}"
VerticalAlignment="Top"
Click="btnMinusClick" >
<Grid Style="{StaticResource GridStyle_ButtonShadow}">
<Ellipse Fill="{StaticResource WhiteBrush}" Stretch="Fill" Margin="1"/>
<iconPacks:PackIconMaterial Kind="MinusCircle" Width="60">
</iconPacks:PackIconMaterial>
</Grid>
</Button>
</StackPanel>
</StackPanel> </StackPanel>
</flyctrllib:WindowBigClose> </flyctrllib:WindowBigClose>
...@@ -33,29 +33,20 @@ namespace FLY.Winder.UI.Client.UiModule ...@@ -33,29 +33,20 @@ namespace FLY.Winder.UI.Client.UiModule
IWinderSystemService winderSystem) IWinderSystemService winderSystem)
{ {
this.winderSystem = winderSystem; this.winderSystem = winderSystem;
this.DataContext = winderSystem; this.DataContext = winderSystem.Accessory;
} }
private void button_minus_Click(object sender, RoutedEventArgs e)
{
if (winderSystem.Accessory.VelocitySet >= 0.1)
{
winderSystem.Accessory.VelocitySet -= 0.1f;
}
}
private void button_plus_Click(object sender, RoutedEventArgs e) private void btnPlusClick(object sender, RoutedEventArgs e)
{ {
if (winderSystem.Accessory.VelocitySet < 200) if (winderSystem.Accessory.VelocitySet < 200)
winderSystem.Accessory.VelocitySet += 0.1f; winderSystem.Accessory.VelocitySet += 0.1f;
} }
private void button_ok_Click(object sender, RoutedEventArgs e) private void btnMinusClick(object sender, RoutedEventArgs e)
{ {
this.DialogResult = true; if (winderSystem.Accessory.VelocitySet >= 0.1)
this.Close(); winderSystem.Accessory.VelocitySet -= 0.1f;
} }
} }
} }
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