181 lines
8.4 KiB
XML
181 lines
8.4 KiB
XML
<hc:GlowWindow
|
|
x:Class="Sinvo.EplanHpD.Plugin.WPFUI.View.LayoutHelperWindow"
|
|
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:hc="https://handyorg.github.io/handycontrol"
|
|
xmlns:local="clr-namespace:Sinvo.EplanHpD.Plugin.WPFUI.View"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:viewmodel="clr-namespace:Sinvo.EplanHpD.Plugin.WPFUI.ViewModel"
|
|
Title="布线助手"
|
|
Width="450"
|
|
Height="260"
|
|
MinWidth="450"
|
|
MinHeight="260"
|
|
d:DataContext="{d:DesignInstance Type=viewmodel:LayoutHelperViewModel}"
|
|
ActiveGlowColor="{DynamicResource PrimaryColor}"
|
|
Background="White"
|
|
Left="1460"
|
|
Loaded="GlowWindow_Loaded"
|
|
Top="770"
|
|
WindowStartupLocation="Manual"
|
|
mc:Ignorable="d">
|
|
<Window.Resources>
|
|
<ResourceDictionary>
|
|
<ResourceDictionary.MergedDictionaries>
|
|
<ResourceDictionary Source="pack://application:,,,/Sinvo.EplanHpD.Plugin.WPFUI;component/Themes/Theme.xaml" />
|
|
</ResourceDictionary.MergedDictionaries>
|
|
</ResourceDictionary>
|
|
</Window.Resources>
|
|
<Border Background="{DynamicResource MainContentForegroundDrawingBrush}">
|
|
<Grid x:Name="MainGrid" Margin="2">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="15" />
|
|
<RowDefinition Height="30" />
|
|
<RowDefinition Height="*" />
|
|
<RowDefinition Height="30" />
|
|
<RowDefinition Height="30" />
|
|
</Grid.RowDefinitions>
|
|
<ScrollViewer
|
|
Grid.Row="0"
|
|
Grid.RowSpan="2"
|
|
HorizontalAlignment="Right"
|
|
Panel.ZIndex="99"
|
|
VerticalScrollBarVisibility="Hidden">
|
|
<StackPanel
|
|
x:Name="GrowlParent"
|
|
Margin="5"
|
|
VerticalAlignment="Top"
|
|
Panel.ZIndex="99" />
|
|
</ScrollViewer>
|
|
<Grid Grid.Row="0" Grid.RowSpan="2">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="15" />
|
|
<RowDefinition Height="30" />
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="60" />
|
|
</Grid.ColumnDefinitions>
|
|
<hc:SimpleStackPanel Grid.Row="0" Orientation="Horizontal">
|
|
<!--<TextBlock FontSize="14" TextWrapping="Wrap">
|
|
<Run Text="选中的电机:" />
|
|
<Run Foreground="{StaticResource DangerBrush}" Text="{Binding SelectMotorModel}" />
|
|
</TextBlock>-->
|
|
<TextBlock
|
|
Margin="0,0,0,0"
|
|
FontSize="14"
|
|
TextWrapping="Wrap">
|
|
<Run Text="当前布线的电机:" />
|
|
<Run Foreground="{StaticResource DangerBrush}" Text="{Binding Motor.MotorModelStr}" />
|
|
<Run Text=" " />
|
|
<Run Text="轴号:" />
|
|
<Run Foreground="{StaticResource DangerBrush}" Text="{Binding SelectedLine.AxisNo}" />
|
|
</TextBlock>
|
|
</hc:SimpleStackPanel>
|
|
<StackPanel Grid.Row="1" VerticalAlignment="Center">
|
|
<TextBlock VerticalAlignment="Center" FontSize="14">
|
|
<Run Text="当前线段:" />
|
|
<Run Foreground="{StaticResource DangerBrush}" Text="{Binding SelectedLine.CableConnectionClass}" />
|
|
<Run Text=" " />
|
|
<Run Text="当前线类型:" />
|
|
<Run Foreground="{StaticResource DangerBrush}" Text="{Binding SelectedLine.CableType}" />
|
|
</TextBlock>
|
|
</StackPanel>
|
|
<Button
|
|
Grid.Row="0"
|
|
Grid.RowSpan="2"
|
|
Grid.Column="1"
|
|
Margin="0"
|
|
Padding="5"
|
|
Click="ToMotorBtn_Click"
|
|
Content="转到电机"
|
|
FontSize="12"
|
|
Style="{StaticResource ButtonPrimary}" />
|
|
</Grid>
|
|
<ListView
|
|
Grid.Row="2"
|
|
hc:GridViewAttach.ColumnHeaderHeight="10"
|
|
ItemsSource="{Binding SubLines}"
|
|
Style="{StaticResource ListView.Small}">
|
|
<ListView.ItemContainerStyle>
|
|
<Style BasedOn="{StaticResource ListViewItemBaseStyle.Small}" TargetType="ListViewItem">
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding IsChecked}" Value="True">
|
|
<Setter Property="Background" Value="#18a05d" />
|
|
<Setter Property="Foreground" Value="White" />
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</ListView.ItemContainerStyle>
|
|
<ListView.View>
|
|
<GridView>
|
|
<GridViewColumn
|
|
Width="80"
|
|
DisplayMemberBinding="{Binding CableType}"
|
|
Header="线类型" />
|
|
<GridViewColumn Width="330" Header="线型号">
|
|
<GridViewColumn.CellTemplate>
|
|
<DataTemplate>
|
|
<TextBox
|
|
Width="300"
|
|
MaxWidth="300"
|
|
GotFocus="TextBox_GotFocus"
|
|
IsReadOnly="True"
|
|
Text="{Binding CableModel}" />
|
|
</DataTemplate>
|
|
</GridViewColumn.CellTemplate>
|
|
</GridViewColumn>
|
|
<!--<GridViewColumn Width="230" Header="操作">
|
|
<GridViewColumn.CellTemplate>
|
|
<DataTemplate>
|
|
<Button
|
|
Click="InsertCableBtn_Click"
|
|
Content="插入电缆"
|
|
Style="{StaticResource ButtonPrimary}"
|
|
Tag="{Binding CableModel}" />
|
|
</DataTemplate>
|
|
</GridViewColumn.CellTemplate>
|
|
</GridViewColumn>-->
|
|
</GridView>
|
|
</ListView.View>
|
|
</ListView>
|
|
<hc:SimpleStackPanel Grid.Row="3">
|
|
<TextBlock TextWrapping="Wrap">
|
|
<Run Text="选中的线:" />
|
|
</TextBlock>
|
|
<TextBlock>
|
|
<Run Text="{Binding SelectLineName}" />
|
|
</TextBlock>
|
|
</hc:SimpleStackPanel>
|
|
<hc:SimpleStackPanel Grid.Row="4" VerticalAlignment="Bottom">
|
|
<DockPanel HorizontalAlignment="Stretch">
|
|
<Button
|
|
Click="PrevBtn_Click"
|
|
Content="上一根线"
|
|
DockPanel.Dock="Left"
|
|
IsEnabled="{Binding HasPrev}"
|
|
Style="{StaticResource ButtonDanger}" />
|
|
<Button
|
|
HorizontalAlignment="Right"
|
|
Click="NextBtn_Click"
|
|
Content="下一根线"
|
|
DockPanel.Dock="Right"
|
|
IsEnabled="{Binding HasNext}"
|
|
Style="{StaticResource ButtonPrimary}" />
|
|
<Button
|
|
Click="AxisNoAndLineBtn_Click"
|
|
DockPanel.Dock="Right"
|
|
Style="{StaticResource ButtonSuccess}">
|
|
<TextBlock>
|
|
<Run Text="{Binding SelectedLine.AxisNo}" />
|
|
<Run Text="-" />
|
|
<Run Text="{Binding SelectedLine.CurrentLine}" />
|
|
</TextBlock>
|
|
</Button>
|
|
</DockPanel>
|
|
</hc:SimpleStackPanel>
|
|
</Grid>
|
|
</Border>
|
|
</hc:GlowWindow>
|