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

DebugView.xaml 21 KiB

2 jaren geleden
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399
  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.MorkTLebaiJC.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>
  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="20*"/>
  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" SelectedIndex="{Binding Lebai_DO_CH}">
  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" SelectedIndex="{Binding Lebai_DO_Value}">
  107. <ComboBoxItem IsSelected="true">true</ComboBoxItem>
  108. <ComboBoxItem>false</ComboBoxItem>
  109. </ComboBox>
  110. <Button Width="50" Margin="260,12,10,10" Command="{Binding Button_LebaiDOuputCommand}" >输出</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.RowDefinitions>
  121. <RowDefinition Height="3*"/>
  122. <RowDefinition Height="3*"/>
  123. <RowDefinition Height="3*"/>
  124. </Grid.RowDefinitions>
  125. <TextBlock Text="连接状态" />
  126. <TextBlock Text="{Binding JuicerConnected}"
  127. Margin="120,0,0,0"/>
  128. <Grid Grid.Row="1">
  129. <Grid.RowDefinitions>
  130. <RowDefinition></RowDefinition>
  131. </Grid.RowDefinitions>
  132. <Grid.ColumnDefinitions>
  133. <ColumnDefinition Width="120"/>
  134. <ColumnDefinition></ColumnDefinition>
  135. </Grid.ColumnDefinitions>
  136. <TextBlock Text="设备状态" />
  137. <Grid Grid.Column="1">
  138. <Grid.RowDefinitions>
  139. <RowDefinition></RowDefinition>
  140. </Grid.RowDefinitions>
  141. <Grid.ColumnDefinitions>
  142. <ColumnDefinition></ColumnDefinition>
  143. <ColumnDefinition></ColumnDefinition>
  144. <ColumnDefinition></ColumnDefinition>
  145. <ColumnDefinition></ColumnDefinition>
  146. <ColumnDefinition></ColumnDefinition>
  147. </Grid.ColumnDefinitions>
  148. <TextBlock Grid.Column="0" Name="Heating" HorizontalAlignment="Center">制热</TextBlock>
  149. <TextBlock Grid.Column="1" Name="cooling" HorizontalAlignment="Center">制冷</TextBlock>
  150. <TextBlock Grid.Column="2" Name="LackOfWater" HorizontalAlignment="Center">缺水</TextBlock>
  151. <TextBlock Grid.Column="3" Name="ChildLocks" HorizontalAlignment="Center">童锁</TextBlock>
  152. <TextBlock Grid.Column="4" Name="Use" HorizontalAlignment="Center">使用</TextBlock>
  153. </Grid>
  154. </Grid>
  155. <StackPanel Grid.Row="2" Orientation="Vertical">
  156. <StackPanel Margin="0,10,0,0" Orientation="Horizontal">
  157. <TextBlock>果汁</TextBlock>
  158. <ComboBox Margin="100,0,0,0"
  159. Width="100" >
  160. <ComboBoxItem IsSelected="true">饮品1</ComboBoxItem>
  161. <ComboBoxItem>饮品2</ComboBoxItem>
  162. <ComboBoxItem>饮品3</ComboBoxItem>
  163. <ComboBoxItem>饮品4</ComboBoxItem>
  164. </ComboBox>
  165. <ComboBox Margin="20,0,0,0" Width="100">
  166. <ComboBoxItem IsSelected="true">冷饮</ComboBoxItem>
  167. <ComboBoxItem>热饮</ComboBoxItem>
  168. </ComboBox>
  169. <Button Command="{Binding Button_MakeIceCreamCommand}"
  170. Margin="20,0"
  171. Content="制作" />
  172. </StackPanel>
  173. <StackPanel Margin="0,10,0,0" Orientation="Horizontal">
  174. </StackPanel>
  175. </StackPanel>
  176. </Grid>
  177. </GroupBox>
  178. <GroupBox Grid.Row="2" Grid.Column="1"
  179. FontFamily="楷体"
  180. FontSize="20"
  181. Header=" 咖啡机">
  182. <Grid>
  183. <Grid.RowDefinitions>
  184. <RowDefinition Height="30"/>
  185. <RowDefinition />
  186. <RowDefinition />
  187. </Grid.RowDefinitions>
  188. <TextBlock Text="连接状态" />
  189. <TextBlock Text="{Binding CoffeeConnected}"
  190. Margin="120,0,0,0"/>
  191. <Grid Grid.Row="1">
  192. <Grid.Resources>
  193. <Style TargetType="TextBlock">
  194. <Setter Property="HorizontalAlignment" Value="Left" />
  195. <Setter Property="VerticalAlignment" Value="Center" />
  196. </Style>
  197. </Grid.Resources>
  198. <Grid.RowDefinitions>
  199. <RowDefinition />
  200. <RowDefinition />
  201. </Grid.RowDefinitions>
  202. <Grid.ColumnDefinitions>
  203. <ColumnDefinition Width="99" />
  204. <ColumnDefinition Width="140" />
  205. <ColumnDefinition Width="100" />
  206. <ColumnDefinition Width="171" />
  207. </Grid.ColumnDefinitions>
  208. <TextBlock Height="23" Width="100" FontSize="18" HorizontalAlignment="Center">咖啡机状态</TextBlock>
  209. <TextBlock FontSize="18"
  210. Grid.Column="1"
  211. Text="{Binding CoffeeStatus}" Height="23" />
  212. <TextBlock Grid.Column="2" Height="23" Width="80" FontSize="18">应用状态</TextBlock>
  213. <TextBlock FontSize="18"
  214. Grid.Column="3"
  215. Text="{Binding AppStatus}" Height="23"/>
  216. <TextBlock Grid.Row="1" Grid.Column="0" Height="22" Width="80" FontSize="18">告警信息</TextBlock>
  217. <TextBlock FontSize="15"
  218. Grid.Row="1"
  219. Grid.Column="1"
  220. Text="{Binding Warning}" />
  221. <TextBlock Grid.Row="1" Grid.Column="2" Height="22" Width="80" FontSize="18">故障信息</TextBlock>
  222. <TextBlock FontSize="18"
  223. Grid.Row="1"
  224. Grid.Column="3"
  225. Text="{Binding CaffeeFault}" Height="22" Width="60" />
  226. </Grid>
  227. <StackPanel Grid.Row="2" Orientation="Vertical">
  228. <StackPanel Margin="0,10,0,0" Orientation="Horizontal">
  229. <TextBlock>饮品</TextBlock>
  230. <ComboBox Margin="10,0"
  231. Width="100"
  232. ItemsSource="{Binding Coffees}"
  233. SelectedItem="{Binding SelectedCoffee}" />
  234. <Button Margin="10,0"
  235. Command="{}"
  236. Content="制作"/>
  237. <Button Margin="10,0"
  238. Command="{}"
  239. Content="停止制作"/>
  240. </StackPanel>
  241. <StackPanel Margin="0,10,0,0" Orientation="Horizontal">
  242. <TextBlock>模式</TextBlock>
  243. <ComboBox Margin="10,0"
  244. Width="100"
  245. ItemsSource="{Binding CoffeeCmds}"
  246. SelectedItem="{Binding SelectedCoffeeCmd}"/>
  247. <Button Margin="10,0"
  248. Command="{}"
  249. Content="设置" Cursor="Hand"/>
  250. </StackPanel>
  251. </StackPanel>
  252. </Grid>
  253. </GroupBox>
  254. <GroupBox Header="单片机控制"
  255. FontSize="18"
  256. Grid.Row="1" Grid.ColumnSpan="2"
  257. Margin="0,0,0,10">
  258. <Grid>
  259. <Grid.RowDefinitions>
  260. <RowDefinition></RowDefinition>
  261. </Grid.RowDefinitions>
  262. <Grid.ColumnDefinitions>
  263. <ColumnDefinition Width="5*"/>
  264. <ColumnDefinition Width="5*"/>
  265. <ColumnDefinition Width="13*"/>
  266. <ColumnDefinition Width="7*"/>
  267. </Grid.ColumnDefinitions>
  268. <Grid Grid.Column="0" >
  269. <TextBlock FontSize="12">连接状态</TextBlock>
  270. <TextBlock Text="{Binding MCUConnected}"
  271. Margin="70,0,0,0"/>
  272. <TextBlock FontSize="12"></TextBlock>
  273. </Grid>
  274. <Grid Grid.Column="1" >
  275. <Grid>
  276. <Grid.RowDefinitions>
  277. <RowDefinition></RowDefinition>
  278. <RowDefinition></RowDefinition>
  279. </Grid.RowDefinitions>
  280. <Grid.ColumnDefinitions>
  281. <ColumnDefinition></ColumnDefinition>
  282. <ColumnDefinition></ColumnDefinition>
  283. </Grid.ColumnDefinitions>
  284. <Grid Grid.Row="0" Grid.Column="0" >
  285. <TextBlock FontSize="12" HorizontalAlignment="Center">舵机控制</TextBlock>
  286. </Grid>
  287. <Grid Grid.Row="0" Grid.Column="1">
  288. <ComboBox Margin="0,0,0,0" FontSize="12" Width="60" SelectedIndex="{Binding MCU_PWM_CH}">
  289. <ComboBoxItem IsSelected="true">舵机1</ComboBoxItem>
  290. <ComboBoxItem>舵机2</ComboBoxItem>
  291. <ComboBoxItem>舵机3</ComboBoxItem>
  292. <ComboBoxItem>舵机4</ComboBoxItem>
  293. </ComboBox>
  294. </Grid>
  295. <Grid Grid.Row="1" Grid.Column="0">
  296. <Button FontSize="15" HorizontalAlignment="Center" Command="{Binding Button_MCUOuputCommand}">输出</Button>
  297. </Grid>
  298. <Grid Grid.Row="1" Grid.Column="1" Width="60" >
  299. <TextBox Text="{Binding PWMInputNumber}"></TextBox>
  300. </Grid>
  301. </Grid>
  302. </Grid>
  303. <Grid Grid.Column="2" >
  304. <Grid>
  305. <Grid.RowDefinitions>
  306. <RowDefinition></RowDefinition>
  307. <RowDefinition></RowDefinition>
  308. </Grid.RowDefinitions>
  309. <Grid.ColumnDefinitions>
  310. <ColumnDefinition></ColumnDefinition>
  311. </Grid.ColumnDefinitions>
  312. <Grid Grid.Row="0" Grid.Column="0" >
  313. <TextBlock FontSize="12" HorizontalAlignment="Center">DI输入</TextBlock>
  314. </Grid>
  315. <Grid Grid.Row="1" Grid.Column="0" Width="400">
  316. <Grid>
  317. <Grid.ColumnDefinitions>
  318. <ColumnDefinition></ColumnDefinition>
  319. <ColumnDefinition></ColumnDefinition>
  320. <ColumnDefinition></ColumnDefinition>
  321. <ColumnDefinition></ColumnDefinition>
  322. <ColumnDefinition></ColumnDefinition>
  323. <ColumnDefinition></ColumnDefinition>
  324. <ColumnDefinition></ColumnDefinition>
  325. <ColumnDefinition></ColumnDefinition>
  326. </Grid.ColumnDefinitions>
  327. <Grid Grid.Column="0">
  328. <CheckBox FontSize="12" IsEnabled="false" IsChecked="{Binding CH0}">DI0</CheckBox>
  329. </Grid>
  330. <Grid Grid.Column="1">
  331. <CheckBox FontSize="12" IsEnabled="false" Name="CH1">DI1</CheckBox>
  332. </Grid>
  333. <Grid Grid.Column="2">
  334. <CheckBox FontSize="12" IsEnabled="false" Name="CH2">DI2</CheckBox>
  335. </Grid>
  336. <Grid Grid.Column="3">
  337. <CheckBox FontSize="12" IsEnabled="false" Name="CH3">DI3</CheckBox>
  338. </Grid>
  339. <Grid Grid.Column="4">
  340. <CheckBox FontSize="12" IsEnabled="false" Name="CH4">DI4</CheckBox>
  341. </Grid>
  342. <Grid Grid.Column="5">
  343. <CheckBox FontSize="12" IsEnabled="false" Name="CH5">DI5</CheckBox>
  344. </Grid>
  345. <Grid Grid.Column="6">
  346. <CheckBox FontSize="12" IsEnabled="false" Name="CH6">DI6</CheckBox>
  347. </Grid>
  348. <Grid Grid.Column="7">
  349. <CheckBox FontSize="12" IsEnabled="false" Name="CH7">DI7</CheckBox>
  350. </Grid>
  351. </Grid>
  352. </Grid>
  353. </Grid>
  354. </Grid>
  355. <Grid Grid.Column="3" >
  356. <Grid.RowDefinitions>
  357. <RowDefinition></RowDefinition>
  358. <RowDefinition></RowDefinition>
  359. </Grid.RowDefinitions>
  360. <Grid.ColumnDefinitions>
  361. <ColumnDefinition></ColumnDefinition>
  362. <ColumnDefinition></ColumnDefinition>
  363. </Grid.ColumnDefinitions>
  364. <Grid Grid.Column="0">
  365. <TextBlock FontSize="12" HorizontalAlignment="Center">DO输出</TextBlock>
  366. </Grid>
  367. <Grid Grid.Column="1" Grid.Row="0">
  368. <ComboBox Width="50" FontSize="12" HorizontalAlignment="Center" SelectedIndex="{Binding MCU_DO_CH}">
  369. <ComboBoxItem IsSelected="true">DO0</ComboBoxItem>
  370. <ComboBoxItem>DO1</ComboBoxItem>
  371. <ComboBoxItem>DO2</ComboBoxItem>
  372. <ComboBoxItem>DO3</ComboBoxItem>
  373. <ComboBoxItem>DO4</ComboBoxItem>
  374. <ComboBoxItem>DO5</ComboBoxItem>
  375. <ComboBoxItem>DO6</ComboBoxItem>
  376. <ComboBoxItem>DO7</ComboBoxItem>
  377. </ComboBox>
  378. </Grid>
  379. <Grid Grid.Column="0" Grid.Row="1">
  380. <Button Width="50" Command="{Binding Button_MCUDOuputCommand}">输出</Button>
  381. </Grid>
  382. <Grid Grid.Column="1" Grid.Row="1">
  383. <RadioButton FontSize="12" IsChecked="{Binding MCU_DO_Value}">True</RadioButton>
  384. <RadioButton Margin="50,0,0,0" FontSize="12">false</RadioButton>
  385. </Grid>
  386. </Grid>
  387. </Grid>
  388. </GroupBox>
  389. </Grid>
  390. </UserControl>