schangxiang@126.com
2025-11-04 ca398287db3f5ea01f03aac4a85edb13b28100a6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
<Window x:Class="XHandler.View.RunAgoTips"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
        xmlns:local="clr-namespace:XHandler.View"
        xmlns:str="clr-namespace:XHandler.Properties"
        xmlns:ctrls="clr-namespace:XHandler.Controls"
        mc:Ignorable="d" WindowStartupLocation = "CenterOwner"
        Width="auto" Height="600" WindowStyle="None" AllowsTransparency="True" ResizeMode="NoResize" Background="#00FFFFFF"
        Loaded="Window_Loaded" PreviewKeyDown="Window_PreviewKeyDown"
        xmlns:hc="https://handyorg.github.io/handycontrol">
 
    <Window.Resources>
        <Style x:Key="DataGridCellSytleRed" TargetType="Label">
            <Style.Triggers>
                <DataTrigger Binding="{Binding DeviceStatus}" Value="true">
                    <Setter Property="Foreground" Value="Black"/>
                    <Setter Property="Content" Value="在线"/>
                </DataTrigger>
                <DataTrigger Binding="{Binding DeviceStatus}" Value="false">
                    <Setter Property="Foreground" Value="Red"/>
                    <Setter Property="Content" Value="离线"/>
                </DataTrigger>
            </Style.Triggers>
        </Style>
 
        <Style x:Key="dataGridColumnHeaderStyleSelf" TargetType="DataGridColumnHeader">
            <Setter Property="SnapsToDevicePixels" Value="True" />
            <Setter Property="MinWidth" Value="0" />
            <Setter Property="MinHeight" Value="28" />
            <Setter Property="Foreground" Value="#323433" />
            <Setter Property="FontSize" Value="15" />
            <Setter Property="Cursor" Value="Hand" />
            <Setter Property="Height" Value="40"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="DataGridColumnHeader">
                        <Border x:Name="BackgroundBorder" BorderThickness="0,0,0,0" BorderBrush="LightGray" Width="Auto" Background="{DynamicResource lightGrayBrush}">
                            <Grid >
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*" />
                                </Grid.ColumnDefinitions>
                                <ContentPresenter  Margin="0,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                            </Grid>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
 
        <Style x:Key="dataGridRowStyleSelf" TargetType="DataGridRow">
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="BorderBrush" Value="Transparent"/>
            <Setter Property="Background" Value="White" />
            <Setter Property="Height" Value="40"/>
            <Setter Property="FontSize" Value="15" />
            <Setter Property="Foreground" Value="Black" />
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Background" Value="{DynamicResource lightBlueBrush}"/>
                    <Setter Property="Foreground" Value="Black"/>
                </Trigger>
            </Style.Triggers>
        </Style>
 
 
    </Window.Resources>
 
    <Grid Width="600" Height="auto">
        <Border Background="{DynamicResource blueBrush}" CornerRadius="10 10 10 10" BorderThickness="2" BorderBrush="{DynamicResource blueBrush}">
            <Grid Margin="1.5,0,1.5,1.5">
                <Grid.RowDefinitions>
                    <RowDefinition Height="40"/>
                    <RowDefinition Height="auto"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="600"/>
                </Grid.ColumnDefinitions>
 
                <Grid Grid.Row="0" MouseDown="Grid_MouseDown" >
                    <Border Grid.Row="0" Background="{DynamicResource blueBrush}" CornerRadius="10 10 0 0" BorderThickness="0">
                        <Grid>
                            <!--title-->
                            <TextBlock Text="实验提示" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="20 0" FontSize="20"
                                       Foreground="White" FontWeight="Bold"/>
                            <Button Content="×" x:Name="btnClose" HorizontalAlignment="Right" VerticalAlignment="Center" VerticalContentAlignment="Center" Margin="10 0" FontSize="28" Width="40" Height="40"
                                    FontWeight="Bold" Foreground="White" Style="{DynamicResource BlueButtonStyle}" Background="{DynamicResource blueBrush}" Visibility="Visible" Click="btnClose_Click"/>
                        </Grid>
                    </Border>
                </Grid>
 
                <Grid Grid.Row="1" Background="White" x:Name="gdSetContent1" Height="560">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="auto"/>
                        <RowDefinition Height="10"/>
                        <RowDefinition Height="auto"/>
                        <RowDefinition Height="10"/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="600"/>
                    </Grid.ColumnDefinitions>
 
                    <GroupBox Grid.Row="0" Grid.Column="0"  Height="auto" Header="清除Tip" Style="{StaticResource GroupBoxTab}" FontSize="16">
                        <Border Background="{DynamicResource RegionBrush}" CornerRadius="0">
                            <!--<Button x:Name="btnClearData" Content="{x:Static str:Resources.btnClearRunData}" HorizontalAlignment="Center" VerticalAlignment="Top" 
                                    FontSize="16" Width="480" Height="40" Foreground="Blue" Background="#00FFFFFF" BorderThickness="0"
                                    Click="btnClearData_Click"/>-->
 
 
                            <Grid Grid.Row="1" Background="White" >
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="50"/>
                                    <RowDefinition Height="50"/>
                                    <RowDefinition Height="50"/>
                                </Grid.RowDefinitions>
 
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="200"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
 
                                <!--枪头类型-->
                                <TextBlock Grid.Row="0" Grid.Column="0" Text="{x:Static str:Resources.strTipsType1}" Foreground="Gray" VerticalAlignment="Center"
                                           TextWrapping="Wrap" HorizontalAlignment="Right" Margin="0 0 0 0" FontSize="16" />
                                <ComboBox x:Name="comboboxLabwareType" Grid.Row="0" Grid.Column="1" Height="30" Width="300" BorderThickness="0" 
                                          Background="{DynamicResource lightGrayBrush}" DisplayMemberPath="labware_name" SelectedValuePath="labware_id" 
                                          SelectionChanged="comboboxLabwareType_SelectionChanged" IsEditable="False"/>
 
                                <!--已使用数量-->
                                <TextBlock Grid.Row="1" Grid.Column="0" Text="{x:Static str:Resources.strRunTipsCountInfo}" Foreground="Gray" VerticalAlignment="Center"
                                           TextWrapping="Wrap" HorizontalAlignment="Right" Margin="0 0 0 0" FontSize="16" />
                                <TextBlock Grid.Row="1" Grid.Column="1" x:Name="tbkUsedCount" Text="" Foreground="Black" VerticalAlignment="Center" TextWrapping="Wrap" 
                                           HorizontalAlignment="Center" Margin="0 0 0 0" FontSize="16" />
                                
                                <!--当前类型重置-->
                                <Button x:Name="btnResetCurrentTipType" Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" 
                                        VerticalAlignment="Top" Margin="100 0 0 0" FontSize="16" Width="250" Height="40" Foreground="Blue" HorizontalAlignment="Left"
                                        Background="#00FFFFFF" BorderThickness="0" Click="btnResetCurrentTipType_Click" >
                                    <Button.Content>
                                        <StackPanel Orientation="Horizontal">
                                            <Image Stretch="Fill" Source="../Assets/refresh.png" Width="18" Height="18" HorizontalAlignment="Right" Margin="0,0,5,0"/>
                                            <TextBlock Text="{x:Static str:Resources.strResetCurrentTipType}" />
                                        </StackPanel>
                                    </Button.Content>
                                </Button>
 
                                <!--全部重置-->
                                <Button x:Name="btnResetAllTipType" Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2" VerticalAlignment="Top" Margin="130 0 0 0" 
                                        FontSize="16" Width="150" Height="40" Foreground="Blue" HorizontalAlignment="Left"
                                        Background="#00FFFFFF" BorderThickness="0" Click="btnResetAllTipType_Click">
                                    <Button.Content>
                                        <StackPanel Orientation="Horizontal">
                                            <Image Stretch="Fill" Source="../Assets/refresh.png" Width="18" Height="18" HorizontalAlignment="Right" Margin="0,0,5,0"/>
                                            <TextBlock Text="{x:Static str:Resources.strResetAllTipType}" />
                                        </StackPanel>
                                    </Button.Content>
                                </Button>
 
                            </Grid>
                        </Border>
                    </GroupBox>
 
                    <GroupBox Grid.Row="2" Grid.Column="0"  Height="380" Header="设备状态" Style="{StaticResource GroupBoxTab}" FontSize="16">
                        <Border Background="{DynamicResource RegionBrush}" CornerRadius="4">
 
                            <DataGrid x:Name="dgDeviceData" AutoGenerateColumns="False" VerticalAlignment="Top" HorizontalAlignment="Left" 
                                      HorizontalContentAlignment="Center" BorderThickness="1 0 0 0" Background="White"
                                      CanUserSortColumns="False" Margin="5 5" CanUserResizeColumns="False" CanUserResizeRows="False" 
                                      CanUserReorderColumns="False" RowHeaderWidth="0" CanUserAddRows="False" 
                                      ScrollViewer.VerticalScrollBarVisibility="Auto" Height="370" ColumnHeaderStyle="{DynamicResource dataGridColumnHeaderStyleSelf}"
                                      RowStyle="{StaticResource dataGridRowStyleSelf}" CellStyle="{StaticResource dataGridCellStyleDoubleClick}">
                                <DataGrid.Columns>
                                    <!--<DataGridTextColumn Width="150" Header="设备名称">
                                        <DataGridTemplateColumn.CellTemplate>
                                            <DataTemplate>
                                                <Label Content="{Binding DeviceName}" Foreground="Black" BorderThickness="0" HorizontalContentAlignment="Center" HorizontalAlignment="Left"/>
                                            </DataTemplate>
                                        </DataGridTemplateColumn.CellTemplate>
                                    </DataGridTextColumn>-->
                                    <DataGridTextColumn Width="150" IsReadOnly="True" Binding="{Binding DeviceName}" Header="设备名称"/>
 
                                    <!--<DataGridTemplateColumn Width="160" Header="设备ID" >
                                        <DataGridTemplateColumn.CellTemplate>
                                            <DataTemplate>
                                                <Label Content="{Binding DeviceId}" Foreground="Black" BorderThickness="0" HorizontalContentAlignment="Center" HorizontalAlignment="Left"/>
                                            </DataTemplate>
                                        </DataGridTemplateColumn.CellTemplate>
                                    </DataGridTemplateColumn>-->
                                    <DataGridTextColumn Width="160" IsReadOnly="True" Binding="{Binding DeviceId}" Header="设备ID"/>
                                    
                                    <!--<DataGridTemplateColumn Width="160" Header="虚拟连接" >
                                        <DataGridTemplateColumn.CellTemplate>
                                            <DataTemplate>
                                                <Label Content="{Binding VirtualConnectionState}" Foreground="Black" BorderThickness="0" HorizontalContentAlignment="Center" HorizontalAlignment="Left"/>
                                            </DataTemplate>
                                        </DataGridTemplateColumn.CellTemplate>
                                    </DataGridTemplateColumn>-->
                                    <DataGridTextColumn Width="160" IsReadOnly="True" Binding="{Binding VirtualConnectionState}" Header="虚拟连接"/>
 
                                    <DataGridTemplateColumn Width="*" Header="状态" >
                                        <DataGridTemplateColumn.CellTemplate>
                                            <DataTemplate>
                                                <Label BorderThickness="0" Style="{DynamicResource DataGridCellSytleRed}"/>
                                            </DataTemplate>
                                        </DataGridTemplateColumn.CellTemplate>
                                    </DataGridTemplateColumn>
                                    <!--<DataGridTextColumn Width="*" IsReadOnly="True" Binding="{Binding DeviceStatus}" Header="状态" CellStyle="{DynamicResource DataGridCellSytleRed}"/>-->
 
                                </DataGrid.Columns>
                            </DataGrid>
                        </Border>
                    </GroupBox>
 
                    <Rectangle Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="6" Height="1" Fill="Gray" VerticalAlignment="Bottom" Margin="15 0"/>
                </Grid>
 
                <Button Grid.Row="1" x:Name="btnCancel" Content="取消" Width="80" Height="40" VerticalContentAlignment="Center"
                    HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" Style="{DynamicResource BlueButtonStyle}" 
                    Background="{DynamicResource blueBrush}" Click="btnClose_Click" Margin="200,500,0,0"/>
 
                <Button Grid.Row="1" x:Name="btnOk" Content="确定" Width="80" Height="40" VerticalContentAlignment="Center"
                    HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" Style="{DynamicResource BlueButtonStyle}" 
                    Background="{DynamicResource blueBrush}" Click="btnOk_Click" Margin="400,500,0,0"/>
            </Grid>
        </Border>
    </Grid>
</Window>