AddRobotDialog.xaml 5.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <hc:Window x:Class="TeamAAS.Views.AddRobotDialog"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:hc="https://handyorg.github.io/handycontrol" xmlns:loc="clr-namespace:TeamAAS.Localization"
  5. Title="{loc:Translate '添加机器人'}"
  6. Width="400" Height="458"
  7. WindowStartupLocation="CenterOwner"
  8. ResizeMode="NoResize"
  9. Background="{DynamicResource RegionBrush}">
  10. <Grid Margin="24,20">
  11. <Grid.RowDefinitions>
  12. <RowDefinition Height="Auto"/>
  13. <RowDefinition Height="100*"/>
  14. <RowDefinition Height="50"/>
  15. </Grid.RowDefinitions>
  16. <!-- Title -->
  17. <TextBlock Grid.Row="0" Text="{loc:Translate '🤖 添加机器人'}" FontSize="18" FontWeight="Bold"
  18. Foreground="{DynamicResource PrimaryTextBrush}" Margin="0,0,0,24"/>
  19. <ScrollViewer Grid.Row="1">
  20. <!-- Form -->
  21. <StackPanel Orientation="Vertical">
  22. <!-- Name -->
  23. <TextBlock Text="{loc:Translate '名称'}" FontSize="13" Margin="0,0,0,4" Foreground="{DynamicResource SecondaryTextBrush}"/>
  24. <TextBox x:Name="txtName" Text="{loc:Translate '机器人 1'}" FontSize="13" Padding="8,6" Margin="0,0,0,16"/>
  25. <!-- Brand -->
  26. <TextBlock Text="{loc:Translate '品牌'}" FontSize="13" Margin="0,0,0,4" Foreground="{DynamicResource SecondaryTextBrush}"/>
  27. <ComboBox x:Name="cbBrand" FontSize="13" Padding="8,6" Margin="0,0,0,16" SelectedIndex="1">
  28. <ComboBoxItem Content="{loc:Translate '默认'}" Tag="0"/>
  29. <ComboBoxItem Content="{loc:Translate '爱普生 (EPSON)'}" Tag="1"/>
  30. <ComboBoxItem Content="{loc:Translate '发那科 (FANUC)'}" Tag="2"/>
  31. <ComboBoxItem Content="{loc:Translate '施耐德 (Schneider)'}" Tag="3"/>
  32. <ComboBoxItem Content="{loc:Translate 'XYZ模组平台'}" Tag="11"/>
  33. <ComboBoxItem Content="{loc:Translate 'XYZU模组平台'}" Tag="12"/>
  34. </ComboBox>
  35. <!-- Communication Type -->
  36. <TextBlock Text="{loc:Translate '通讯方式'}" FontSize="13" Margin="0,0,0,4" Foreground="{DynamicResource SecondaryTextBrush}"/>
  37. <ComboBox x:Name="cbConnectType" FontSize="13" Padding="8,6" Margin="0,0,0,16" SelectedIndex="1">
  38. <ComboBoxItem Content="{loc:Translate '软件作为服务器'}" Tag="0"/>
  39. <ComboBoxItem Content="{loc:Translate '软件作为客户端'}" Tag="1"/>
  40. </ComboBox>
  41. <!-- IP + Port -->
  42. <Grid Margin="0,0,0,16">
  43. <Grid.ColumnDefinitions>
  44. <ColumnDefinition Width="*"/>
  45. <ColumnDefinition Width="16"/>
  46. <ColumnDefinition Width="120"/>
  47. </Grid.ColumnDefinitions>
  48. <StackPanel Grid.Column="0">
  49. <TextBlock Text="{loc:Translate 'IP地址'}" FontSize="13" Margin="0,0,0,4" Foreground="{DynamicResource SecondaryTextBrush}"/>
  50. <TextBox x:Name="txtIP" Text="192.168.0.1" FontSize="13" Padding="8,6"/>
  51. </StackPanel>
  52. <StackPanel Grid.Column="2">
  53. <TextBlock Text="{loc:Translate '端口'}" FontSize="13" Margin="0,0,0,4" Foreground="{DynamicResource SecondaryTextBrush}"/>
  54. <hc:NumericUpDown x:Name="nudPort" Value="3600" Minimum="1" Maximum="65535"
  55. Width="120" FontSize="13" HorizontalAlignment="Left"/>
  56. </StackPanel>
  57. </Grid>
  58. <!-- Terminator -->
  59. <TextBlock Text="{loc:Translate '结束符'}" FontSize="13" Margin="0,0,0,4" Foreground="{DynamicResource SecondaryTextBrush}"/>
  60. <ComboBox x:Name="cbTerminator" FontSize="13" Padding="8,6" Margin="0,0,0,16" SelectedIndex="2">
  61. <ComboBoxItem Content="{loc:Translate '回车 (CR)'}" Tag="0"/>
  62. <ComboBoxItem Content="{loc:Translate '换行 (LF)'}" Tag="1"/>
  63. <ComboBoxItem Content="{loc:Translate '回车+换行 (CRLF)'}" Tag="2"/>
  64. <ComboBoxItem Content="{loc:Translate '无'}" Tag="3"/>
  65. </ComboBox>
  66. <!-- Encoding -->
  67. <TextBlock Text="{loc:Translate '编码格式'}" FontSize="13" Margin="0,0,0,4" Foreground="{DynamicResource SecondaryTextBrush}"/>
  68. <ComboBox x:Name="cbEncoding" FontSize="13" Padding="8,6" Margin="0,0,0,16" SelectedIndex="0">
  69. <ComboBoxItem Content="Default" Tag="0"/>
  70. <ComboBoxItem Content="ASCII" Tag="1"/>
  71. <ComboBoxItem Content="UTF7" Tag="2"/>
  72. <ComboBoxItem Content="UTF8" Tag="3"/>
  73. <ComboBoxItem Content="UTF32" Tag="4"/>
  74. <ComboBoxItem Content="Unicode" Tag="5"/>
  75. <ComboBoxItem Content="BigEndianUnicode" Tag="6"/>
  76. <ComboBoxItem Content="GB2312" Tag="7"/>
  77. </ComboBox>
  78. </StackPanel>
  79. </ScrollViewer>
  80. <!-- Buttons -->
  81. <StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Left" Margin="176,0,0,0">
  82. <Button Content="{loc:Translate '取消'}" MinWidth="80" Padding="16,0" Margin="0,0,12,0" IsCancel="True"
  83. Style="{StaticResource ButtonDefault}"/>
  84. <Button Content="{loc:Translate '确定'}" MinWidth="80" Padding="16,0" IsDefault="True" Click="BtnOK_Click"
  85. Style="{StaticResource ButtonPrimary}"/>
  86. </StackPanel>
  87. </Grid>
  88. </hc:Window>