终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

309 line
16 KiB

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