RobotManual.xaml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. <UserControl x:Class="TeamAAS_VP.Controls.RobotManual"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:TeamAAS_VP.Controls"
  7. xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
  8. xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
  9. xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
  10. xmlns:sys="clr-namespace:System;assembly=mscorlib"
  11. xmlns:uControl="clr-namespace:TeamAAS_VP.Controls"
  12. xmlns:convert="clr-namespace:TeamAAS_VP.ValueConverter"
  13. xmlns:lex="http://wpflocalizeextension.codeplex.com"
  14. lex:LocalizeDictionary.DesignCulture="zh-CN"
  15. lex:ResxLocalizationProvider.DefaultAssembly="TeamAAS-VP"
  16. lex:ResxLocalizationProvider.DefaultDictionary="Lang"
  17. mc:Ignorable="d"
  18. d:Background="White"
  19. FontFamily="{DynamicResource DefaultFont}">
  20. <UserControl.Resources>
  21. <convert:JogConverter x:Key="JogConverter" />
  22. </UserControl.Resources>
  23. <Grid VerticalAlignment="Center">
  24. <Grid VerticalAlignment="Center">
  25. <Grid.ColumnDefinitions>
  26. <ColumnDefinition Width="auto" />
  27. <ColumnDefinition Width="*" />
  28. </Grid.ColumnDefinitions>
  29. <Grid Grid.Column="0">
  30. <Grid.RowDefinitions>
  31. <RowDefinition Height="auto" />
  32. <RowDefinition Height="auto" />
  33. <RowDefinition Height="auto" />
  34. <RowDefinition Height="auto" />
  35. <RowDefinition Height="auto" />
  36. <RowDefinition Height="auto" />
  37. <RowDefinition Height="auto" />
  38. </Grid.RowDefinitions>
  39. <Button Content="{lex:Loc 连接}"
  40. Grid.Row="0"
  41. materialDesign:ButtonAssist.CornerRadius="10"
  42. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  43. Command="{Binding ConnectCommand}" />
  44. <Button Content="{lex:Loc 断开连接}"
  45. Grid.Row="1"
  46. Margin="0,10,0,10"
  47. materialDesign:ButtonAssist.CornerRadius="10"
  48. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  49. Command="{Binding DisConnectCommand}" />
  50. <Button Content="{lex:Loc 上使能}"
  51. Grid.Row="2"
  52. materialDesign:ButtonAssist.CornerRadius="10"
  53. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  54. Command="{Binding MotorCommand}"
  55. CommandParameter="True" />
  56. <Button Content="{lex:Loc 下使能}"
  57. Grid.Row="3"
  58. Margin="0,10,0,10"
  59. materialDesign:ButtonAssist.CornerRadius="10"
  60. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  61. Command="{Binding MotorCommand}"
  62. CommandParameter="False" />
  63. <Button Content="{lex:Loc 复位错误}"
  64. Grid.Row="4"
  65. materialDesign:ButtonAssist.CornerRadius="10"
  66. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  67. Command="{Binding ResetCommand}" />
  68. <Button Content="{lex:Loc 释放刹车}"
  69. Grid.Row="5"
  70. Margin="0,10,0,10"
  71. materialDesign:ButtonAssist.CornerRadius="10"
  72. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  73. Command="{Binding sFreeCommand}" />
  74. <Button Content="{lex:Loc 锁定刹车}"
  75. Grid.Row="6"
  76. materialDesign:ButtonAssist.CornerRadius="10"
  77. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  78. Command="{Binding SLockCommand}" />
  79. </Grid>
  80. <Grid Grid.Column="1"
  81. Margin="20">
  82. <Grid.ColumnDefinitions>
  83. <ColumnDefinition Width="auto" />
  84. <ColumnDefinition Width="auto" />
  85. <ColumnDefinition Width="auto" />
  86. <ColumnDefinition Width="auto" />
  87. </Grid.ColumnDefinitions>
  88. <Grid.RowDefinitions>
  89. <RowDefinition Height="auto" />
  90. <RowDefinition Height="auto" />
  91. <RowDefinition Height="auto" />
  92. <RowDefinition Height="auto" />
  93. <RowDefinition Height="auto" />
  94. <RowDefinition Height="auto" />
  95. <RowDefinition Height="auto" />
  96. </Grid.RowDefinitions>
  97. <ComboBox Grid.Column="0"
  98. Grid.Row="0"
  99. Margin="10,5"
  100. materialDesign:HintAssist.Hint="{lex:Loc 选择Tool}"
  101. materialDesign:HintAssist.HelperText="{lex:Loc 选择Tool}"
  102. SelectedItem="{Binding SelectTool,Mode=TwoWay}"
  103. ItemsSource="{Binding Tools}" />
  104. <Button Content="X-"
  105. Grid.Row="2"
  106. Grid.Column="0"
  107. Margin="10,10,10,10"
  108. materialDesign:ButtonAssist.CornerRadius="10"
  109. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  110. Command="{Binding JogCommand}"
  111. CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=X-}" />
  112. <Button Content="X+"
  113. Grid.Row="2"
  114. Grid.Column="2"
  115. Margin="10,10,10,10"
  116. materialDesign:ButtonAssist.CornerRadius="10"
  117. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  118. Command="{Binding JogCommand}"
  119. CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=X+}" />
  120. <Button Content="Y+"
  121. Grid.Row="1"
  122. Grid.Column="1"
  123. Margin="10,10,10,10"
  124. materialDesign:ButtonAssist.CornerRadius="10"
  125. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  126. Command="{Binding JogCommand}"
  127. CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=Y+}" />
  128. <Button Content="Y-"
  129. Grid.Row="3"
  130. Grid.Column="1"
  131. Margin="10,10,10,10"
  132. materialDesign:ButtonAssist.CornerRadius="10"
  133. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  134. Command="{Binding JogCommand}"
  135. CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=Y-}" />
  136. <Button Content="Z+"
  137. Grid.Row="1"
  138. Grid.Column="3"
  139. Margin="10,10,10,10"
  140. materialDesign:ButtonAssist.CornerRadius="10"
  141. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  142. Command="{Binding JogCommand}"
  143. CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=Z+}" />
  144. <Button Content="Z-"
  145. Grid.Row="3"
  146. Grid.Column="3"
  147. Margin="10,10,10,10"
  148. materialDesign:ButtonAssist.CornerRadius="10"
  149. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  150. Command="{Binding JogCommand}"
  151. CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=Z-}" />
  152. <Button Content="U+"
  153. Grid.Row="4"
  154. Grid.Column="0"
  155. Margin="10,10,10,10"
  156. materialDesign:ButtonAssist.CornerRadius="10"
  157. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  158. Command="{Binding JogCommand}"
  159. CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=U+}" />
  160. <Button Content="U-"
  161. Grid.Row="5"
  162. Grid.Column="0"
  163. Margin="10,10,10,10"
  164. materialDesign:ButtonAssist.CornerRadius="10"
  165. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  166. Command="{Binding JogCommand}"
  167. CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=U-}" />
  168. <Button Content="V+"
  169. Grid.Row="4"
  170. Grid.Column="1"
  171. Grid.ColumnSpan="2"
  172. Margin="10,10,10,10"
  173. materialDesign:ButtonAssist.CornerRadius="10"
  174. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  175. Command="{Binding JogCommand}"
  176. CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=V+}" />
  177. <Button Content="V-"
  178. Grid.Row="5"
  179. Grid.Column="1"
  180. Grid.ColumnSpan="2"
  181. Margin="10,10,10,10"
  182. materialDesign:ButtonAssist.CornerRadius="10"
  183. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  184. Command="{Binding JogCommand}"
  185. CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=V-}" />
  186. <Button Content="W+"
  187. Grid.Row="4"
  188. Grid.Column="3"
  189. Margin="10,10,10,10"
  190. materialDesign:ButtonAssist.CornerRadius="10"
  191. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  192. Command="{Binding JogCommand}"
  193. CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=W+}" />
  194. <Button Content="W-"
  195. Grid.Row="5"
  196. Grid.Column="3"
  197. Margin="10,10,10,10"
  198. materialDesign:ButtonAssist.CornerRadius="10"
  199. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  200. Command="{Binding JogCommand}"
  201. CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=W-}" />
  202. <StackPanel Grid.Row="6"
  203. Grid.ColumnSpan="7"
  204. Margin="10,10,0,10"
  205. Grid.Column="0"
  206. VerticalAlignment="Center"
  207. Orientation="Horizontal">
  208. <TextBlock Text="{lex:Loc 步进距离}"
  209. VerticalAlignment="Center" />
  210. <uControl:myNumericUpDowm x:Name="txtDistance"
  211. MinWidth="100"
  212. Interval="0.1"
  213. Minimum="0"
  214. Maximum="100"
  215. StringFormat="{}{0:N3} mm"
  216. Value="{Binding Distance,Mode=TwoWay}"
  217. Margin="10,0" />
  218. </StackPanel>
  219. </Grid>
  220. </Grid>
  221. <materialDesign:Snackbar x:Name="snackbar"
  222. Opacity="0.9"
  223. HorizontalContentAlignment="Center"
  224. VerticalAlignment="Bottom" />
  225. </Grid>
  226. </UserControl>