PLCSet.xaml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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.Resources>
  12. <Style TargetType="TextBox">
  13. <Setter Property="Height" Value="25"/>
  14. <Setter Property="VerticalContentAlignment" Value="Center"/>
  15. </Style>
  16. </Window.Resources>
  17. <Window.DataContext>
  18. <viewmodels:PLCSetViewModel/>
  19. </Window.DataContext>
  20. <Grid Background="White">
  21. <Grid.RowDefinitions>
  22. <RowDefinition Height="30"/>
  23. <RowDefinition Height="30"/>
  24. <RowDefinition Height="*"/>
  25. </Grid.RowDefinitions>
  26. <WrapPanel Grid.Row="0" Orientation="Horizontal">
  27. <Label Content="IP地址:"/>
  28. <TextBox x:Name="PlcIpAddress" DockPanel.Dock="Left" Width="120"/>
  29. <Label Content="端口号:"/>
  30. <TextBox x:Name="PlcPort" DockPanel.Dock="Left" Width="120"/>
  31. <My:MButton Type="Primary" x:Name="BtnChangeIpAndPort" Content="修改IP地址端口号" Click="BtnChangeIpAndPort_Click" />
  32. <My:MButton Type="Primary" x:Name="BtnConnectPLC" Content="连接PLC" Click="BtnConnectPLC_Click" />
  33. <My:MButton Type="Primary" x:Name="BtnStartPlcLogMonitor" Content="开启PLC监控" Click="BtnStartPlcLogMonitor_Click" />
  34. <My:MButton Type="Primary" x:Name="BtnDisConnectPLC" Content="断开PLC连接" Click="BtnDisConnectPLC_Click" />
  35. </WrapPanel>
  36. <WrapPanel Grid.Row="1" Orientation="Horizontal" VerticalAlignment="Center">
  37. <Label Content="PLC地址:"/>
  38. <TextBox x:Name="PlcAddress" DockPanel.Dock="Left" Width="100"/>
  39. <Label Content="写入值:"/>
  40. <TextBox x:Name="TxbWriteValue" DockPanel.Dock="Left" Width="150"/>
  41. <Label Content="长度:"/>
  42. <TextBox x:Name="DataLength" DockPanel.Dock="Left" Text="1" Width="50"/>
  43. <Label Content="数据类型:"/>
  44. <My:MComboBox x:Name="CmbDataType" DockPanel.Dock="Left" Width="100"/>
  45. <CheckBox x:Name="IsBatch" Content="批量" Width="50" VerticalAlignment="Center"/>
  46. <My:MButton Type="Primary" x:Name="BtnReadPLC" Content="读取" Click="BtnReadPLC_Click" />
  47. <My:MButton Type="Primary" x:Name="BtnWritePLC" Content="写入" Click="BtnWritePLC_Click" />
  48. </WrapPanel>
  49. <RichTextBox x:Name="RtbRunLog" Grid.Row="2">
  50. <FlowDocument>
  51. </FlowDocument>
  52. </RichTextBox>
  53. </Grid>
  54. </My:MWindow>