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

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

parent c5fb85fb
......@@ -72,6 +72,10 @@
<Compile Include="PgInterstitialParam\PgInterstitialParam.xaml.cs">
<DependentUpon>PgInterstitialParam.xaml</DependentUpon>
</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\CenterWinderPanel\CenterWinderPanel.xaml.cs">
<DependentUpon>CenterWinderPanel.xaml</DependentUpon>
......@@ -89,6 +93,9 @@
<Compile Include="UiModule\VelocityCtrlPanel\VelocityCtrlPanel.xaml.cs">
<DependentUpon>VelocityCtrlPanel.xaml</DependentUpon>
</Compile>
<Compile Include="UiModule\WdManual\WdManual2.xaml.cs">
<DependentUpon>WdManual2.xaml</DependentUpon>
</Compile>
<Compile Include="UiModule\WdMeasure.xaml.cs">
<DependentUpon>WdMeasure.xaml</DependentUpon>
</Compile>
......@@ -138,6 +145,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="UiModule\MainPanel\MainPanel2.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="UiModule\MainPanel\MainPanelStyle.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
......@@ -170,6 +181,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UiModule\WdManual\WdManual2.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="UiModule\WdManual\WdManualStyle.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
......
......@@ -45,17 +45,10 @@ namespace FLY.Winder.UI.Client.UiModule
winderSystem.PLCos,
winderSystem.Items[i],
new string[] {
"IsTongAuto",
"TurnoverInching",
"CuttingFilm",
"TurnoverOrg",
"PressureArmOffset",
"PushRod",
"TongLoosen",
"TongUp",
"TongDown",
"TongIn",
"TongOut" });
"PressureArmOffset"});
}
}
......
......@@ -16,7 +16,7 @@ namespace FLY.Winder.UI.Client.UiModule
/// 控件标题
/// 它的值取决于culture
/// </summary>
public string Title=>"中心收卷";
public string Title=>"中心收卷设置";
public ComponentType Type => ComponentType.Graph;
public bool IsUnique => true;
/// <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
/// <returns></returns>
public FrameworkElement GetComponent(int id, IUnityContainer container)
{
MainPanel graph = new MainPanel();
container.BuildUp(graph);
return graph;
var p = container.Resolve<MainPanel>();
return p;
}
/// <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 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:flyctrllib="clr-namespace:FLY.ControlLibrary;assembly=FLY.ControlLibrary"
xmlns:local="clr-namespace:FLY.Winder.UI.Client"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
xmlns:iCommon="clr-namespace:FLY.Winder.Common;assembly=FLY.Winder"
d:DataContext="{d:DesignInstance iCommon:WinderAccessory}"
xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
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>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
......@@ -15,37 +16,43 @@
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>
<StackPanel Orientation="Vertical" Margin="5,20">
<StackPanel Margin="5,20">
<StackPanel Orientation="Vertical" Margin="5">
<TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldHeader}" Text="速度设置" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="44" />
<StackPanel Margin="5">
<TextBlock Style="{StaticResource TextBlockStyle_FieldHeader}" Text="速度设置" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="44" />
</StackPanel>
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal" Grid.Column="1">
<StackPanel Orientation="Vertical" Margin="5">
<TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldHeaderEditable}" Text="设定速度" />
<StackPanel Margin="5">
<TextBlock Style="{StaticResource TextBlockStyle_FieldHeaderEditable}" Text="设定速度" />
<StackPanel Orientation="Horizontal">
<TextBox Style="{StaticResource ResourceKey=TextBoxStyle_FieldContent}" Text="{Binding VelocitySet,StringFormat={}{0:F1}}"/>
<TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldContent_mm}" Text="m/min" />
<TextBox Style="{StaticResource TextBoxStyle_FieldContent}" Text="{Binding VelocitySet,StringFormat={}{0:F1}}" MinWidth="60"/>
<TextBlock Style="{StaticResource TextBlockStyle_FieldContent_mm}" Text="m/min" />
</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" />
</Grid>
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
<Button Style="{StaticResource ButtonStyle_largeIcon}" Foreground="{StaticResource AccentColorBrush}"
VerticalAlignment="Top"
Click="btnPlusClick" >
<Grid Style="{StaticResource GridStyle_ButtonShadow}">
<Ellipse Fill="{StaticResource WhiteBrush}" Stretch="Fill" Margin="1"/>
<iconPacks:PackIconMaterial Kind="PlusCircle" Width="60"/>
</Grid>
</Button>
</StackPanel>
<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 x:Name="button_ok" Style="{StaticResource ButtonStyle2}" Content="确定" Width="auto" Margin="5" Click="button_ok_Click" >
<i:Interaction.Behaviors>
<flyctrllib:ResetBehavior Binding="{Binding Accessory.IsVelocityChanged}"/>
</i:Interaction.Behaviors>
</Button>
</StackPanel>
</StackPanel>
</flyctrllib:WindowBigClose>
......@@ -33,29 +33,20 @@ namespace FLY.Winder.UI.Client.UiModule
IWinderSystemService 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)
winderSystem.Accessory.VelocitySet += 0.1f;
}
private void button_ok_Click(object sender, RoutedEventArgs e)
private void btnMinusClick(object sender, RoutedEventArgs e)
{
this.DialogResult = true;
this.Close();
if (winderSystem.Accessory.VelocitySet >= 0.1)
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