终端一体化运控平台
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.
 
 
 

409 lines
22 KiB

  1. <UserControl x:Class="BPASmartClient.MorkTJAKAJC.View.DebugView"
  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:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:vm="clr-namespace:BPASmartClient.MorkTJAKAJC.ViewModel"
  7. mc:Ignorable="d"
  8. Name="调试界面"
  9. d:DesignHeight="500" d:DesignWidth="1000" Unloaded="Dubug_Unloaded">
  10. <UserControl.DataContext>
  11. <vm:DebugViewModel/>
  12. </UserControl.DataContext>
  13. <UserControl.Resources>
  14. <ResourceDictionary>
  15. <ResourceDictionary.MergedDictionaries>
  16. <ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/GenricStyle.xaml" />
  17. <ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/MyStyle.xaml" />
  18. </ResourceDictionary.MergedDictionaries>
  19. </ResourceDictionary>
  20. </UserControl.Resources>
  21. <Grid Grid.ColumnSpan="2">
  22. <Grid.ColumnDefinitions>
  23. <ColumnDefinition Width="10*"/>
  24. <ColumnDefinition Width="10*"/>
  25. </Grid.ColumnDefinitions>
  26. <Grid.RowDefinitions>
  27. <RowDefinition Height="10*"/>
  28. <RowDefinition Height="10*"/>
  29. <RowDefinition Height="15*"/>
  30. </Grid.RowDefinitions>
  31. <GroupBox Grid.ColumnSpan="2"
  32. FontFamily="楷体"
  33. FontSize="20"
  34. Header=" 乐白机器人 ">
  35. <Grid Margin="10">
  36. <Grid.RowDefinitions>
  37. <RowDefinition Height="*"/>
  38. <RowDefinition Height="*"/>
  39. <RowDefinition Height="3*"/>
  40. </Grid.RowDefinitions>
  41. <StackPanel Orientation="Horizontal">
  42. <TextBlock Text="连接状态" />
  43. <TextBlock Text="{Binding RobotConnected}"
  44. Margin="40,0"/>
  45. <TextBlock Text="机器人模式:"/>
  46. <TextBlock Text="{Binding RobotMode}"
  47. Margin="40,0"/>
  48. </StackPanel>
  49. <TextBlock Text="连接状态" />
  50. <TextBlock Text="{Binding RobotConnected}"
  51. Margin="120,0,0,0"/>
  52. <ListBox Grid.Row="2" Background="Transparent" Margin="0,0,0,-9">
  53. <ListBox.Template>
  54. <ControlTemplate TargetType="{x:Type ListBox}">
  55. <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
  56. <WrapPanel Orientation="Horizontal" IsItemsHost="True" ScrollViewer.CanContentScroll="True"/>
  57. </ScrollViewer>
  58. </ControlTemplate>
  59. </ListBox.Template>
  60. <Button Content="机器人启动"
  61. Margin="20,5" Width="80" Height="40"
  62. Command="{Binding Button_RobotControlCommand}"
  63. CommandParameter="机器人启动">
  64. </Button>
  65. <Button Content="启动示教"
  66. Margin="20,5" Width="80" Height="40"
  67. Command="{Binding Button_RobotControlCommand}"
  68. CommandParameter="启动示教"/>
  69. <Button Content="停止示教"
  70. Margin="20,5" Width="80" Height="40"
  71. Command="{Binding Button_RobotControlCommand}"
  72. CommandParameter="停止示教"/>
  73. <Button Content="机器人急停"
  74. Margin="20,5" Width="80" Height="40"
  75. Command="{Binding Button_RobotControlCommand}"
  76. CommandParameter="机器人急停"/>
  77. <Button Content="暂停"
  78. Margin="10,5" Width="40" Height="40"
  79. Command="{Binding Button_RobotControlCommand}"
  80. CommandParameter="暂停"/>
  81. <Button Content="恢复"
  82. Margin="10,5" Width="40" Height="40"
  83. Command="{Binding Button_RobotControlCommand}"
  84. CommandParameter="恢复"/>
  85. </ListBox>
  86. <Grid Margin="629,-24,19,0" Grid.RowSpan="3">
  87. <Grid.RowDefinitions>
  88. <RowDefinition></RowDefinition>
  89. <RowDefinition></RowDefinition>
  90. </Grid.RowDefinitions>
  91. <Grid Grid.Row="0">
  92. <TextBlock>DI</TextBlock>
  93. <CheckBox Margin="50,0,0,0" IsEnabled="false" Name="Robot_DI0">DI0</CheckBox>
  94. <CheckBox Margin="120,0,0,0" IsEnabled="false" Name="Robot_DI1">DI1</CheckBox>
  95. <CheckBox Margin="190,0,0,0" IsEnabled="false" Name="Robot_DI2">DI2</CheckBox>
  96. <CheckBox Margin="260,0,0,0" IsEnabled="false" Name="Robot_DI3">DI3</CheckBox>
  97. </Grid>
  98. <Grid Grid.Row="1">
  99. <TextBlock Width="50">DO</TextBlock>
  100. <ComboBox Width="70" Margin="50,12,268,10">
  101. <ComboBoxItem IsSelected="true">DO0</ComboBoxItem>
  102. <ComboBoxItem>DO1</ComboBoxItem>
  103. <ComboBoxItem>DO2</ComboBoxItem>
  104. <ComboBoxItem>DO3</ComboBoxItem>
  105. </ComboBox>
  106. <ComboBox Margin="142,12,108,10" Width="70">
  107. <ComboBoxItem IsSelected="true">true</ComboBoxItem>
  108. <ComboBoxItem>false</ComboBoxItem>
  109. </ComboBox>
  110. <Button Width="50" Margin="260,12,10,10">输出</Button>
  111. </Grid>
  112. </Grid>
  113. </Grid>
  114. </GroupBox>
  115. <GroupBox Grid.Row="2"
  116. FontFamily="楷体"
  117. FontSize="20"
  118. Header=" 果汁机 ">
  119. <Grid>
  120. <Grid.ColumnDefinitions>
  121. <ColumnDefinition Width="47*"/>
  122. <ColumnDefinition Width="75*"/>
  123. </Grid.ColumnDefinitions>
  124. <Grid.RowDefinitions>
  125. <RowDefinition Height="3*"/>
  126. <RowDefinition Height="3*"/>
  127. <RowDefinition Height="3*"/>
  128. </Grid.RowDefinitions>
  129. <TextBlock Text="连接状态" />
  130. <TextBlock Text="{Binding JuicerConnected}"
  131. Margin="120,0,0,0"/>
  132. <Grid Grid.ColumnSpan="2" Margin="0,71,0,71" Grid.RowSpan="3">
  133. <Grid.RowDefinitions>
  134. <RowDefinition></RowDefinition>
  135. </Grid.RowDefinitions>
  136. <Grid.ColumnDefinitions>
  137. <ColumnDefinition Width="120"/>
  138. <ColumnDefinition></ColumnDefinition>
  139. </Grid.ColumnDefinitions>
  140. <TextBlock Text="设备状态" />
  141. <Grid Grid.Column="1">
  142. <Grid.RowDefinitions>
  143. <RowDefinition></RowDefinition>
  144. </Grid.RowDefinitions>
  145. <Grid.ColumnDefinitions>
  146. <ColumnDefinition></ColumnDefinition>
  147. <ColumnDefinition></ColumnDefinition>
  148. <ColumnDefinition></ColumnDefinition>
  149. <ColumnDefinition></ColumnDefinition>
  150. <ColumnDefinition></ColumnDefinition>
  151. </Grid.ColumnDefinitions>
  152. <TextBlock Grid.Column="0" Name="Heating" HorizontalAlignment="Center">制热</TextBlock>
  153. <TextBlock Grid.Column="1" Name="cooling" HorizontalAlignment="Center">制冷</TextBlock>
  154. <TextBlock Grid.Column="2" Name="LackOfWater" HorizontalAlignment="Center">缺水</TextBlock>
  155. <TextBlock Grid.Column="3" Name="ChildLocks" HorizontalAlignment="Center">童锁</TextBlock>
  156. <TextBlock Grid.Column="4" Name="Use" HorizontalAlignment="Center">使用</TextBlock>
  157. </Grid>
  158. </Grid>
  159. <StackPanel Grid.Row="2" Orientation="Vertical" Grid.ColumnSpan="2">
  160. <StackPanel Margin="0,10,0,0" Orientation="Horizontal">
  161. <TextBlock>果汁</TextBlock>
  162. <ComboBox Margin="100,0,0,0"
  163. Width="80" >
  164. <ComboBoxItem IsSelected="true">饮品1</ComboBoxItem>
  165. <ComboBoxItem>饮品2</ComboBoxItem>
  166. <ComboBoxItem>饮品3</ComboBoxItem>
  167. <ComboBoxItem>饮品4</ComboBoxItem>
  168. </ComboBox>
  169. <ComboBox Margin="20,0,0,0"
  170. Width="80" >
  171. <ComboBoxItem IsSelected="true">加冰</ComboBoxItem>
  172. <ComboBoxItem>不加冰</ComboBoxItem>
  173. </ComboBox>
  174. <ComboBox Margin="20,0,0,0" Width="80">
  175. <ComboBoxItem IsSelected="true">冷饮</ComboBoxItem>
  176. <ComboBoxItem>热饮</ComboBoxItem>
  177. </ComboBox>
  178. <Button Command="{Binding Button_MakeIceCreamCommand}"
  179. Margin="20,0"
  180. Content="制作" />
  181. </StackPanel>
  182. <StackPanel Margin="0,10,0,0" Orientation="Horizontal">
  183. </StackPanel>
  184. </StackPanel>
  185. </Grid>
  186. </GroupBox>
  187. <GroupBox Grid.Row="2" Grid.Column="1"
  188. FontFamily="楷体"
  189. FontSize="20"
  190. Header=" 咖啡机">
  191. <Grid>
  192. <Grid.RowDefinitions>
  193. <RowDefinition Height="30"/>
  194. <RowDefinition />
  195. <RowDefinition />
  196. </Grid.RowDefinitions>
  197. <TextBlock Text="连接状态" />
  198. <TextBlock Text="{Binding CoffeeConnected}"
  199. Margin="120,0,0,0"/>
  200. <Grid Grid.Row="1">
  201. <Grid.Resources>
  202. <Style TargetType="TextBlock">
  203. <Setter Property="HorizontalAlignment" Value="Left" />
  204. <Setter Property="VerticalAlignment" Value="Center" />
  205. </Style>
  206. </Grid.Resources>
  207. <Grid.RowDefinitions>
  208. <RowDefinition />
  209. <RowDefinition />
  210. </Grid.RowDefinitions>
  211. <Grid.ColumnDefinitions>
  212. <ColumnDefinition Width="99" />
  213. <ColumnDefinition Width="140" />
  214. <ColumnDefinition Width="100" />
  215. <ColumnDefinition Width="171" />
  216. </Grid.ColumnDefinitions>
  217. <TextBlock Height="23" Width="100" FontSize="18" HorizontalAlignment="Center">咖啡机状态</TextBlock>
  218. <TextBlock FontSize="18"
  219. Grid.Column="1"
  220. Text="{Binding CoffeeStatus}" Height="23" />
  221. <TextBlock Grid.Column="2" Height="23" Width="80" FontSize="18">应用状态</TextBlock>
  222. <TextBlock FontSize="18"
  223. Grid.Column="3"
  224. Text="{Binding AppStatus}" Height="23"/>
  225. <TextBlock Grid.Row="1" Grid.Column="0" Height="22" Width="80" FontSize="18">告警信息</TextBlock>
  226. <TextBlock FontSize="15"
  227. Grid.Row="1"
  228. Grid.Column="1"
  229. Text="{Binding Warning}" />
  230. <TextBlock Grid.Row="1" Grid.Column="2" Height="22" Width="80" FontSize="18">故障信息</TextBlock>
  231. <TextBlock FontSize="18"
  232. Grid.Row="1"
  233. Grid.Column="3"
  234. Text="{Binding CaffeeFault}" Height="22" Width="60" />
  235. </Grid>
  236. <StackPanel Grid.Row="2" Orientation="Vertical">
  237. <StackPanel Margin="0,10,0,0" Orientation="Horizontal">
  238. <TextBlock>饮品</TextBlock>
  239. <ComboBox Margin="10,0"
  240. Width="100"
  241. ItemsSource="{Binding Coffees}"
  242. SelectedItem="{Binding SelectedCoffee}" />
  243. <Button Margin="10,0"
  244. Command="{}"
  245. Content="制作"/>
  246. <Button Margin="10,0"
  247. Command="{}"
  248. Content="停止制作"/>
  249. </StackPanel>
  250. <StackPanel Margin="0,10,0,0" Orientation="Horizontal">
  251. <TextBlock>模式</TextBlock>
  252. <ComboBox Margin="10,0"
  253. Width="100"
  254. ItemsSource="{Binding CoffeeCmds}"
  255. SelectedItem="{Binding SelectedCoffeeCmd}"/>
  256. <Button Margin="10,0"
  257. Command="{}"
  258. Content="设置" Cursor="Hand"/>
  259. </StackPanel>
  260. </StackPanel>
  261. </Grid>
  262. </GroupBox>
  263. <GroupBox Header="单片机控制"
  264. FontSize="18"
  265. Grid.Row="1" Grid.ColumnSpan="2"
  266. Margin="0,0,0,10">
  267. <Grid>
  268. <Grid.RowDefinitions>
  269. <RowDefinition></RowDefinition>
  270. </Grid.RowDefinitions>
  271. <Grid.ColumnDefinitions>
  272. <ColumnDefinition Width="5*"/>
  273. <ColumnDefinition Width="5*"/>
  274. <ColumnDefinition Width="13*"/>
  275. <ColumnDefinition Width="7*"/>
  276. </Grid.ColumnDefinitions>
  277. <Grid Grid.Column="0" >
  278. <TextBlock FontSize="12">连接状态</TextBlock>
  279. <TextBlock Text="{Binding MCUConnected}"
  280. Margin="70,0,0,0"/>
  281. <TextBlock FontSize="12"></TextBlock>
  282. </Grid>
  283. <Grid Grid.Column="1" >
  284. <Grid>
  285. <Grid.RowDefinitions>
  286. <RowDefinition></RowDefinition>
  287. <RowDefinition></RowDefinition>
  288. </Grid.RowDefinitions>
  289. <Grid.ColumnDefinitions>
  290. <ColumnDefinition></ColumnDefinition>
  291. <ColumnDefinition></ColumnDefinition>
  292. </Grid.ColumnDefinitions>
  293. <Grid Grid.Row="0" Grid.Column="0" >
  294. <TextBlock FontSize="12" HorizontalAlignment="Center">舵机控制</TextBlock>
  295. </Grid>
  296. <Grid Grid.Row="0" Grid.Column="1">
  297. <ComboBox Margin="0,0,0,0" FontSize="12" Width="60" SelectedIndex="{Binding MCU_PWM_CH}">
  298. <ComboBoxItem IsSelected="true">舵机1</ComboBoxItem>
  299. <ComboBoxItem>舵机2</ComboBoxItem>
  300. <ComboBoxItem>舵机3</ComboBoxItem>
  301. <ComboBoxItem>舵机4</ComboBoxItem>
  302. </ComboBox>
  303. </Grid>
  304. <Grid Grid.Row="1" Grid.Column="0">
  305. <Button FontSize="15" HorizontalAlignment="Center" Command="{Binding Button_MCUOuputCommand}">输出</Button>
  306. </Grid>
  307. <Grid Grid.Row="1" Grid.Column="1" Width="60" >
  308. <TextBox Text="{Binding PWMInputNumber}"></TextBox>
  309. </Grid>
  310. </Grid>
  311. </Grid>
  312. <Grid Grid.Column="2" >
  313. <Grid>
  314. <Grid.RowDefinitions>
  315. <RowDefinition></RowDefinition>
  316. <RowDefinition></RowDefinition>
  317. </Grid.RowDefinitions>
  318. <Grid.ColumnDefinitions>
  319. <ColumnDefinition></ColumnDefinition>
  320. </Grid.ColumnDefinitions>
  321. <Grid Grid.Row="0" Grid.Column="0" >
  322. <TextBlock FontSize="12" HorizontalAlignment="Center">DI输入</TextBlock>
  323. </Grid>
  324. <Grid Grid.Row="1" Grid.Column="0" Width="400">
  325. <Grid>
  326. <Grid.ColumnDefinitions>
  327. <ColumnDefinition></ColumnDefinition>
  328. <ColumnDefinition></ColumnDefinition>
  329. <ColumnDefinition></ColumnDefinition>
  330. <ColumnDefinition></ColumnDefinition>
  331. <ColumnDefinition></ColumnDefinition>
  332. <ColumnDefinition></ColumnDefinition>
  333. <ColumnDefinition></ColumnDefinition>
  334. <ColumnDefinition></ColumnDefinition>
  335. </Grid.ColumnDefinitions>
  336. <Grid Grid.Column="0">
  337. <CheckBox FontSize="12" IsEnabled="false" IsChecked="{Binding CH0}">DI0</CheckBox>
  338. </Grid>
  339. <Grid Grid.Column="1">
  340. <CheckBox FontSize="12" IsEnabled="false" Name="CH1">DI1</CheckBox>
  341. </Grid>
  342. <Grid Grid.Column="2">
  343. <CheckBox FontSize="12" IsEnabled="false" Name="CH2">DI2</CheckBox>
  344. </Grid>
  345. <Grid Grid.Column="3">
  346. <CheckBox FontSize="12" IsEnabled="false" Name="CH3">DI3</CheckBox>
  347. </Grid>
  348. <Grid Grid.Column="4">
  349. <CheckBox FontSize="12" IsEnabled="false" Name="CH4">DI4</CheckBox>
  350. </Grid>
  351. <Grid Grid.Column="5">
  352. <CheckBox FontSize="12" IsEnabled="false" Name="CH5">DI5</CheckBox>
  353. </Grid>
  354. <Grid Grid.Column="6">
  355. <CheckBox FontSize="12" IsEnabled="false" Name="CH6">DI6</CheckBox>
  356. </Grid>
  357. <Grid Grid.Column="7">
  358. <CheckBox FontSize="12" IsEnabled="false" Name="CH7">DI7</CheckBox>
  359. </Grid>
  360. </Grid>
  361. </Grid>
  362. </Grid>
  363. </Grid>
  364. <Grid Grid.Column="3" >
  365. <Grid.RowDefinitions>
  366. <RowDefinition></RowDefinition>
  367. <RowDefinition></RowDefinition>
  368. </Grid.RowDefinitions>
  369. <Grid.ColumnDefinitions>
  370. <ColumnDefinition></ColumnDefinition>
  371. <ColumnDefinition></ColumnDefinition>
  372. </Grid.ColumnDefinitions>
  373. <Grid Grid.Column="0">
  374. <TextBlock FontSize="12" HorizontalAlignment="Center">DO输出</TextBlock>
  375. </Grid>
  376. <Grid Grid.Column="1" Grid.Row="0">
  377. <ComboBox Width="50" FontSize="12" HorizontalAlignment="Center" SelectedIndex="{Binding MCU_DO_CH}">
  378. <ComboBoxItem IsSelected="true">DO0</ComboBoxItem>
  379. <ComboBoxItem>DO1</ComboBoxItem>
  380. <ComboBoxItem>DO2</ComboBoxItem>
  381. <ComboBoxItem>DO3</ComboBoxItem>
  382. <ComboBoxItem>DO4</ComboBoxItem>
  383. <ComboBoxItem>DO5</ComboBoxItem>
  384. <ComboBoxItem>DO6</ComboBoxItem>
  385. <ComboBoxItem>DO7</ComboBoxItem>
  386. </ComboBox>
  387. </Grid>
  388. <Grid Grid.Column="0" Grid.Row="1">
  389. <Button Width="50" Command="{Binding Button_MCUDOuputCommand}">输出</Button>
  390. </Grid>
  391. <Grid Grid.Column="1" Grid.Row="1">
  392. <RadioButton FontSize="12" IsChecked="{Binding MCU_DO_Value}">True</RadioButton>
  393. <RadioButton Margin="50,0,0,0" FontSize="12">false</RadioButton>
  394. </Grid>
  395. </Grid>
  396. </Grid>
  397. </GroupBox>
  398. </Grid>
  399. </UserControl>