MotorManualWindow.xaml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349
  1. <UserControl
  2. x:Class="SHJX.Service.Shell.Views.Manual.MotorManualWindow"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:CustomUI="clr-namespace:CustomUI;assembly=SHJX.Service.Library"
  6. xmlns:ManualControl="clr-namespace:SHJX.Service.Library.Views.ManualControl;assembly=SHJX.Service.Library"
  7. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  8. xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
  9. xmlns:local="clr-namespace:SHJX.Service.Shell.Views.Manual"
  10. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  11. xmlns:prism="http://prismlibrary.com/"
  12. xmlns:pu="clr-namespace:Panuon.UI.Silver;assembly=Panuon.UI.Silver"
  13. d:DesignHeight="800"
  14. d:DesignWidth="900"
  15. prism:ViewModelLocator.AutoWireViewModel="True"
  16. mc:Ignorable="d">
  17. <Grid>
  18. <Grid.RowDefinitions>
  19. <RowDefinition Height="1*" />
  20. <RowDefinition Height="1*" />
  21. <RowDefinition Height="2*" />
  22. <RowDefinition Height="1*" />
  23. <RowDefinition Height="2*" />
  24. </Grid.RowDefinitions>
  25. <GroupBox
  26. Grid.Row="0"
  27. Width="800"
  28. Height="100"
  29. Margin="0,5,0,5"
  30. HorizontalAlignment="Center"
  31. VerticalAlignment="Center"
  32. pu:GroupBoxHelper.CornerRadius="8"
  33. pu:GroupBoxHelper.IsSplitLineVisible="True"
  34. Header="返回原点">
  35. <StackPanel Orientation="Horizontal">
  36. <ManualControl:ManualButton ButtonContent="X轴" MotorManualCommand="{Binding MotorGoBackCommand}" />
  37. <ManualControl:ManualButton ButtonContent="Y轴" MotorManualCommand="{Binding MotorGoBackCommand}" />
  38. <ManualControl:ManualButton ButtonContent="Z轴" MotorManualCommand="{Binding MotorGoBackCommand}" />
  39. <!--<ManualControl:ManualButton ButtonContent="滴定" MotorManualCommand="{Binding MotorGoBackCommand}" />-->
  40. </StackPanel>
  41. </GroupBox>
  42. <GroupBox
  43. Grid.Row="1"
  44. Width="800"
  45. Height="100"
  46. Margin="0,5,0,5"
  47. HorizontalAlignment="Center"
  48. VerticalAlignment="Center"
  49. pu:GroupBoxHelper.CornerRadius="8"
  50. pu:GroupBoxHelper.IsSplitLineVisible="True"
  51. pu:GroupBoxHelper.ShadowColor="LightGray"
  52. Header="电机停止">
  53. <StackPanel Orientation="Horizontal">
  54. <ManualControl:ManualButton ButtonContent="X轴" MotorManualCommand="{Binding MotorStopCommand}" />
  55. <ManualControl:ManualButton ButtonContent="Y轴" MotorManualCommand="{Binding MotorStopCommand}" />
  56. <ManualControl:ManualButton ButtonContent="Z轴" MotorManualCommand="{Binding MotorStopCommand}" />
  57. </StackPanel>
  58. </GroupBox>
  59. <GroupBox
  60. Grid.Row="2"
  61. Width="800"
  62. Height="220"
  63. Margin="0,5,0,5"
  64. HorizontalAlignment="Center"
  65. VerticalAlignment="Center"
  66. pu:GroupBoxHelper.CornerRadius="8"
  67. pu:GroupBoxHelper.IsSplitLineVisible="True"
  68. pu:GroupBoxHelper.ShadowColor="LightGray"
  69. Header="电机控制">
  70. <UniformGrid Columns="5" Rows="1">
  71. <ManualControl:ManualSettingControl
  72. HeaderValue="X轴"
  73. LeftButtonCommand="{Binding ForwardCommand}"
  74. LeftButtonContent="正转"
  75. RightButtonCommand="{Binding InversionCommand}"
  76. RightButtonContent="反转" />
  77. <ManualControl:ManualSettingControl
  78. HeaderValue="Y轴"
  79. LeftButtonCommand="{Binding ForwardCommand}"
  80. LeftButtonContent="正转"
  81. RightButtonCommand="{Binding InversionCommand}"
  82. RightButtonContent="反转" />
  83. <ManualControl:ManualSettingControl
  84. HeaderValue="Z轴"
  85. LeftButtonCommand="{Binding ForwardCommand}"
  86. LeftButtonContent="正转"
  87. RightButtonCommand="{Binding InversionCommand}"
  88. RightButtonContent="反转" />
  89. <!--<ManualControl:ManualSettingControl
  90. HeaderValue="滴定位"
  91. LeftButtonCommand="{Binding ForwardCommand}"
  92. LeftButtonContent="正转"
  93. RightButtonCommand="{Binding InversionCommand}"
  94. RightButtonContent="反转" />-->
  95. </UniformGrid>
  96. </GroupBox>
  97. <GroupBox
  98. Grid.Row="3"
  99. Width="800"
  100. Height="110"
  101. Margin="0,5,0,5"
  102. HorizontalAlignment="Center"
  103. VerticalAlignment="Center"
  104. pu:GroupBoxHelper.CornerRadius="8"
  105. pu:GroupBoxHelper.IsSplitLineVisible="True"
  106. pu:GroupBoxHelper.ShadowColor="LightGray"
  107. Header="单点移动">
  108. <UniformGrid Columns="1" Rows="1">
  109. <StackPanel VerticalAlignment="Center" Orientation="Horizontal">
  110. <ComboBox
  111. Name="CmbArea"
  112. Width="80"
  113. Height="30"
  114. Margin="5,0"
  115. pu:ComboBoxHelper.CornerRadius="10"
  116. pu:ComboBoxHelper.HoverBackground="#1EB5B5B5"
  117. pu:ComboBoxHelper.IsSearchTextBoxVisible="True"
  118. pu:ComboBoxHelper.SearchTextChanged="AreaSearchTextChanged"
  119. pu:ComboBoxHelper.SelectedBackground="#32B5B5B5"
  120. ItemsSource="{Binding AreaPoint}"
  121. SelectedItem="{Binding AreaCurrentPoint}">
  122. <i:Interaction.Triggers>
  123. <i:EventTrigger EventName="SelectionChanged">
  124. <i:InvokeCommandAction Command="{Binding AreaSelectionChangedCommand}" CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Path=DataContext}" />
  125. </i:EventTrigger>
  126. </i:Interaction.Triggers>
  127. </ComboBox>
  128. <TextBlock
  129. Margin="10,0,0,0"
  130. HorizontalAlignment="Center"
  131. VerticalAlignment="Center"
  132. Text="X轴:" />
  133. <TextBox
  134. Width="70"
  135. Height="30"
  136. Margin="0,0,5,0"
  137. pu:TextBoxHelper.CornerRadius="10"
  138. pu:TextBoxHelper.FocusedBorderBrush="#B5B5B5"
  139. pu:TextBoxHelper.FocusedShadowColor="#B5B5B5"
  140. Cursor="IBeam"
  141. Text="{Binding Area.LocationX, Mode=TwoWay}" />
  142. <TextBlock
  143. Margin="10,0,0,0"
  144. HorizontalAlignment="Center"
  145. VerticalAlignment="Center"
  146. Text="Y轴:" />
  147. <TextBox
  148. Width="70"
  149. Height="30"
  150. Margin="0,0,5,0"
  151. pu:TextBoxHelper.CornerRadius="10"
  152. pu:TextBoxHelper.FocusedBorderBrush="#B5B5B5"
  153. pu:TextBoxHelper.FocusedShadowColor="#B5B5B5"
  154. Text="{Binding Area.LocationY, Mode=TwoWay}" />
  155. <TextBlock
  156. Margin="10,0,0,0"
  157. HorizontalAlignment="Center"
  158. VerticalAlignment="Center"
  159. Text="Z轴:" />
  160. <TextBox
  161. Width="60"
  162. Height="30"
  163. Margin="0,0,5,0"
  164. pu:TextBoxHelper.CornerRadius="10"
  165. pu:TextBoxHelper.FocusedBorderBrush="#B5B5B5"
  166. pu:TextBoxHelper.FocusedShadowColor="#B5B5B5"
  167. Text="{Binding Area.LocationZ, Mode=TwoWay}" />
  168. <TextBlock
  169. Margin="5,0,0,0"
  170. HorizontalAlignment="Center"
  171. VerticalAlignment="Center"
  172. Text="Z轴放:" />
  173. <TextBox
  174. Width="60"
  175. Height="30"
  176. Margin="0,0,5,0"
  177. pu:TextBoxHelper.CornerRadius="10"
  178. pu:TextBoxHelper.FocusedBorderBrush="#B5B5B5"
  179. pu:TextBoxHelper.FocusedShadowColor="#B5B5B5"
  180. Text="{Binding Area.LocationZF, Mode=TwoWay}" />
  181. <CheckBox
  182. Height="30"
  183. pu:CheckBoxHelper.BoxHeight="16"
  184. pu:CheckBoxHelper.BoxWidth="24"
  185. pu:CheckBoxHelper.CheckBoxStyle="Switch"
  186. pu:CheckBoxHelper.CheckedBackground="#6452A4"
  187. pu:CheckBoxHelper.CheckedContent="可用"
  188. Content="禁用"
  189. Cursor="Hand"
  190. IsChecked="{Binding Area.Enable, Mode=TwoWay}" />
  191. <Button
  192. Width="70"
  193. Height="30"
  194. Margin="20,0,0,0"
  195. pu:ButtonHelper.ClickStyle="Sink"
  196. pu:ButtonHelper.CornerRadius="12"
  197. pu:ButtonHelper.HoverBrush="#929FDE"
  198. Background="#6452A4"
  199. Command="{Binding SingleMoveCommand}"
  200. Content="移动"
  201. Cursor="Hand"
  202. FontFamily="{StaticResource FontAwesome}" />
  203. <Button
  204. Width="70"
  205. Height="30"
  206. Margin="5,0"
  207. pu:ButtonHelper.ClickStyle="Sink"
  208. pu:ButtonHelper.CornerRadius="12"
  209. pu:ButtonHelper.HoverBrush="#929FDE"
  210. Background="#6452A4"
  211. Command="{Binding UpdateAreaCommand}"
  212. Content="更新"
  213. Cursor="Hand"
  214. FontFamily="{StaticResource FontAwesome}" />
  215. </StackPanel>
  216. </UniformGrid>
  217. </GroupBox>
  218. <GroupBox
  219. Grid.Row="4"
  220. Width="800"
  221. Height="220"
  222. Margin="0,5,0,5"
  223. HorizontalAlignment="Center"
  224. VerticalAlignment="Center"
  225. pu:GroupBoxHelper.CornerRadius="8"
  226. pu:GroupBoxHelper.IsSplitLineVisible="True"
  227. pu:GroupBoxHelper.ShadowColor="LightGray"
  228. Header="其他">
  229. <StackPanel Orientation="Horizontal">
  230. <GroupBox
  231. Width="180"
  232. Height="120"
  233. Margin="5,0"
  234. HorizontalAlignment="Center"
  235. VerticalAlignment="Center"
  236. pu:GroupBoxHelper.CornerRadius="8"
  237. pu:GroupBoxHelper.IsSplitLineVisible="True"
  238. pu:GroupBoxHelper.ShadowColor="LightGray"
  239. Header="速度设置">
  240. <UniformGrid Columns="1" Rows="2">
  241. <StackPanel Orientation="Horizontal">
  242. <CustomUI:CheckComboBox
  243. x:Name="CheckComboBox"
  244. Width="140"
  245. Height="30"
  246. HorizontalAlignment="Center"
  247. VerticalAlignment="Center"
  248. DisplayMemberPath="DetailName"
  249. IsEnabled="True"
  250. IsShowFilterBox="False"
  251. IsTextSearchEnabled="False"
  252. ItemsSource="{Binding SpeedNames}"
  253. MaxShowNumber="3" />
  254. <CheckBox
  255. x:Name="SpeedAllCheck"
  256. Height="30"
  257. Margin="10,0,0,0"
  258. pu:CheckBoxHelper.BoxHeight="16"
  259. pu:CheckBoxHelper.BoxWidth="16"
  260. pu:CheckBoxHelper.CheckedBackground="#6452A4"
  261. pu:CheckBoxHelper.CornerRadius="3"
  262. Background="#323F3F3F"
  263. Click="SpeedAllCheck_Click"
  264. Cursor="Hand" />
  265. </StackPanel>
  266. <Button
  267. Width="80"
  268. Height="25"
  269. Margin="5,0"
  270. HorizontalAlignment="Right"
  271. VerticalAlignment="Bottom"
  272. pu:ButtonHelper.ClickStyle="Sink"
  273. pu:ButtonHelper.CornerRadius="10"
  274. pu:ButtonHelper.HoverBrush="#929FDE"
  275. Background="#6452A4"
  276. Command="{Binding SpeedSettingCommand}"
  277. Content="更新"
  278. Cursor="Hand"
  279. FontFamily="{StaticResource FontAwesome}"
  280. Foreground="#FFF">
  281. <Button.CommandParameter>
  282. <Binding ElementName="CheckComboBox" Path="SelectedObjList" />
  283. </Button.CommandParameter>
  284. </Button>
  285. </UniformGrid>
  286. </GroupBox>
  287. <GroupBox
  288. Width="120"
  289. Height="120"
  290. Margin="5,0"
  291. HorizontalAlignment="Center"
  292. VerticalAlignment="Center"
  293. pu:GroupBoxHelper.CornerRadius="8"
  294. pu:GroupBoxHelper.IsSplitLineVisible="True"
  295. pu:GroupBoxHelper.ShadowColor="LightGray"
  296. Header="机械抓手">
  297. <UniformGrid Columns="1" Rows="2">
  298. <CustomUI:SegmentControl
  299. x:Name="cb_mani"
  300. Width="103"
  301. Height="25"
  302. HorizontalAlignment="Center"
  303. BorderBrush="#6452A4"
  304. Cursor="Hand"
  305. SelectedIndex="0">
  306. <CustomUI:SegmentItem Content="杯抓" FontSize="10" />
  307. <CustomUI:SegmentItem Content="杯松" FontSize="10" />
  308. <!--<i:Interaction.Triggers>
  309. <i:EventTrigger EventName="SelectionChanged">
  310. <i:InvokeCommandAction Command="{Binding ModeSelectionChangedCommand}" />
  311. </i:EventTrigger>
  312. </i:Interaction.Triggers>-->
  313. </CustomUI:SegmentControl>
  314. <Button
  315. Width="60"
  316. Height="25"
  317. Margin="5,0"
  318. HorizontalAlignment="Right"
  319. VerticalAlignment="Bottom"
  320. pu:ButtonHelper.ClickStyle="Sink"
  321. pu:ButtonHelper.CornerRadius="10"
  322. pu:ButtonHelper.HoverBrush="#929FDE"
  323. Background="#6452A4"
  324. Command="{Binding ManiManualControlCommand}"
  325. Content="设置"
  326. Cursor="Hand"
  327. FontFamily="{StaticResource FontAwesome}"
  328. Foreground="#FFF">
  329. <Button.CommandParameter>
  330. <Binding ElementName="cb_mani" Path="SelectedItem.Content" />
  331. </Button.CommandParameter>
  332. </Button>
  333. </UniformGrid>
  334. </GroupBox>
  335. </StackPanel>
  336. </GroupBox>
  337. </Grid>
  338. </UserControl>