Explorar o código

feat(d2-02-t3): 砍front-manament对焦预览窗(评分高亮失依据)——去DetailView入口+删AutoFocusWindow+清理getAutofocusPictures死链;切焦平面不动

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
huangjie hai 2 días
pai
achega
6e9d6b857e

+ 0 - 35
aivfo-front-manament-2.0/ivf_tl_Entity/Entity/Result/AutoFocusPictureEntity.cs

@@ -1,35 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace ivf_tl_Entity.Entity.Result
-{
-    public class AutoFocusPictureEntity
-    {
-        public bool highestScore { get; set; }
-        public int houseSn { get; set; }
-
-        public long id { get; set; }
-        public int imageHeight { get; set; }
-        public string imageName { get; set; }
-        public double imageScore { get; set; }
-        public string imageTime { get; set; }
-        public string imageUrl { get; set; }
-        public int imageWidth { get; set; }
-        public int pictureLayer { get; set; }
-        public int shootingPosition { get; set; }
-        public string sourceImageUrl { get; set; }
-        public int totalLayer { get; set; }
-        public int wellSn { get; set; }
-    }
-
-    public class AutoFocusResult
-    {
-        public string autofocusTime { get; set; }
-        public bool end { get; set; }
-
-        public List<AutoFocusPictureEntity> focusPreviewPictureVOList { get; set; } = new List<AutoFocusPictureEntity>();
-    }
-}

+ 1 - 1
aivfo-front-manament-2.0/ivf_tl_Manage/Views/DetailView.xaml

@@ -259,7 +259,7 @@
             <customControl:ButtonBottomImage  Canvas.Left="1702" Canvas.Top="93" IconWidth="80" IconHeight="82" IconMargin="0 -8 0 0" Click="Export_Click"  FontWeight="Medium" FontSize="24" Foreground="#707070"  MouseOverForeground="#4D4D4D" IconSource="pack://application:,,,/ivf_tl_Manage;component/Resources/Images/DetailExportIcon.png" MouseOverIconSource="pack://application:,,,/ivf_tl_Manage;component/Resources/Images/DetailExportMouseIcon.png" Content="{DynamicResource 0062}" Width="96"/>
             <customControl:ButtonBottomImage TextWrapp="Wrap" Margin="0 12 0 0" Canvas.Left="1702" Canvas.Top="214" IconWidth="80" IconHeight="82" IconMargin="0 -8 0 0" Click="EmbryoPicClick" Content="{DynamicResource 0161}" FontWeight="Medium" FontSize="24" Foreground="#707070"  MouseOverForeground="#4D4D4D" IconSource="pack://application:,,,/ivf_tl_Manage;component/Resources/Images/DetailSeePicIcon.png"  MouseOverIconSource="pack://application:,,,/ivf_tl_Manage;component/Resources/Images/DetailSeePicMouseIcon.png" Width="96"/>
             <customControl:ButtonBottomImage TextWrapp="Wrap" Margin="0 12 0 0" Canvas.Left="1702" Canvas.Top="335" IconWidth="80" IconHeight="82" IconMargin="0 -8 0 0" Click="ButtonBottomImage_Click" Content="{DynamicResource 0162}" FontWeight="Medium" FontSize="24" Foreground="#707070"  MouseOverForeground="#4D4D4D" IconSource="pack://application:,,,/ivf_tl_Manage;component/Resources/Images/DetatilMarkDetailIcon.png" MouseOverIconSource="pack://application:,,,/ivf_tl_Manage;component/Resources/Images/DetatilMarkDetailMouseIcon.png" Width="96"/>
-            <customControl:ButtonBottomImage TextWrapp="Wrap" Margin="0 12 0 0" Canvas.Left="1702" Canvas.Top="456" IconWidth="80" IconHeight="82" IconMargin="0 -8 0 0" Click="Auto_Click" Content="{DynamicResource 0250}" FontWeight="Medium" FontSize="24" Foreground="#707070"  MouseOverForeground="#4D4D4D" IconSource="pack://application:,,,/ivf_tl_Manage;component/Resources/Images/AutoFocusButtonIcon.png" MouseOverIconSource="pack://application:,,,/ivf_tl_Manage;component/Resources/Images/AutoFocusMouseOverButtonIcon.png" Width="96"/>
+            <!-- 对焦预览按钮已砍(评分高亮失依据,服务器不再做清晰度评分) -->
         </StackPanel>
         <!--<customControl:ButtonBottomImage  Canvas.Left="1702" Canvas.Top="93" IconWidth="80" IconHeight="82" IconMargin="0 -8 0 0" Click="Export_Click"  FontWeight="Medium" FontSize="24" Foreground="#707070"  MouseOverForeground="#4D4D4D" IconSource="pack://application:,,,/ivf_tl_Manage;component/Resources/Images/DetailExportIcon.png" MouseOverIconSource="pack://application:,,,/ivf_tl_Manage;component/Resources/Images/DetailExportMouseIcon.png" Content="{DynamicResource 0062}" Width="96"/>
         <customControl:ButtonBottomImage   Canvas.Left="1702" Canvas.Top="214" IconWidth="80" IconHeight="82" IconMargin="0 -8 0 0" Click="EmbryoPicClick" Content="{DynamicResource 0161}" FontWeight="Medium" FontSize="24" Foreground="#707070"  MouseOverForeground="#4D4D4D" IconSource="pack://application:,,,/ivf_tl_Manage;component/Resources/Images/DetailSeePicIcon.png"  MouseOverIconSource="pack://application:,,,/ivf_tl_Manage;component/Resources/Images/DetailSeePicMouseIcon.png" Width="96"/>

+ 0 - 17
aivfo-front-manament-2.0/ivf_tl_Manage/Views/DetailView.xaml.cs

@@ -1458,23 +1458,6 @@ namespace ivf_tl_Manage.Views
             e.Handled = true;
         }
 
-        private void Auto_Click(object sender, RoutedEventArgs e)
-        {
-            if (vm == null) return;
-            var list = vm.CurrentDish.embryoList.Where(x => x.state == (int)EmbryoState.None).ToList();
-            //var list = vm.CurrentDish.embryoList.ToList();
-            if (!list.Any())
-            {
-                //new ToastMessageWindow(AppData.Instance.MainWindow, $"暂无胚胎需要对焦预览").Show();
-                new ToastMessageWindow(AppData.Instance.MainWindow, KeyToStringConvert.GetLanguageStringByKey("0320")).Show();
-                return;
-            }
-            AppData.Instance.MainWindowViewModel.MaskVisibility = true;
-            new AutoFocusWindow(vm.CurrentDish.tlSn, vm.CurrentDish.houseSn, list, vm.CurrentEmbryo).ShowDialog();
-            AppData.Instance.MainWindowViewModel.MaskVisibility = false;
-            return;
-        }
-
         private void AverageValue_Click(object sender, RoutedEventArgs e)
         {
             int allValue = 0;

+ 0 - 109
aivfo-front-manament-2.0/ivf_tl_Manage/Win/AutoFocusWindow.xaml

@@ -1,109 +0,0 @@
-<Window x:Class="ivf_tl_Manage.Win.AutoFocusWindow"
-        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
-        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
-        xmlns:local="clr-namespace:ivf_tl_Manage.Win"
-        xmlns:customControl="clr-namespace:ivf_tl_CustomControls;assembly=ivf_tl_CustomControls_PC"
-        mc:Ignorable="d"
-        FontFamily="{StaticResource sourceHan}"
-        WindowStyle="None"    AllowsTransparency="True"
-        ShowInTaskbar="False"
-        WindowStartupLocation="CenterOwner"
-        Background="Transparent"
-        Width="1650" Height="967">
-    <Canvas x:Name="Canvas_BigRoot" Width="1650" Height="967">
-        <Canvas Width="1650" Height="164" >
-            <Canvas.Background>
-                <ImageBrush ImageSource="pack://application:,,,/ivf_tl_Manage;component/Resources/Images/AutoFocusWindowTopBack.png"/>
-            </Canvas.Background>
-            <DockPanel Canvas.Left="60" Canvas.Top="60">
-                <TextBlock Margin="2 0 2 3" DockPanel.Dock="Top" Canvas.Left="60" Canvas.Top="60" Text="{DynamicResource 0250}" FontWeight="Medium" FontSize="24"/>
-                <Rectangle DockPanel.Dock="Bottom" Canvas.Left="58" Canvas.Top="95"  Height="3" Fill="#4D75AC" RadiusX="1.5" RadiusY="1.5"/>
-            </DockPanel>
-            <StackPanel  Canvas.Left="200" Canvas.Top="60" Orientation="Horizontal">
-                <customControl:RadioButtonHaveFrame Canvas.Left="200" Canvas.Top="60" FontWeight="Medium" FontSize="26" Foreground="#9B9B9B" Content="{DynamicResource 0546}" IsChecked="True"
-  CheckImageSource="pack://application:,,,/ivf_tl_Manage;component/Resources/Images/CheckRadioButtonIcon.png" Checked="KouTu_Checked"/>
-                <customControl:RadioButtonHaveFrame Margin="20 0 0 0" x:Name="_yuantu" Canvas.Left="310" Canvas.Top="60" FontWeight="Medium" FontSize="26" Foreground="#9B9B9B" Content="{DynamicResource 0547}" Checked="YuanTu_Checked"
- CheckImageSource="pack://application:,,,/ivf_tl_Manage;component/Resources/Images/CheckRadioButtonIcon.png"/>
-            </StackPanel>
-            <!--<TextBlock Canvas.Left="60" Canvas.Top="60" Text="{DynamicResource 0250}" FontWeight="Medium" FontSize="24"/>
-            <Rectangle Canvas.Left="58" Canvas.Top="95" Width="100" Height="3" Fill="#4D75AC" RadiusX="1.5" RadiusY="1.5"/>-->
-            <customControl:ButtonImage Canvas.Left="1574" Canvas.Top="60" Width="18" Height="18" Click="Cancel_Click" IconSource="pack://application:,,,/ivf_tl_Manage;component/Resources/Images/CloseGrayIcon.png" MouseOverIconSource="pack://application:,,,/ivf_tl_Manage;component/Resources/Images/CloseBlueIcon.png"/>
-            <StackPanel Orientation="Horizontal" Canvas.Left="60" Canvas.Top="120">
-                <TextBlock VerticalAlignment="Center" Canvas.Left="60" Canvas.Top="120" Text="{DynamicResource 0243}" FontWeight="Medium" FontSize="16" Foreground="#707070"/>
-                <ListBox Margin="10 0 0 0" Canvas.Left="130" Canvas.Top="115" VerticalAlignment="Center" x:Name="ListBox_Well"  Style="{StaticResource ListBoxStyleAutoPic}" DisplayMemberPath="wellSn" SelectionChanged="ListBox_Selected" BorderThickness="0" Padding="0" Height="34" Background="Transparent">
-                    <ListBox.ItemsPanel>
-                        <ItemsPanelTemplate>
-                            <StackPanel Orientation="Horizontal"/>
-                        </ItemsPanelTemplate>
-                    </ListBox.ItemsPanel>
-                </ListBox>
-            </StackPanel>
-            <!--<TextBlock Canvas.Left="60" Canvas.Top="120" Text="{DynamicResource 0243}" FontWeight="Medium" FontSize="16" Foreground="#707070"/>-->
-            <StackPanel Canvas.Left="1300" Canvas.Top="120" Width="350" Orientation="Horizontal" FlowDirection="RightToLeft">
-                <TextBlock Visibility="Hidden" Margin="70 0 5 0" x:Name="TextBlock_AutoTime"  Canvas.Left="1455" Canvas.Top="120" FlowDirection="LeftToRight" Text="" FontWeight="Medium" FontSize="16" Foreground="#4D4D4D"/>
-                <TextBlock Visibility="Hidden" x:Name="TextBlock_Title" Canvas.Left="1376" Canvas.Top="120" FontWeight="Medium" FontSize="16" Foreground="#707070">
-                    <Run Text=":"/><Run Text="{DynamicResource 0256}"/>
-                </TextBlock>
-            </StackPanel>
-        </Canvas>
-
-        <Canvas Canvas.Top="164" Width="1650" Height="679" >
-            <Canvas.Background>
-                <ImageBrush ImageSource="pack://application:,,,/ivf_tl_Manage;component/Resources/Images/AutoFocusWindowCenterBack.png"/>
-            </Canvas.Background>
-            <ScrollViewer Canvas.Left="60" Width="1550" Height="679" x:Name="_ScrollViewer" FocusVisualStyle="{x:Null}"  PanningMode="Both"  HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" ManipulationBoundaryFeedback="ScrollViewer_ManipulationBoundaryFeedback">
-                <WrapPanel x:Name="_root_Canvas" Width="1650"/>
-            </ScrollViewer>
-            <Canvas x:Name="Canvas_Big" Visibility="Collapsed" Canvas.Left="60" Width="1530" Height="679" Background="Black">
-                <TextBlock x:Name="Text_Big" Canvas.Left="30" Canvas.Top="20" FontWeight="Medium" Foreground="White" FontSize="18"/>
-                <Image x:Name="Image_Big" Canvas.Left="427" Width="679" Height="679"/>
-                <customControl:ButtonImage Canvas.Left="1482" Canvas.Top="20" Width="34" Height="34" Click="Close_Click" IconSource="pack://application:,,,/ivf_tl_Manage;component/Resources/Images/BigPicCloseIcon.png" MouseOverIconSource="pack://application:,,,/ivf_tl_Manage;component/Resources/Images/BigPicCloseMouseOverIcon.png"/>
-                <customControl:ButtonImageWH x:Name="_prePic_Button" Canvas.Left="0" Canvas.Top="88" Width="150" Height="591" IconWidth="34" IconHeight="88" Click="PreButton_Click"
-                                         IconSource="pack://application:,,,/ivf_tl_Manage;component/Resources/Images/AutoPrePicIcon.png" MouseOverIconSource="pack://application:,,,/ivf_tl_Manage;component/Resources/Images/AutoPrePicMouseOverIcon.png" Background="Transparent"/>
-                <customControl:ButtonImageWH x:Name="_nextPic_Button" Canvas.Left="1380" Canvas.Top="88" Width="150" Height="591" IconWidth="34" IconHeight="88" Click="NextButton_Click"
-                                         IconSource="pack://application:,,,/ivf_tl_Manage;component/Resources/Images/AutoNextPicIcon.png" MouseOverIconSource="pack://application:,,,/ivf_tl_Manage;component/Resources/Images/AutoNextMouseOverPicIcon.png" Background="Transparent"/>
-            </Canvas>
-        </Canvas>
-
-        <StackPanel Canvas.Top="843" Width="1650" Height="124" FlowDirection="RightToLeft" Orientation="Horizontal">
-            <StackPanel.Background>
-                <ImageBrush ImageSource="pack://application:,,,/ivf_tl_Manage;component/Resources/Images/AutoFocusWindowBottomBack.png"/>
-            </StackPanel.Background>
-            <customControl:ButtonCornerRadius Margin="60 0 0 0" Canvas.Left="1486" Canvas.Top="30" Width="104" Height="34" Content="{DynamicResource 0260}" FontSize="12" Click="Button1_Click"/>
-            <customControl:ButtonCornerRadius Margin="20 0 0 0" Canvas.Left="1362" Canvas.Top="30" Width="104" Height="34" Content="{DynamicResource 0259}" FontSize="12" Click="Button_Click"/>
-            <Grid VerticalAlignment="Center" Margin="20 0 0 0">
-                <customControl:TextBoxCustom x:Name="TextBlock_focusStartingPoint" Text=""  Canvas.Left="1147" Canvas.Top="30" Width="195" Height="34" TextMargin="20 0 20 0" Foreground="#4D4D4D" DefeatMargin="21 0 20 0" FontSize="16" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Background="Transparent"  PreviewTextInput="TextBox_PreviewTextInput" InputMethod.IsInputMethodEnabled="False"/>
-                <customControl:ButtonCornerRadius HorizontalAlignment="Right" x:Name="Button_Sub" CornerRadius="5" Canvas.Left="1147" Canvas.Top="30" Width="55" Height="34" Content="5-" FontSize="16" Click="Sub_Click"/>
-                <customControl:ButtonCornerRadius HorizontalAlignment="Left" x:Name="Button_Add" CornerRadius="5" Canvas.Left="1287" Canvas.Top="30" Width="55" Height="34" Content="5+" FontSize="16" Click="Aad_Click"/>
-            </Grid>
-            <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" Canvas.Left="1036" Canvas.Top="37" FontWeight="Medium" FontSize="16" Foreground="#707070">
-                <Run Text=":"/><Run Text="{DynamicResource 0258}"/>
-            </TextBlock>
-            <TextBlock Margin="10 0 0 0"  FlowDirection="LeftToRight" Width="65" VerticalAlignment="Center" Canvas.Left="961"  Canvas.Top="37" x:Name="TextBlock_verticalMotorPosition" FontWeight="Medium" FontSize="16" Foreground="#4D4D4D"/>
-            <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" Canvas.Left="882" Canvas.Top="37"  FontWeight="Medium" FontSize="16" Foreground="#707070">
-                <Run Text=":"/><Run Text="{DynamicResource 0257}"/>
-            </TextBlock>
-        </StackPanel>
-
-        <!--<Canvas Canvas.Top="943" Width="1650" Height="124" >
-            <Canvas.Background>
-                <ImageBrush ImageSource="pack://application:,,,/ivf_tl_Manage;component/Resources/Images/AutoFocusWindowBottomBack.png"/>
-            </Canvas.Background>
-            <TextBlock Canvas.Left="882" Canvas.Top="37"  FontWeight="Medium" FontSize="16" Foreground="#707070">
-                <Run Text="{DynamicResource 0257}"/><Run Text=":"/>
-            </TextBlock>
-            <TextBlock Canvas.Left="961" Canvas.Top="37" x:Name="TextBlock_verticalMotorPosition" FontWeight="Medium" FontSize="16" Foreground="#4D4D4D" Text="1234567"/>
-            <TextBlock Canvas.Left="1036" Canvas.Top="37" FontWeight="Medium" FontSize="16" Foreground="#707070">
-                <Run Text="{DynamicResource 0258}"/><Run Text=":"/>
-            </TextBlock>
-            <customControl:TextBoxCustom x:Name="TextBlock_focusStartingPoint" Text=""  Canvas.Left="1147" Canvas.Top="30" Width="195" Height="34" TextMargin="20 0 20 0" Foreground="#4D4D4D" DefeatMargin="21 0 20 0" FontSize="16" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Background="Transparent"  PreviewTextInput="TextBox_PreviewTextInput" InputMethod.IsInputMethodEnabled="False"/>
-            <customControl:ButtonCornerRadius x:Name="Button_Sub" CornerRadius="5" Canvas.Left="1147" Canvas.Top="30" Width="55" Height="34" Content="-5" FontSize="16" Click="Sub_Click"/>
-            <customControl:ButtonCornerRadius x:Name="Button_Add" CornerRadius="5" Canvas.Left="1287" Canvas.Top="30" Width="55" Height="34" Content="+5" FontSize="16" Click="Aad_Click"/>
-            <customControl:ButtonCornerRadius Canvas.Left="1362" Canvas.Top="30" Width="104" Height="34" Content="{DynamicResource 0259}" FontSize="16" Click="Button_Click"/>
-            <customControl:ButtonCornerRadius Canvas.Left="1486" Canvas.Top="30" Width="104" Height="34" Content="{DynamicResource 0260}" FontSize="16" Click="Button1_Click"/>
-        </Canvas>-->
-
-    </Canvas>
-</Window>

+ 0 - 458
aivfo-front-manament-2.0/ivf_tl_Manage/Win/AutoFocusWindow.xaml.cs

@@ -1,458 +0,0 @@
-using ivf_tl_Entity.Entity.balance;
-using ivf_tl_Entity.Entity.Result;
-using ivf_tl_Entity.Enums;
-using ivf_tl_Entity.Response;
-using ivf_tl_Manage.Converts;
-using ivf_tl_Manage.UserControls;
-using ivf_tl_Service.HttpProvider;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Text.RegularExpressions;
-using System.Threading.Tasks;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Shapes;
-
-namespace ivf_tl_Manage.Win
-{
-    /// <summary>
-    /// AutoFocusWindow.xaml 的交互逻辑
-    /// </summary>
-    public partial class AutoFocusWindow : Window
-    {
-        PicProvider picProvider;
-        string tlSn;
-        int houseSn;
-        public AutoFocusWindow(string tlSn, int houseSn, List<Embryo> EmbryoList, Embryo currentEmbryo)
-        {
-            InitializeComponent();
-            this.Owner = AppData.Instance.MainWindow;
-            picProvider = AppData.Instance.GetPicProvider();
-            this.tlSn = tlSn;
-            this.houseSn = houseSn;
-            int currentWellSn = EmbryoList.First().wellSn;
-            if (currentEmbryo != null && currentEmbryo.state == (int)EmbryoState.None) currentWellSn = currentEmbryo.wellSn;
-            Loaded += (s, e) =>
-            {
-                List<PositionEntity> ItemSourceData = new List<PositionEntity>();
-                var dataList = picProvider.GetPositionApi(tlSn, houseSn, EmbryoList.Select(x => x.wellSn).ToList());
-                foreach (var item in dataList)
-                {
-                    item.focusStartingPoint = item.verticalMotorPosition;
-                    var item11 = EmbryoList.FirstOrDefault(x => x.wellSn == item.wellSn);
-                    if (item11 != null)
-                    {
-                        item.EmbryoId = item11.id;
-                        ItemSourceData.Add(item);
-                    }
-                }
-                var currentPost = ItemSourceData.FirstOrDefault(x => x.wellSn == currentWellSn);
-                this.ListBox_Well.ItemsSource = ItemSourceData;
-                if (currentPost == null) this.ListBox_Well.SelectedIndex = 0;
-                else this.ListBox_Well.SelectedItem = currentPost;
-            };
-            Unloaded += (s, e) =>
-            {
-                this.Canvas_BigRoot.Children.Clear();
-                AppData.Instance.MainWindow.Activate();
-            };
-        }
-
-        private void Button_Click(object sender, RoutedEventArgs e)
-        {
-            if (this.ListBox_Well.SelectedItem == null) return;
-            if (!(this.ListBox_Well.SelectedItem is PositionEntity positionEntity)) return;
-            string ss = this.TextBlock_focusStartingPoint.Text.Trim();
-            if (string.IsNullOrEmpty(ss))
-            {
-                //new ToastMessageWindow(AppData.Instance.MainWindow, $"请输入新位置").Show();
-                new ToastMessageWindow(AppData.Instance.MainWindow, KeyToStringConvert.GetLanguageStringByKey("0310")).Show();
-                return;
-            }
-            if (!int.TryParse(ss, out int newValue))
-            {
-                new ToastMessageWindow(AppData.Instance.MainWindow, $"新位置只能是数字").Show();
-                return;
-            }
-            positionEntity.IsUpdate = true;
-            positionEntity.focusStartingPoint = newValue;
-            //new ToastMessageWindow(AppData.Instance.MainWindow, $"缓存成功!").Show();
-            new ToastMessageWindow(AppData.Instance.MainWindow, $"{KeyToStringConvert.GetLanguageStringByKey("0311")}!").Show();
-        }
-
-        Dictionary<int, PicSourceUserControl> ListPic = new Dictionary<int, PicSourceUserControl>();
-
-        private void ListBox_Selected(object sender, SelectionChangedEventArgs e)
-        {
-            if (!(sender is ListBox source)) return;
-            if (source.SelectedItem == null) return;
-            if (!(source.SelectedItem is PositionEntity positionEntity)) return;
-            this.TextBlock_verticalMotorPosition.Text = positionEntity.verticalMotorPosition.ToString();
-            this.TextBlock_focusStartingPoint.Text = positionEntity.focusStartingPoint.ToString();
-            int CheckBoxImageNum = 1;
-            int ImageIndex = 1;
-            this.Canvas_Big.Visibility = Visibility.Collapsed;
-            Task.Run(() =>
-            {
-                var a = picProvider.GetAutofocusPicturesApi(tlSn, houseSn, positionEntity.EmbryoId);
-                Dispatcher.Invoke(() =>
-                {
-                    if (string.IsNullOrEmpty(a.autofocusTime))
-                    {
-                        this.TextBlock_Title.Visibility = Visibility.Hidden;
-                        this.TextBlock_AutoTime.Visibility = Visibility.Hidden;
-                    }
-                    else
-                    {
-                        this.TextBlock_Title.Visibility = Visibility.Visible;
-                        this.TextBlock_AutoTime.Visibility = Visibility.Visible;
-                    }
-                    this.TextBlock_AutoTime.Text = a.autofocusTime;
-                    _root_Canvas.Children.Clear();
-                    ListPic.Clear();
-                    if (!a.focusPreviewPictureVOList.Any()) return;
-                    string imageurlString = null;
-                    BitmapImage BitmapImageSource = null;
-
-                    //for (int i = (a.focusPreviewPictureVOList.Count - 1); i >= 12; i--)
-                    //{
-                    //    var item = a.focusPreviewPictureVOList[i];
-                    //    item.imageUrl = item.sourceImageUrl;
-                    //}
-
-                    for (int i = 0; i < a.focusPreviewPictureVOList.Count; i++)
-                    {
-                        var item = a.focusPreviewPictureVOList[i];
-                        imageurlString = item.imageUrl;
-                        if (this._yuantu.IsChecked == true)
-                        {
-                            imageurlString = item.sourceImageUrl;
-                        }
-                        if (string.IsNullOrEmpty(imageurlString))
-                        {
-                            BitmapImageSource = null;
-                        }
-                        else
-                        {
-                            BitmapImageSource = AppData.Instance.StringToBitmapImage($"{AppData.Instance.BaseUrl}{imageurlString.Replace(AppData.Instance.PicSuf, $"_180x180{AppData.Instance.PicSuf}")}?token={AppData.Instance.HttpServiceCall.GetToken()}");
-                        }
-                        PicSourceUserControl checkBoxImage = new PicSourceUserControl()
-                        {
-                            ImageSourceUrl = BitmapImageSource,
-                            ImageInfoString = $"{item.houseSn}-{item.wellSn}-{item.shootingPosition}.jpg",
-                            ImageUrl = imageurlString,
-                        };
-                        if (item.highestScore)
-                        {
-                            checkBoxImage.templateRoot.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#666DA5FF"));
-                        }
-
-                        if (CheckBoxImageNum > 7)
-                        {
-                            if ((CheckBoxImageNum - 1) % 7 == 0) checkBoxImage.Margin = new Thickness(0, 10, 0, 0);
-                            else checkBoxImage.Margin = new Thickness(10, 10, 0, 0);
-                        }
-                        else
-                        {
-                            if (CheckBoxImageNum == 1) checkBoxImage.Margin = new Thickness(0);
-                            else checkBoxImage.Margin = new Thickness(10, 0, 0, 0);
-                        }
-
-                        var k = ImageIndex;
-                        checkBoxImage.Tag = item;
-                        checkBoxImage.MouseDown += (s, e) =>
-                        {
-                            this.Text_Big.Text = checkBoxImage.ImageInfoString;
-                            this.Image_Big.Source = AppData.Instance.StringToBitmapImage($"{AppData.Instance.BaseUrl}{checkBoxImage.ImageUrl}?token={AppData.Instance.HttpServiceCall.GetToken()}");
-                            this.Canvas_Big.Visibility = Visibility.Visible;
-                            this.Image_Big.Tag = k;
-
-                            if (k < ListPic.Last().Key)
-                            {
-                                this._nextPic_Button.Visibility = Visibility.Visible;
-                            }
-                            else
-                            {
-                                this._nextPic_Button.Visibility = Visibility.Hidden;
-                            }
-                            if (k > 1)
-                            {
-                                this._prePic_Button.Visibility = Visibility.Visible;
-                            }
-                            else
-                            {
-                                this._prePic_Button.Visibility = Visibility.Hidden;
-                            }
-                        };
-                        CheckBoxImageNum++;
-                        ListPic.Add(k, checkBoxImage);
-                        ImageIndex++;
-                        _root_Canvas.Children.Add(checkBoxImage);
-                    }
-                });
-            });
-        }
-
-        private void Button1_Click(object sender, RoutedEventArgs e)
-        {
-            if (!this.ListBox_Well.HasItems) return;
-            if (this.ListBox_Well.SelectedItem == null) return;
-            if (!(this.ListBox_Well.SelectedItem is PositionEntity CurrentPositionEntity)) return;
-            string ss = this.TextBlock_focusStartingPoint.Text.Trim();
-            if (string.IsNullOrEmpty(ss))
-            {
-                //new ToastMessageWindow(AppData.Instance.MainWindow, $"请输入新位置").Show();
-                new ToastMessageWindow(AppData.Instance.MainWindow, KeyToStringConvert.GetLanguageStringByKey("0310")).Show();
-                return;
-            }
-            if (!int.TryParse(ss, out int newValue))
-            {
-                new ToastMessageWindow(AppData.Instance.MainWindow, $"新位置只能是数字").Show();
-                return;
-            }
-            CurrentPositionEntity.IsUpdate = true;
-            CurrentPositionEntity.focusStartingPoint = newValue;
-            List<FocusStartingPointResponse> listData = new List<FocusStartingPointResponse>();
-            foreach (var item in this.ListBox_Well.Items)
-            {
-                if (!(item is PositionEntity positionEntity)) continue;
-                if (!positionEntity.IsUpdate) continue;
-                listData.Add(new FocusStartingPointResponse
-                {
-                    wellSn = positionEntity.wellSn,
-                    focusStartingPoint = positionEntity.focusStartingPoint
-                });
-            }
-            if (picProvider.UpdateImmediatelyApi(tlSn, houseSn, listData))
-            {
-                new ToastWindow(this, 1920, 65, true).Show();
-            }
-            else
-            {
-                new ToastWindow(this, 1920, 65, false).Show();
-            }
-        }
-
-        private void Cancel_Click(object sender, RoutedEventArgs e)
-        {
-            this.DialogResult = false;
-            this.Close();
-            return;
-        }
-
-        private void Aad_Click(object sender, RoutedEventArgs e)
-        {
-            if (this.ListBox_Well.SelectedItem == null) return;
-            if (!(this.ListBox_Well.SelectedItem is PositionEntity positionEntity)) return;
-            if (!int.TryParse(this.TextBlock_focusStartingPoint.Text, out int newValue))
-            {
-                return;
-            }
-            newValue += positionEntity.verticalMotorSpacePulse * 5;
-            this.TextBlock_focusStartingPoint.Text = newValue.ToString();
-            if (newValue < 125000)
-            {
-                this.Button_Add.IsEnabled = true;
-            }
-            else
-            {
-                this.Button_Add.IsEnabled = false;
-            }
-            if (newValue > 0)
-            {
-                this.Button_Sub.IsEnabled = true;
-            }
-            else
-            {
-                this.Button_Sub.IsEnabled = false;
-            }
-        }
-
-        private void Sub_Click(object sender, RoutedEventArgs e)
-        {
-            if (this.ListBox_Well.SelectedItem == null) return;
-            if (!(this.ListBox_Well.SelectedItem is PositionEntity positionEntity)) return;
-            if (!int.TryParse(this.TextBlock_focusStartingPoint.Text, out int newValue))
-            {
-                return;
-            }
-            newValue -= positionEntity.verticalMotorSpacePulse * 5;
-            this.TextBlock_focusStartingPoint.Text = newValue.ToString();
-            if (newValue > 0)
-            {
-                this.Button_Sub.IsEnabled = true;
-            }
-            else
-            {
-                this.Button_Sub.IsEnabled = false;
-            }
-            if (newValue < 125000)
-            {
-                this.Button_Add.IsEnabled = true;
-            }
-            else
-            {
-                this.Button_Add.IsEnabled = false;
-            }
-        }
-
-        private void ScrollViewer_ManipulationBoundaryFeedback(object sender, ManipulationBoundaryFeedbackEventArgs e)
-        {
-            e.Handled = true;
-        }
-
-        private void NextButton_Click(object sender, RoutedEventArgs e)
-        {
-            if (!int.TryParse(this.Image_Big.Tag.ToString(), out int newValue))
-            {
-                return;
-            }
-            newValue++;
-            if (!ListPic.ContainsKey(newValue)) return;
-            var checkBoxImage = ListPic[newValue];
-            this.Text_Big.Text = checkBoxImage.ImageInfoString;
-            this.Image_Big.Source = AppData.Instance.StringToBitmapImage($"{AppData.Instance.BaseUrl}{checkBoxImage.ImageUrl}?token={AppData.Instance.HttpServiceCall.GetToken()}");
-            this.Canvas_Big.Visibility = Visibility.Visible;
-            this.Image_Big.Tag = newValue;
-            if (newValue < ListPic.Last().Key)
-            {
-                this._nextPic_Button.Visibility = Visibility.Visible;
-            }
-            else
-            {
-                this._nextPic_Button.Visibility = Visibility.Hidden;
-            }
-            if (newValue > 1)
-            {
-                this._prePic_Button.Visibility = Visibility.Visible;
-            }
-            else
-            {
-                this._prePic_Button.Visibility = Visibility.Hidden;
-            }
-        }
-
-        private void PreButton_Click(object sender, RoutedEventArgs e)
-        {
-            if (!int.TryParse(this.Image_Big.Tag.ToString(), out int newValue))
-            {
-                return;
-            }
-            newValue--;
-            if (!ListPic.ContainsKey(newValue)) return;
-            var checkBoxImage = ListPic[newValue];
-            this.Text_Big.Text = checkBoxImage.ImageInfoString;
-            this.Image_Big.Source = AppData.Instance.StringToBitmapImage($"{AppData.Instance.BaseUrl}{checkBoxImage.ImageUrl}?token={AppData.Instance.HttpServiceCall.GetToken()}");
-            this.Canvas_Big.Visibility = Visibility.Visible;
-            this.Image_Big.Tag = newValue;
-            if (newValue > 1)
-            {
-                this._prePic_Button.Visibility = Visibility.Visible;
-            }
-            else
-            {
-                this._prePic_Button.Visibility = Visibility.Hidden;
-            }
-            if (newValue < ListPic.Last().Key)
-            {
-                this._nextPic_Button.Visibility = Visibility.Visible;
-            }
-            else
-            {
-                this._nextPic_Button.Visibility = Visibility.Hidden;
-            }
-        }
-
-        private void Close_Click(object sender, RoutedEventArgs e)
-        {
-            this.Canvas_Big.Visibility = Visibility.Collapsed;
-        }
-
-        private void TextBox_PreviewTextInput(object sender, TextCompositionEventArgs e)
-        {
-            e.Handled = !Regex.IsMatch(e.Text, @"[0-9]");
-        }
-
-        private void KouTu_Checked(object sender, RoutedEventArgs e)
-        {
-            if (!this.IsLoaded) return;
-            this.Canvas_Big.Visibility = Visibility.Collapsed;
-            BitmapImage ImageSourceUrl = null;
-            foreach (var item in ListPic)
-            {
-                if (!(item.Value.Tag is AutoFocusPictureEntity tagEntity)) continue;
-                if (string.IsNullOrEmpty(tagEntity.imageUrl))
-                {
-                    ImageSourceUrl = null;
-                }
-                else
-                {
-                    ImageSourceUrl = AppData.Instance.StringToBitmapImage($"{AppData.Instance.BaseUrl}{tagEntity.imageUrl.Replace(AppData.Instance.PicSuf, $"_180x180{AppData.Instance.PicSuf}")}?token={AppData.Instance.HttpServiceCall.GetToken()}");
-                }
-                item.Value.ImageUrl = tagEntity.imageUrl;
-                item.Value.ImageSourceUrl = ImageSourceUrl;
-            }
-            var aa = ListPic.Where(x => x.Value.Visibility == Visibility.Visible);
-            int CheckBoxImageNum = 1;
-            foreach (var checkBoxImage in aa)
-            {
-                if (CheckBoxImageNum > 7)
-                {
-                    if ((CheckBoxImageNum - 1) % 7 == 0) checkBoxImage.Value.Margin = new Thickness(0, 10, 0, 0);
-                    else checkBoxImage.Value.Margin = new Thickness(10, 10, 0, 0);
-                }
-                else
-                {
-                    if (CheckBoxImageNum == 1) checkBoxImage.Value.Margin = new Thickness(0);
-                    else checkBoxImage.Value.Margin = new Thickness(10, 0, 0, 0);
-                }
-                CheckBoxImageNum++;
-            }
-        }
-
-        private void YuanTu_Checked(object sender, RoutedEventArgs e)
-        {
-            if (!this.IsLoaded) return;
-            this.Canvas_Big.Visibility = Visibility.Collapsed;
-            BitmapImage ImageSourceUrl = null;
-            foreach (var item in ListPic)
-            {
-                if (!(item.Value.Tag is AutoFocusPictureEntity tagEntity)) continue;
-                if (string.IsNullOrEmpty(tagEntity.sourceImageUrl))
-                {
-                    ImageSourceUrl = null;
-                }
-                else
-                {
-                    ImageSourceUrl = AppData.Instance.StringToBitmapImage($"{AppData.Instance.BaseUrl}{tagEntity.sourceImageUrl.Replace(AppData.Instance.PicSuf, $"_180x180{AppData.Instance.PicSuf}")}?token={AppData.Instance.HttpServiceCall.GetToken()}");
-                }
-                item.Value.ImageUrl = tagEntity.sourceImageUrl;
-                item.Value.ImageSourceUrl = ImageSourceUrl;
-            }
-
-            var aa = ListPic.Where(x => x.Value.Visibility == Visibility.Visible);
-            int CheckBoxImageNum = 1;
-            foreach (var checkBoxImage in aa)
-            {
-                if (CheckBoxImageNum > 7)
-                {
-                    if ((CheckBoxImageNum - 1) % 7 == 0) checkBoxImage.Value.Margin = new Thickness(0, 10, 0, 0);
-                    else checkBoxImage.Value.Margin = new Thickness(10, 10, 0, 0);
-                }
-                else
-                {
-                    if (CheckBoxImageNum == 1) checkBoxImage.Value.Margin = new Thickness(0);
-                    else checkBoxImage.Value.Margin = new Thickness(10, 0, 0, 0);
-                }
-                CheckBoxImageNum++;
-            }
-        }
-    }
-}

+ 0 - 26
aivfo-front-manament-2.0/ivf_tl_Service/HttpProvider/PicProvider.cs

@@ -392,32 +392,6 @@ namespace ivf_tl_Service.HttpProvider
             }
         }
 
-        public AutoFocusResult GetAutofocusPicturesApi(string tlSn, int houseSn, long embryoId)
-        {
-            string funcName = "GetAutofocusPicturesApi";
-            try
-            {
-                string url = "/api/businessManage/pc/resource/getAutofocusPictures";
-                string body = JsonConvert.SerializeObject(new { tlSn, houseSn, embryoId });
-                string resultString = httpServiceCall1.callWebService(url, body);
-                if (string.IsNullOrEmpty(resultString)) return new AutoFocusResult();
-                var rs = JsonConvert.DeserializeObject<ResultEntity<AutoFocusResult>>(resultString);
-                if (!rs.success)
-                {
-                    ErrorLog($"{funcName}服务器返回失败 {resultString}", LogEnum.RunError);
-                    return new AutoFocusResult();
-                }
-                if (rs.data != null) return rs.data;
-                ErrorLog($"{funcName}接口返回成功但是无数据 {resultString}", LogEnum.RunError);
-                return new AutoFocusResult();
-            }
-            catch (Exception ex)
-            {
-                ExLog(ex, funcName);
-                return new AutoFocusResult();
-            }
-        }
-
         public bool UpdateImmediatelyApi(string tlSn, int houseSn, List<FocusStartingPointResponse> wellFocusStartingPointList)
         {
             string funcName = "UpdateImmediatelyApi";