PLCSet.xaml 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <My:MWindow xmlns:My="clr-namespace:MyWPFControl.Controls;assembly=MyWPFControl"
  2. x:Class="B20UVLog.Windows.PLCSet"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  7. xmlns:local="clr-namespace:B20UVLog.Windows" xmlns:viewmodels="clr-namespace:B20UVLog.ViewModels"
  8. mc:Ignorable="d"
  9. WindowStyle="ToolWindow" WindowStartupLocation="CenterScreen"
  10. Title="PLC配置" Height="600" Width="1200">
  11. <Window.DataContext>
  12. <viewmodels:PLCSetViewModel/>
  13. </Window.DataContext>
  14. <Grid Background="White">
  15. <Grid.Resources>
  16. <Style TargetType="TextBlock" BasedOn="{StaticResource TextBlockStyle}">
  17. <Setter Property="Margin" Value="10 0 0 0"/>
  18. </Style>
  19. </Grid.Resources>
  20. <Grid.RowDefinitions>
  21. <RowDefinition Height="auto"/>
  22. <RowDefinition Height="auto"/>
  23. <RowDefinition Height="*"/>
  24. </Grid.RowDefinitions>
  25. <WrapPanel Grid.Row="0" Orientation="Horizontal">
  26. <TextBlock Text="IP地址:"/>
  27. <My:MTextBox x:Name="PlcIpAddress" DockPanel.Dock="Left"/>
  28. <TextBlock Text="端口号:"/>
  29. <My:MTextBox x:Name="PlcPort" DockPanel.Dock="Left"/>
  30. <My:MButton Type="Primary" x:Name="BtnChangeIpAndPort" Content="修改IP地址端口号" Click="BtnChangeIpAndPort_Click" />
  31. <My:MButton Type="Primary" x:Name="BtnConnectPLC" Content="连接PLC" Click="BtnConnectPLC_Click" />
  32. <My:MButton Type="Primary" x:Name="BtnStartPlcLogMonitor" Content="开启PLC监控" Click="BtnStartPlcLogMonitor_Click" />
  33. <My:MButton Type="Primary" x:Name="BtnDisConnectPLC" Content="断开PLC连接" Click="BtnDisConnectPLC_Click" />
  34. </WrapPanel>
  35. <WrapPanel Grid.Row="1" Orientation="Horizontal" VerticalAlignment="Center">
  36. <TextBlock Text="PLC地址:"/>
  37. <My:MTextBox x:Name="PlcAddress" DockPanel.Dock="Left" />
  38. <TextBlock Text="写入值:"/>
  39. <My:MTextBox x:Name="TxbWriteValue" DockPanel.Dock="Left" />
  40. <TextBlock Text="长度:"/>
  41. <My:MNumBox x:Name="DataLength" DockPanel.Dock="Left" Text="1" Width="110"/>
  42. <TextBlock Text="数据类型:"/>
  43. <My:MComboBox x:Name="CmbDataType" DockPanel.Dock="Left" Width="100"/>
  44. <My:MCheckBox x:Name="IsBatch" Content="批量"/>
  45. <My:MButton Type="Primary" x:Name="BtnReadPLC" Content="读取" Click="BtnReadPLC_Click" />
  46. <My:MButton Type="Primary" x:Name="BtnWritePLC" Content="写入" Click="BtnWritePLC_Click" />
  47. </WrapPanel>
  48. <RichTextBox x:Name="RtbRunLog" Grid.Row="2">
  49. <FlowDocument>
  50. </FlowDocument>
  51. </RichTextBox>
  52. </Grid>
  53. </My:MWindow>