FeederOutput.xaml 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <UserControl x:Class="TeamAAS_VP.Controls.FeederOutput"
  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:local="clr-namespace:TeamAAS_VP.Controls"
  7. xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
  8. xmlns:material="http://materialdesigninxaml.net/winfx/xaml/themes"
  9. xmlns:behavior="http://schemas.microsoft.com/xaml/behaviors"
  10. xmlns:sys="clr-namespace:System;assembly=mscorlib"
  11. xmlns:lex="http://wpflocalizeextension.codeplex.com"
  12. lex:LocalizeDictionary.DesignCulture="zh-CN"
  13. lex:ResxLocalizationProvider.DefaultAssembly="TeamAAS-VP"
  14. lex:ResxLocalizationProvider.DefaultDictionary="Lang"
  15. mc:Ignorable="d"
  16. d:DesignHeight="450"
  17. d:DesignWidth="600"
  18. d:Background="White"
  19. FontFamily="{DynamicResource DefaultFont}">
  20. <Viewbox Stretch="None">
  21. <Grid>
  22. <Grid.RowDefinitions>
  23. <RowDefinition Height="auto" />
  24. <RowDefinition Height="auto" />
  25. <RowDefinition Height="auto" />
  26. <RowDefinition Height="auto" />
  27. <RowDefinition Height="auto" />
  28. </Grid.RowDefinitions>
  29. <StackPanel Grid.Row="0"
  30. Margin="0,10"
  31. Orientation="Horizontal">
  32. <ComboBox x:Name="SequenceComboBox"
  33. MinWidth="60"
  34. Margin="5,5"
  35. HorizontalContentAlignment="Center"
  36. material:HintAssist.Hint="{lex:Loc 输出设定}"
  37. material:HintAssist.IsFloating="True"
  38. ItemsSource="{Binding SequenceCollection}"
  39. SelectedIndex="{Binding SelectedSequence}">
  40. <behavior:Interaction.Triggers>
  41. <behavior:EventTrigger EventName="SelectionChanged">
  42. <behavior:InvokeCommandAction Command="{Binding SelectSequenceCommand}" />
  43. </behavior:EventTrigger>
  44. </behavior:Interaction.Triggers>
  45. </ComboBox>
  46. </StackPanel>
  47. <StackPanel Grid.Row="1"
  48. HorizontalAlignment="Center">
  49. <UniformGrid Columns="2">
  50. <TextBlock VerticalAlignment="Center"
  51. Text="{lex:Loc 数字量输出,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}1: '}" />
  52. <mah:ToggleSwitch Margin="10,0,0,0"
  53. VerticalAlignment="Center"
  54. IsOn="{Binding CurrentUpperFeederParamDto.HopperDigitalOutput1}" />
  55. <TextBlock VerticalAlignment="Bottom"
  56. Text="{lex:Loc 模拟量输出,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}1: '}" />
  57. <local:myNumericUpDowm Margin="10,0,0,0"
  58. Minimum="0"
  59. Maximum="10"
  60. StringFormat="{}{0:N0} %"
  61. Value="{Binding CurrentUpperFeederParamDto.HopperAnalogOutput1, ValidatesOnDataErrors=True,Mode=TwoWay}" />
  62. <TextBlock VerticalAlignment="Center"
  63. Text="{lex:Loc 数字量输出,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}2: '}" />
  64. <mah:ToggleSwitch Margin="10,0,0,0"
  65. IsOn="{Binding CurrentUpperFeederParamDto.HopperDigitalOutput2}" />
  66. <TextBlock VerticalAlignment="Bottom"
  67. Text="{lex:Loc 模拟量输出,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}2: '}" />
  68. <local:myNumericUpDowm Margin="10,0,0,0"
  69. Minimum="0"
  70. Maximum="10"
  71. StringFormat="{}{0:N0} %"
  72. Value="{Binding CurrentUpperFeederParamDto.HopperAnalogOutput2, ValidatesOnDataErrors=True,Mode=TwoWay}" />
  73. <TextBlock VerticalAlignment="Bottom"
  74. Text="{lex:Loc 振动持续时间,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  75. <local:myNumericUpDowm Margin="10,0,0,0"
  76. Width="150"
  77. Height="20"
  78. Minimum="0"
  79. Interval="100"
  80. Maximum="60000"
  81. StringFormat="{}{0:N0} ms"
  82. Value="{Binding CurrentUpperFeederParamDto.HopperDuration, ValidatesOnDataErrors=True,Mode=TwoWay}" />
  83. </UniformGrid>
  84. <StackPanel Margin="0,10"
  85. FlowDirection="RightToLeft"
  86. Orientation="Horizontal">
  87. <Button Margin="4,10"
  88. HorizontalAlignment="Center"
  89. material:ButtonAssist.CornerRadius="5"
  90. Command="{Binding StopActionCommand}"
  91. Content="{lex:Loc 停止}" />
  92. <Button Margin="4,10"
  93. HorizontalAlignment="Center"
  94. material:ButtonAssist.CornerRadius="5"
  95. Command="{Binding ExecuteActionCommand}"
  96. Content="{lex:Loc 执行}"
  97. Cursor="Hand" />
  98. <Button Margin="4,10"
  99. HorizontalAlignment="Center"
  100. material:ButtonAssist.CornerRadius="5"
  101. Command="{Binding WriteParamCommand}"
  102. Content="{lex:Loc 下载参数}"
  103. Cursor="Hand" />
  104. </StackPanel>
  105. </StackPanel>
  106. <StackPanel Grid.Row="2">
  107. <TextBlock Margin="5"
  108. Text="{lex:Loc 输入设定}" />
  109. </StackPanel>
  110. <StackPanel Grid.Row="3"
  111. HorizontalAlignment="Center">
  112. <UniformGrid Columns="2">
  113. <TextBlock VerticalAlignment="Bottom"
  114. Text="{lex:Loc 输入1触发序列ID,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  115. <ComboBox Margin="10,0,0,0"
  116. material:HintAssist.Hint="{lex:Loc 输入1触发序列ID}"
  117. material:HintAssist.IsFloating="True"
  118. ItemsSource="{Binding SequenceItems}"
  119. SelectedIndex="{Binding InputTriggerId1, ValidatesOnDataErrors=True}">
  120. <behavior:Interaction.Triggers>
  121. <behavior:EventTrigger EventName="SelectionChanged">
  122. <behavior:InvokeCommandAction Command="{Binding SelectInputSequenceCommand1}" />
  123. </behavior:EventTrigger>
  124. </behavior:Interaction.Triggers>
  125. </ComboBox>
  126. <TextBlock VerticalAlignment="Bottom"
  127. Text="{lex:Loc 输入2触发序列ID,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  128. <ComboBox Margin="10,0,0,0"
  129. material:HintAssist.Hint="{lex:Loc 输入2触发序列ID}"
  130. material:HintAssist.IsFloating="True"
  131. ItemsSource="{Binding SequenceItems}"
  132. SelectedIndex="{Binding InputTriggerId2, ValidatesOnDataErrors=True}">
  133. <behavior:Interaction.Triggers>
  134. <behavior:EventTrigger EventName="SelectionChanged">
  135. <behavior:InvokeCommandAction Command="{Binding SelectInputSequenceCommand2}" />
  136. </behavior:EventTrigger>
  137. </behavior:Interaction.Triggers>
  138. </ComboBox>
  139. </UniformGrid>
  140. <StackPanel Grid.Row="4"
  141. Margin="0,10"
  142. FlowDirection="RightToLeft"
  143. Orientation="Horizontal">
  144. <Button Margin="4,10"
  145. HorizontalAlignment="Center"
  146. material:ButtonAssist.CornerRadius="5"
  147. Command="{Binding WriteInputCommand}"
  148. Content="{lex:Loc 下载参数}"
  149. Cursor="Hand" />
  150. </StackPanel>
  151. </StackPanel>
  152. </Grid>
  153. </Viewbox>
  154. </UserControl>