终端一体化运控平台
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 

369 Zeilen
17 KiB

  1. <UserControl
  2. x:Class="BPASmartClient.JXJFoodSmallStation.View.RobotView"
  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:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
  8. xmlns:vm="clr-namespace:BPASmartClient.JXJFoodSmallStation.ViewModel"
  9. d:DesignHeight="1080"
  10. d:DesignWidth="1920"
  11. mc:Ignorable="d">
  12. <UserControl.Resources>
  13. <Style x:Key="radioButtonStyle" TargetType="RadioButton">
  14. <Setter Property="Template">
  15. <Setter.Value>
  16. <ControlTemplate TargetType="RadioButton">
  17. <Grid Name="gr" Opacity="0.8">
  18. <ContentControl
  19. Margin="{TemplateBinding Margin}"
  20. HorizontalAlignment="Center"
  21. VerticalAlignment="Center"
  22. HorizontalContentAlignment="Center"
  23. VerticalContentAlignment="Center"
  24. Content="{TemplateBinding Content}"
  25. FontSize="{TemplateBinding FontSize}"
  26. Foreground="{TemplateBinding Foreground}" />
  27. <Image
  28. Name="image"
  29. Source="/BPASmartClient.CustomResource;component/Image/边框线.png"
  30. Stretch="Fill" />
  31. </Grid>
  32. <ControlTemplate.Triggers>
  33. <Trigger Property="IsChecked" Value="False">
  34. <Setter TargetName="image" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/边框线.png" />
  35. </Trigger>
  36. <Trigger Property="IsChecked" Value="True">
  37. <Setter TargetName="image" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/透明背景.png" />
  38. </Trigger>
  39. <Trigger Property="IsMouseOver" Value="True">
  40. <Setter TargetName="gr" Property="Opacity" Value="1" />
  41. </Trigger>
  42. </ControlTemplate.Triggers>
  43. </ControlTemplate>
  44. </Setter.Value>
  45. </Setter>
  46. </Style>
  47. </UserControl.Resources>
  48. <UserControl.DataContext>
  49. <vm:RobotViewModel />
  50. </UserControl.DataContext>
  51. <Grid Margin="10">
  52. <Grid.ColumnDefinitions>
  53. <ColumnDefinition Width="4*" />
  54. <ColumnDefinition Width="4*" />
  55. <ColumnDefinition Width="4*" />
  56. </Grid.ColumnDefinitions>
  57. <!--#region 表格标题栏设置-->
  58. <Grid>
  59. <StackPanel>
  60. <WrapPanel>
  61. <TextBlock
  62. Margin="5"
  63. FontSize="22"
  64. Foreground="Aqua"
  65. Text="机器人自动运行模式:" />
  66. <TextBlock
  67. Margin="5"
  68. FontSize="22"
  69. Foreground="Aqua"
  70. Text="{Binding RobotIsAutoMode}" />
  71. </WrapPanel>
  72. <WrapPanel>
  73. <TextBlock
  74. Margin="5"
  75. FontSize="22"
  76. Foreground="Aqua"
  77. Text="机器人正在自动运行:" />
  78. <TextBlock
  79. Margin="5"
  80. FontSize="22"
  81. Foreground="Aqua"
  82. Text="{Binding RobotIsAutoRun}" />
  83. </WrapPanel>
  84. <WrapPanel>
  85. <TextBlock
  86. Margin="5"
  87. FontSize="22"
  88. Foreground="Aqua"
  89. Text="机器人停止状态:" />
  90. <TextBlock
  91. Margin="49,5"
  92. FontSize="22"
  93. Foreground="Aqua"
  94. Text="{Binding RobotIsStop}" />
  95. </WrapPanel>
  96. <WrapPanel>
  97. <TextBlock
  98. Margin="5"
  99. FontSize="22"
  100. Foreground="Aqua"
  101. Text="机器人运行正常:" />
  102. <TextBlock
  103. Margin="49,5"
  104. FontSize="22"
  105. Foreground="Aqua"
  106. Text="{Binding RobotIsRun}" />
  107. </WrapPanel>
  108. <WrapPanel>
  109. <TextBlock
  110. Margin="5"
  111. FontSize="22"
  112. Foreground="Aqua"
  113. Text="机器人运行故障:" />
  114. <TextBlock
  115. Margin="49,5"
  116. FontSize="22"
  117. Foreground="Aqua"
  118. Text="{Binding RobotIsAlarm}" />
  119. </WrapPanel>
  120. <WrapPanel>
  121. <TextBlock
  122. Margin="5"
  123. FontSize="22"
  124. Foreground="Aqua"
  125. Text="机器人在Home点:" />
  126. <TextBlock
  127. Margin="30,5"
  128. FontSize="22"
  129. Foreground="Aqua"
  130. Text="{Binding RobotIsHomed}" />
  131. </WrapPanel>
  132. <WrapPanel>
  133. <TextBlock
  134. Margin="5"
  135. FontSize="22"
  136. Foreground="Aqua"
  137. Text="机器人运行的程序号:" />
  138. <TextBlock
  139. Margin="5"
  140. FontSize="22"
  141. Foreground="Aqua"
  142. Text="{Binding IsRunProgramNum}" />
  143. </WrapPanel>
  144. <!--<WrapPanel>
  145. <TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="抓空桶完成:"></TextBlock>
  146. <TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="{Binding RobotGetEmptyBarrelComplete}"></TextBlock>
  147. </WrapPanel>
  148. <WrapPanel>
  149. <TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="放空桶完成:"></TextBlock>
  150. <TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="{Binding RobotPutEmptyBarrelComplete}"></TextBlock>
  151. </WrapPanel>
  152. <WrapPanel>
  153. <TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="抓满桶完成:"></TextBlock>
  154. <TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="{Binding RobotGetFullBarrelComplete}"></TextBlock>
  155. </WrapPanel>
  156. <WrapPanel>
  157. <TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="放满桶完成:"></TextBlock>
  158. <TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="{Binding RobotPutFullBarrelComplete}"></TextBlock>
  159. </WrapPanel>-->
  160. </StackPanel>
  161. </Grid>
  162. <Grid Grid.Column="1">
  163. <Grid.RowDefinitions>
  164. <RowDefinition Height="1*" />
  165. <RowDefinition Height="7*" />
  166. </Grid.RowDefinitions>
  167. <Grid>
  168. <Grid.ColumnDefinitions>
  169. <ColumnDefinition />
  170. <ColumnDefinition />
  171. <ColumnDefinition />
  172. <ColumnDefinition />
  173. </Grid.ColumnDefinitions>
  174. <Button
  175. Margin="20,15"
  176. Background="LightGreen"
  177. Command="{Binding SystemStart}"
  178. Content="启动"
  179. FontSize="40" />
  180. <Button
  181. Grid.Column="1"
  182. Margin="20,15"
  183. Background="OrangeRed"
  184. Command="{Binding SystemStop}"
  185. Content="停止"
  186. FontSize="40" />
  187. <Button
  188. Grid.Column="2"
  189. Grid.ColumnSpan="2"
  190. Margin="20,15"
  191. Background="DodgerBlue"
  192. Command="{Binding EStopReset}"
  193. Content="急停复位"
  194. FontSize="40" />
  195. </Grid>
  196. </Grid>
  197. <!--<Grid Grid.Column="2">
  198. <Grid.RowDefinitions>
  199. <RowDefinition></RowDefinition>
  200. <RowDefinition></RowDefinition>
  201. <RowDefinition></RowDefinition>
  202. </Grid.RowDefinitions>
  203. <Grid>
  204. <Grid.ColumnDefinitions>
  205. <ColumnDefinition></ColumnDefinition>
  206. <ColumnDefinition></ColumnDefinition>
  207. </Grid.ColumnDefinitions>
  208. <Grid.RowDefinitions>
  209. <RowDefinition></RowDefinition>
  210. <RowDefinition></RowDefinition>
  211. <RowDefinition></RowDefinition>
  212. </Grid.RowDefinitions>
  213. <Button
  214. Margin="20,5"
  215. Command="{Binding AutoMode}"
  216. Content="自动模式"
  217. FontSize="32"
  218. Panel.ZIndex="0"
  219. Style="{StaticResource ImageButtonStyle}"></Button>
  220. <Button
  221. Grid.Column="1"
  222. Margin="20,5"
  223. Command="{Binding TestMode}"
  224. Content="测试模式"
  225. FontSize="32"
  226. Panel.ZIndex="0"
  227. Style="{StaticResource ImageButtonStyle}"></Button>
  228. <Grid Grid.Row="1" Grid.ColumnSpan="2">
  229. <StackPanel Orientation="Vertical">
  230. <WrapPanel Orientation="Horizontal">
  231. <TextBlock Text="机器人正在运行程序号:" Foreground="#FF2AB2E7" FontSize="25" Margin="10" HorizontalAlignment="Left"></TextBlock>
  232. <TextBlock Text="{Binding IsRunProgramNum}" Foreground="#FF2AB2E7" FontSize="25" Margin="10" HorizontalAlignment="Left" TextAlignment="Center"></TextBlock>
  233. </WrapPanel>
  234. <WrapPanel Orientation="Horizontal" VerticalAlignment="Center">
  235. <TextBlock Text="机器人需要运行程序号:" Foreground="#FF2AB2E7" FontSize="25" Margin="10" HorizontalAlignment="Left"></TextBlock>
  236. <TextBox Text="{Binding SetProgramNum}" Width="50" Foreground="#FF2AB2E7" FontSize="25" Margin="10" HorizontalAlignment="Left" TextAlignment="Center"></TextBox>
  237. <Button FontSize="20" Height="40" Command="{Binding SetProgramNumCommand}" Content="设置" Style="{StaticResource ImageButtonStyle}"></Button>
  238. </WrapPanel>
  239. </StackPanel>
  240. </Grid>
  241. <Button
  242. Grid.Row="2"
  243. Margin="20,5"
  244. Command="{Binding TestRobotRun}"
  245. Content="测试抓桶程序"
  246. FontSize="32"
  247. Style="{StaticResource ImageButtonStyle}"></Button>
  248. </Grid>
  249. -->
  250. <!--<ListView
  251. Grid.Row="1"
  252. Background="Transparent"
  253. BorderBrush="#00BEFA"
  254. BorderThickness="0"
  255. ItemsSource="{Binding cylinderModels}"
  256. ScrollViewer.HorizontalScrollBarVisibility="Disabled">
  257. <ListView.ItemsPanel>
  258. <ItemsPanelTemplate>
  259. <UniformGrid
  260. HorizontalAlignment="Left"
  261. VerticalAlignment="Top"
  262. Columns="8" />
  263. </ItemsPanelTemplate>
  264. </ListView.ItemsPanel>
  265. <ListView.ItemTemplate>
  266. <DataTemplate>
  267. <Grid
  268. Width="200"
  269. Height="100"
  270. Margin="0,0,0,15"
  271. Background="Transparent">
  272. <Grid.RowDefinitions>
  273. <RowDefinition Height="30" />
  274. <RowDefinition />
  275. <RowDefinition Height="30" />
  276. </Grid.RowDefinitions>
  277. <Grid.ColumnDefinitions>
  278. <ColumnDefinition Width="0.5*" />
  279. <ColumnDefinition />
  280. <ColumnDefinition />
  281. </Grid.ColumnDefinitions>
  282. <TextBlock
  283. Grid.Column="1"
  284. Grid.ColumnSpan="2"
  285. HorizontalAlignment="Center"
  286. VerticalAlignment="Center"
  287. Foreground="Aqua"
  288. Text="{Binding Name}" />
  289. <pry:Cylinder
  290. Grid.Row="1"
  291. Grid.ColumnSpan="3"
  292. Width="200"
  293. Height="50"
  294. HorizontalAlignment="Center"
  295. VerticalAlignment="Center"
  296. LeftTogIsChecked="{Binding LeftTog}"
  297. RightTogIsChecked="{Binding RightTog}" />
  298. <RadioButton
  299. Grid.Row="2"
  300. Grid.Column="1"
  301. Command="{Binding DataContext.Open, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
  302. CommandParameter="{Binding Name}"
  303. Content="伸出"
  304. Foreground="Aqua"
  305. IsChecked="True"
  306. Style="{StaticResource radioButtonStyle}" />
  307. <RadioButton
  308. Grid.Row="2"
  309. Grid.Column="2"
  310. Command="{Binding DataContext.Close, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
  311. CommandParameter="{Binding Name}"
  312. Content="缩回"
  313. Foreground="Aqua"
  314. IsChecked="False"
  315. Style="{StaticResource radioButtonStyle}" />
  316. </Grid>
  317. </DataTemplate>
  318. </ListView.ItemTemplate>
  319. </ListView>-->
  320. <!--
  321. <Grid Grid.Row="1" Visibility="Hidden">
  322. <Grid.ColumnDefinitions>
  323. <ColumnDefinition></ColumnDefinition>
  324. <ColumnDefinition></ColumnDefinition>
  325. </Grid.ColumnDefinitions>
  326. <Grid.RowDefinitions>
  327. <RowDefinition></RowDefinition>
  328. <RowDefinition></RowDefinition>
  329. </Grid.RowDefinitions>
  330. <Grid Grid.Row="0">
  331. <Button
  332. Margin="20,5"
  333. Command="{Binding RobotGetEmptyBarrel}"
  334. Content="允许机器人抓空桶"
  335. Style="{StaticResource ImageButtonStyle}"></Button>
  336. </Grid>
  337. <Grid Grid.Column="1">
  338. <Button
  339. Margin="20,5"
  340. Command="{Binding RobotPutEmptyBarrel}"
  341. Content="允许机器人放空桶"
  342. Style="{StaticResource ImageButtonStyle}"></Button>
  343. </Grid>
  344. <Grid Grid.Row="1">
  345. <Button
  346. Margin="20,5"
  347. Command="{Binding RobotGetFullBarrel}"
  348. Content="允许机器人抓满桶"
  349. Style="{StaticResource ImageButtonStyle}"></Button>
  350. </Grid>
  351. <Grid Grid.Row="1" Grid.Column="1">
  352. <Button
  353. Margin="20,5"
  354. Command="{Binding RobotPutFullBarrel}"
  355. Content="允许机器人放满桶"
  356. Style="{StaticResource ImageButtonStyle}"></Button>
  357. </Grid>
  358. </Grid>
  359. </Grid>-->
  360. </Grid>
  361. </UserControl>