终端一体化运控平台
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 

305 wiersze
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 RobotGetEmptyBarrelComplete}"></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 RobotPutEmptyBarrelComplete}"></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 RobotGetFullBarrelComplete}"></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 RobotPutFullBarrelComplete}"></TextBlock>
  97. </WrapPanel>
  98. </StackPanel>
  99. </Grid>
  100. <Grid Grid.Column="1">
  101. <Grid.RowDefinitions>
  102. <RowDefinition Height="1*"></RowDefinition>
  103. <RowDefinition Height="7*"></RowDefinition>
  104. </Grid.RowDefinitions>
  105. <Grid>
  106. <Grid.ColumnDefinitions>
  107. <ColumnDefinition></ColumnDefinition>
  108. <ColumnDefinition></ColumnDefinition>
  109. <ColumnDefinition></ColumnDefinition>
  110. <ColumnDefinition></ColumnDefinition>
  111. </Grid.ColumnDefinitions>
  112. <Button
  113. Margin="20,15"
  114. Command="{Binding SystemStart}"
  115. Content="启动"
  116. FontSize="40"
  117. Background="LightGreen"></Button>
  118. <Button
  119. Grid.Column="1"
  120. Margin="20,15"
  121. Command="{Binding SystemStop}"
  122. Content="停止"
  123. FontSize="40"
  124. Background="OrangeRed"></Button>
  125. <Button
  126. Grid.Column="2"
  127. Grid.ColumnSpan="2"
  128. Margin="20,15"
  129. Command="{Binding EStopReset}"
  130. Content="急停复位"
  131. FontSize="40"
  132. Background="DodgerBlue"></Button>
  133. </Grid>
  134. </Grid>
  135. <Grid Grid.Column="2">
  136. <Grid.RowDefinitions>
  137. <RowDefinition></RowDefinition>
  138. <RowDefinition></RowDefinition>
  139. <RowDefinition></RowDefinition>
  140. </Grid.RowDefinitions>
  141. <Grid>
  142. <Grid.ColumnDefinitions>
  143. <ColumnDefinition></ColumnDefinition>
  144. <ColumnDefinition></ColumnDefinition>
  145. </Grid.ColumnDefinitions>
  146. <Grid.RowDefinitions>
  147. <RowDefinition></RowDefinition>
  148. <RowDefinition></RowDefinition>
  149. <RowDefinition></RowDefinition>
  150. </Grid.RowDefinitions>
  151. <Button
  152. Margin="20,5"
  153. Command="{Binding AutoMode}"
  154. Content="自动模式"
  155. FontSize="32"
  156. Panel.ZIndex="0"
  157. Style="{StaticResource ImageButtonStyle}"></Button>
  158. <Button
  159. Grid.Column="1"
  160. Margin="20,5"
  161. Command="{Binding TestMode}"
  162. Content="测试模式"
  163. FontSize="32"
  164. Panel.ZIndex="0"
  165. Style="{StaticResource ImageButtonStyle}"></Button>
  166. <Grid Grid.Row="1" Grid.ColumnSpan="2">
  167. <StackPanel Orientation="Vertical">
  168. <WrapPanel Orientation="Horizontal">
  169. <TextBlock Text="机器人正在运行程序号:" Foreground="#FF2AB2E7" FontSize="25" Margin="10" HorizontalAlignment="Left"></TextBlock>
  170. <TextBlock Text="{Binding IsRunProgramNum}" Foreground="#FF2AB2E7" FontSize="25" Margin="10" HorizontalAlignment="Left" TextAlignment="Center"></TextBlock>
  171. </WrapPanel>
  172. <WrapPanel Orientation="Horizontal" VerticalAlignment="Center">
  173. <TextBlock Text="机器人需要运行程序号:" Foreground="#FF2AB2E7" FontSize="25" Margin="10" HorizontalAlignment="Left"></TextBlock>
  174. <TextBox Text="{Binding SetProgramNum}" Width="50" Foreground="#FF2AB2E7" FontSize="25" Margin="10" HorizontalAlignment="Left" TextAlignment="Center"></TextBox>
  175. <Button FontSize="20" Height="40" Command="{Binding SetProgramNumCommand}" Content="设置" Style="{StaticResource ImageButtonStyle}"></Button>
  176. </WrapPanel>
  177. </StackPanel>
  178. </Grid>
  179. <Button
  180. Grid.Row="2"
  181. Margin="20,5"
  182. Command="{Binding TestRobotRun}"
  183. Content="测试抓桶程序"
  184. FontSize="32"
  185. Style="{StaticResource ImageButtonStyle}"></Button>
  186. </Grid>
  187. <!--<ListView
  188. Grid.Row="1"
  189. Background="Transparent"
  190. BorderBrush="#00BEFA"
  191. BorderThickness="0"
  192. ItemsSource="{Binding cylinderModels}"
  193. ScrollViewer.HorizontalScrollBarVisibility="Disabled">
  194. <ListView.ItemsPanel>
  195. <ItemsPanelTemplate>
  196. <UniformGrid
  197. HorizontalAlignment="Left"
  198. VerticalAlignment="Top"
  199. Columns="8" />
  200. </ItemsPanelTemplate>
  201. </ListView.ItemsPanel>
  202. <ListView.ItemTemplate>
  203. <DataTemplate>
  204. <Grid
  205. Width="200"
  206. Height="100"
  207. Margin="0,0,0,15"
  208. Background="Transparent">
  209. <Grid.RowDefinitions>
  210. <RowDefinition Height="30" />
  211. <RowDefinition />
  212. <RowDefinition Height="30" />
  213. </Grid.RowDefinitions>
  214. <Grid.ColumnDefinitions>
  215. <ColumnDefinition Width="0.5*" />
  216. <ColumnDefinition />
  217. <ColumnDefinition />
  218. </Grid.ColumnDefinitions>
  219. <TextBlock
  220. Grid.Column="1"
  221. Grid.ColumnSpan="2"
  222. HorizontalAlignment="Center"
  223. VerticalAlignment="Center"
  224. Foreground="Aqua"
  225. Text="{Binding Name}" />
  226. <pry:Cylinder
  227. Grid.Row="1"
  228. Grid.ColumnSpan="3"
  229. Width="200"
  230. Height="50"
  231. HorizontalAlignment="Center"
  232. VerticalAlignment="Center"
  233. LeftTogIsChecked="{Binding LeftTog}"
  234. RightTogIsChecked="{Binding RightTog}" />
  235. <RadioButton
  236. Grid.Row="2"
  237. Grid.Column="1"
  238. Command="{Binding DataContext.Open, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
  239. CommandParameter="{Binding Name}"
  240. Content="伸出"
  241. Foreground="Aqua"
  242. IsChecked="True"
  243. Style="{StaticResource radioButtonStyle}" />
  244. <RadioButton
  245. Grid.Row="2"
  246. Grid.Column="2"
  247. Command="{Binding DataContext.Close, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
  248. CommandParameter="{Binding Name}"
  249. Content="缩回"
  250. Foreground="Aqua"
  251. IsChecked="False"
  252. Style="{StaticResource radioButtonStyle}" />
  253. </Grid>
  254. </DataTemplate>
  255. </ListView.ItemTemplate>
  256. </ListView>-->
  257. <Grid Grid.Row="1" Visibility="Hidden">
  258. <Grid.ColumnDefinitions>
  259. <ColumnDefinition></ColumnDefinition>
  260. <ColumnDefinition></ColumnDefinition>
  261. </Grid.ColumnDefinitions>
  262. <Grid.RowDefinitions>
  263. <RowDefinition></RowDefinition>
  264. <RowDefinition></RowDefinition>
  265. </Grid.RowDefinitions>
  266. <Grid Grid.Row="0">
  267. <Button
  268. Margin="20,5"
  269. Command="{Binding RobotGetEmptyBarrel}"
  270. Content="允许机器人抓空桶"
  271. Style="{StaticResource ImageButtonStyle}"></Button>
  272. </Grid>
  273. <Grid Grid.Column="1">
  274. <Button
  275. Margin="20,5"
  276. Command="{Binding RobotPutEmptyBarrel}"
  277. Content="允许机器人放空桶"
  278. Style="{StaticResource ImageButtonStyle}"></Button>
  279. </Grid>
  280. <Grid Grid.Row="1">
  281. <Button
  282. Margin="20,5"
  283. Command="{Binding RobotGetFullBarrel}"
  284. Content="允许机器人抓满桶"
  285. Style="{StaticResource ImageButtonStyle}"></Button>
  286. </Grid>
  287. <Grid Grid.Row="1" Grid.Column="1">
  288. <Button
  289. Margin="20,5"
  290. Command="{Binding RobotPutFullBarrel}"
  291. Content="允许机器人放满桶"
  292. Style="{StaticResource ImageButtonStyle}"></Button>
  293. </Grid>
  294. </Grid>
  295. </Grid>
  296. </Grid>
  297. </UserControl>