RobotManualStep.xaml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  1. <UserControl x:Class="TeamAAS_VP.Views.DebugMod.RobotManualStep"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:prism="http://prismlibrary.com/"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  7. xmlns:vm="clr-namespace:TeamAAS_VP.ViewModels.DebugMod"
  8. xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
  9. xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
  10. xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
  11. xmlns:sys="clr-namespace:System;assembly=mscorlib"
  12. xmlns:uControl="clr-namespace:TeamAAS_VP.Controls"
  13. xmlns:convert="clr-namespace:TeamAAS_VP.ValueConverter"
  14. xmlns:lex="http://wpflocalizeextension.codeplex.com"
  15. lex:LocalizeDictionary.DesignCulture="zh-CN"
  16. lex:ResxLocalizationProvider.DefaultAssembly="TeamAAS-VP"
  17. lex:ResxLocalizationProvider.DefaultDictionary="Lang"
  18. prism:ViewModelLocator.AutoWireViewModel="True"
  19. mc:Ignorable="d"
  20. d:Background="White"
  21. d:DataContext="{d:DesignInstance Type=vm:RobotManualStepViewModel}"
  22. FontFamily="{DynamicResource DefaultFont}">
  23. <b:Interaction.Triggers>
  24. <b:EventTrigger EventName="Loaded">
  25. <b:InvokeCommandAction Command="{Binding LoadedCommand}" />
  26. </b:EventTrigger>
  27. </b:Interaction.Triggers>
  28. <UserControl.Resources>
  29. <convert:JogConverter x:Key="JogConverter" />
  30. </UserControl.Resources>
  31. <Grid VerticalAlignment="Center"
  32. IsEnabled="{Binding IsAllowEdit}">
  33. <Grid.ColumnDefinitions>
  34. <ColumnDefinition Width="auto" />
  35. <ColumnDefinition Width="*" />
  36. </Grid.ColumnDefinitions>
  37. <Grid Grid.Column="0">
  38. <Grid.RowDefinitions>
  39. <RowDefinition Height="auto" />
  40. <RowDefinition Height="auto" />
  41. <RowDefinition Height="auto" />
  42. <RowDefinition Height="auto" />
  43. <RowDefinition Height="auto" />
  44. <RowDefinition Height="auto" />
  45. <RowDefinition Height="auto" />
  46. </Grid.RowDefinitions>
  47. <Button Content="{lex:Loc 连接}"
  48. Grid.Row="0"
  49. materialDesign:ButtonAssist.CornerRadius="10"
  50. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  51. Command="{Binding ConnectCommand}" />
  52. <Button Content="{lex:Loc 断开连接}"
  53. Grid.Row="1"
  54. Margin="0,10,0,10"
  55. materialDesign:ButtonAssist.CornerRadius="10"
  56. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  57. Command="{Binding DisConnectCommand}" />
  58. <Button Content="{lex:Loc 上使能}"
  59. Grid.Row="2"
  60. materialDesign:ButtonAssist.CornerRadius="10"
  61. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  62. Command="{Binding MotorCommand}"
  63. CommandParameter="True" />
  64. <Button Content="{lex:Loc 下使能}"
  65. Grid.Row="3"
  66. Margin="0,10,0,10"
  67. materialDesign:ButtonAssist.CornerRadius="10"
  68. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  69. Command="{Binding MotorCommand}"
  70. CommandParameter="False" />
  71. <Button Content="{lex:Loc 复位错误}"
  72. Grid.Row="4"
  73. materialDesign:ButtonAssist.CornerRadius="10"
  74. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  75. Command="{Binding ResetCommand}" />
  76. <Button Content="{lex:Loc 释放刹车}"
  77. Grid.Row="5"
  78. Margin="0,10,0,10"
  79. materialDesign:ButtonAssist.CornerRadius="10"
  80. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  81. Command="{Binding sFreeCommand}" />
  82. <Button Content="{lex:Loc 锁定刹车}"
  83. Grid.Row="6"
  84. materialDesign:ButtonAssist.CornerRadius="10"
  85. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  86. Command="{Binding SLockCommand}" />
  87. </Grid>
  88. <Grid Grid.Column="1"
  89. Margin="20">
  90. <Grid.ColumnDefinitions>
  91. <ColumnDefinition Width="auto" />
  92. <ColumnDefinition Width="auto" />
  93. <ColumnDefinition Width="auto" />
  94. <ColumnDefinition Width="auto" />
  95. <ColumnDefinition Width="auto" />
  96. <ColumnDefinition Width="auto" />
  97. <ColumnDefinition Width="auto" />
  98. </Grid.ColumnDefinitions>
  99. <Grid.RowDefinitions>
  100. <RowDefinition Height="auto" />
  101. <RowDefinition Height="auto" />
  102. <RowDefinition Height="auto" />
  103. <RowDefinition Height="auto" />
  104. </Grid.RowDefinitions>
  105. <Button Grid.Row="1"
  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. <StackPanel Orientation="Vertical">
  113. <materialDesign:PackIcon Kind="ArrowLeftBold"
  114. Width="26"
  115. Height="26" />
  116. <TextBlock Text="-X"
  117. HorizontalAlignment="Center" />
  118. </StackPanel>
  119. </Button>
  120. <Button Grid.Row="1"
  121. Grid.Column="2"
  122. Margin="10,10,10,10"
  123. materialDesign:ButtonAssist.CornerRadius="10"
  124. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  125. Command="{Binding JogCommand}"
  126. CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=X+}">
  127. <StackPanel Orientation="Vertical">
  128. <materialDesign:PackIcon Kind="ArrowRightBold"
  129. Width="26"
  130. Height="26" />
  131. <TextBlock Text="+X"
  132. HorizontalAlignment="Center" />
  133. </StackPanel>
  134. </Button>
  135. <Button Grid.Row="0"
  136. Grid.Column="1"
  137. Margin="10,10,10,10"
  138. materialDesign:ButtonAssist.CornerRadius="10"
  139. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  140. Command="{Binding JogCommand}"
  141. CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=Y+}">
  142. <StackPanel Orientation="Vertical">
  143. <materialDesign:PackIcon Kind="ArrowTopBold"
  144. Width="26"
  145. Height="26" />
  146. <TextBlock Text="+Y"
  147. HorizontalAlignment="Center" />
  148. </StackPanel>
  149. </Button>
  150. <Button Grid.Row="2"
  151. Grid.Column="1"
  152. Margin="10,10,10,10"
  153. materialDesign:ButtonAssist.CornerRadius="10"
  154. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  155. Command="{Binding JogCommand}"
  156. CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=Y-}">
  157. <StackPanel Orientation="Vertical">
  158. <materialDesign:PackIcon Kind="ArrowBottomBold"
  159. Width="26"
  160. Height="26" />
  161. <TextBlock Text="-Y"
  162. HorizontalAlignment="Center" />
  163. </StackPanel>
  164. </Button>
  165. <Button Grid.Row="0"
  166. Grid.Column="3"
  167. Margin="10,10,10,10"
  168. materialDesign:ButtonAssist.CornerRadius="10"
  169. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  170. Command="{Binding JogCommand}"
  171. CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=Z+}">
  172. <StackPanel Orientation="Vertical">
  173. <materialDesign:PackIcon Kind="ArrowTopBold"
  174. Width="26"
  175. Height="26" />
  176. <TextBlock Text="+Z"
  177. HorizontalAlignment="Center" />
  178. </StackPanel>
  179. </Button>
  180. <Button Grid.Row="2"
  181. Grid.Column="3"
  182. Margin="10,10,10,10"
  183. materialDesign:ButtonAssist.CornerRadius="10"
  184. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  185. Command="{Binding JogCommand}"
  186. CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=Z-}">
  187. <StackPanel Orientation="Vertical">
  188. <materialDesign:PackIcon Kind="ArrowBottomBold"
  189. Width="26"
  190. Height="26" />
  191. <TextBlock Text="-Z"
  192. HorizontalAlignment="Center" />
  193. </StackPanel>
  194. </Button>
  195. <Button Grid.Row="0"
  196. Grid.Column="4"
  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=U+}">
  202. <StackPanel Orientation="Vertical">
  203. <materialDesign:PackIcon Kind="AxisZRotateCounterclockwise"
  204. Width="26"
  205. Height="26" />
  206. <TextBlock Text="+U"
  207. HorizontalAlignment="Center" />
  208. </StackPanel>
  209. </Button>
  210. <Button Grid.Row="2"
  211. Grid.Column="4"
  212. Margin="10,10,10,10"
  213. materialDesign:ButtonAssist.CornerRadius="10"
  214. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  215. Command="{Binding JogCommand}"
  216. CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=U-}">
  217. <StackPanel Orientation="Vertical">
  218. <materialDesign:PackIcon Kind="AxisZRotateClockwise"
  219. Width="26"
  220. Height="26" />
  221. <TextBlock Text="-U"
  222. HorizontalAlignment="Center" />
  223. </StackPanel>
  224. </Button>
  225. <Button Grid.Row="0"
  226. Grid.Column="5"
  227. Margin="10,10,10,10"
  228. materialDesign:ButtonAssist.CornerRadius="10"
  229. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  230. Command="{Binding JogCommand}"
  231. CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=V+}">
  232. <StackPanel Orientation="Vertical">
  233. <materialDesign:PackIcon Kind="AxisYRotateCounterclockwise"
  234. Width="26"
  235. Height="26" />
  236. <TextBlock Text="+V"
  237. HorizontalAlignment="Center" />
  238. </StackPanel>
  239. </Button>
  240. <Button Grid.Row="2"
  241. Grid.Column="5"
  242. Margin="10,10,10,10"
  243. materialDesign:ButtonAssist.CornerRadius="10"
  244. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  245. Command="{Binding JogCommand}"
  246. CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=V-}">
  247. <StackPanel Orientation="Vertical">
  248. <materialDesign:PackIcon Kind="AxisYRotateClockwise"
  249. Width="26"
  250. Height="26" />
  251. <TextBlock Text="-V"
  252. HorizontalAlignment="Center" />
  253. </StackPanel>
  254. </Button>
  255. <Button Grid.Row="0"
  256. Grid.Column="6"
  257. Margin="10,10,10,10"
  258. materialDesign:ButtonAssist.CornerRadius="10"
  259. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  260. Command="{Binding JogCommand}"
  261. CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=W+}">
  262. <StackPanel Orientation="Vertical">
  263. <materialDesign:PackIcon Kind="AxisXRotateCounterclockwise"
  264. Width="26"
  265. Height="26" />
  266. <TextBlock Text="+W"
  267. HorizontalAlignment="Center" />
  268. </StackPanel>
  269. </Button>
  270. <Button Grid.Row="2"
  271. Grid.Column="6"
  272. Margin="10,10,10,10"
  273. materialDesign:ButtonAssist.CornerRadius="10"
  274. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  275. Command="{Binding JogCommand}"
  276. CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=W-}">
  277. <StackPanel Orientation="Vertical">
  278. <materialDesign:PackIcon Kind="AxisXRotateClockwise"
  279. Width="26"
  280. Height="26" />
  281. <TextBlock Text="-W"
  282. HorizontalAlignment="Center" />
  283. </StackPanel>
  284. </Button>
  285. <StackPanel Grid.Row="3"
  286. Grid.ColumnSpan="7"
  287. Margin="50,10,0,0"
  288. Grid.Column="0"
  289. VerticalAlignment="Center"
  290. Orientation="Horizontal">
  291. <TextBlock Text="{lex:Loc 步进距离}"
  292. VerticalAlignment="Center" />
  293. <uControl:myNumericUpDowm x:Name="txtDistance"
  294. MinWidth="100"
  295. Value="{Binding Distance,Mode=TwoWay}"
  296. Interval="0.1"
  297. Minimum="0"
  298. Maximum="100"
  299. StringFormat="{}{0:N3} mm"
  300. Margin="10,0" />
  301. </StackPanel>
  302. </Grid>
  303. </Grid>
  304. </UserControl>