Jelajahi Sumber

chore(control): 阶段3 退役删除老壳 ivf_tl_ControlTest(ivf_tl_ControlMain)

设计 §7/§164:老壳 Window1 启动骨架已被 operate 复刻吸收、MainWindow 纯测试、StopWindow 死窗,
新 control 启动器 ivf_tl_ControlHost 已基于干净 ivf_tl_Control 类库跑通真机闭环,确认后退役删除。
从 control/ivf_tl_Control.sln 移除并删目录;control sln 重编 0 错误,operate 编译不受影响
(operate 仅 SettingPageView 字符串引用旧进程名 ivf_tl_ControlMain,属死代码,随调试页借串口改造一并清)。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
huangjie 2 hari lalu
induk
melakukan
7a9d7ff702

+ 0 - 10
ivf_tl_operate_2.0/control/ivf_tl_Control.sln

@@ -21,8 +21,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ivf_tl_Services", "ivf_tl_S
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ivf_tl_Com", "ivf_tl_Com\ivf_tl_Com.csproj", "{172484E8-2D75-4B99-BE9B-BA4F31449A76}"
 EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ivf_tl_ControlMain", "ivf_tl_ControlTest\ivf_tl_ControlMain.csproj", "{B1678351-7A3C-4D0F-A6DC-A12BBABE8A8D}"
-EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ivf_tl_ServicesImpl", "ivf_tl_ServicesImpl\ivf_tl_ServicesImpl.csproj", "{34F034FC-7A14-476E-A9E1-696093BC9448}"
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IvfTl.Hardware", "IvfTl.Hardware\IvfTl.Hardware.csproj", "{C3A1F7E2-6B4D-4A21-9E55-1A2B3C4D5E6F}"
@@ -103,14 +101,6 @@ Global
 		{172484E8-2D75-4B99-BE9B-BA4F31449A76}.Release|Any CPU.Build.0 = Release|Any CPU
 		{172484E8-2D75-4B99-BE9B-BA4F31449A76}.Release|x64.ActiveCfg = Release|x64
 		{172484E8-2D75-4B99-BE9B-BA4F31449A76}.Release|x64.Build.0 = Release|x64
-		{B1678351-7A3C-4D0F-A6DC-A12BBABE8A8D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{B1678351-7A3C-4D0F-A6DC-A12BBABE8A8D}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{B1678351-7A3C-4D0F-A6DC-A12BBABE8A8D}.Debug|x64.ActiveCfg = Debug|x64
-		{B1678351-7A3C-4D0F-A6DC-A12BBABE8A8D}.Debug|x64.Build.0 = Debug|x64
-		{B1678351-7A3C-4D0F-A6DC-A12BBABE8A8D}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{B1678351-7A3C-4D0F-A6DC-A12BBABE8A8D}.Release|Any CPU.Build.0 = Release|Any CPU
-		{B1678351-7A3C-4D0F-A6DC-A12BBABE8A8D}.Release|x64.ActiveCfg = Release|x64
-		{B1678351-7A3C-4D0F-A6DC-A12BBABE8A8D}.Release|x64.Build.0 = Release|x64
 		{34F034FC-7A14-476E-A9E1-696093BC9448}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{34F034FC-7A14-476E-A9E1-696093BC9448}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{34F034FC-7A14-476E-A9E1-696093BC9448}.Debug|x64.ActiveCfg = Debug|x64

TEMPAT SAMPAH
ivf_tl_operate_2.0/control/ivf_tl_ControlTest/1.ico


+ 0 - 47
ivf_tl_operate_2.0/control/ivf_tl_ControlTest/App.config

@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<configuration>
-	<appSettings>
-		<!--1直接拍照异常,0正常拍照-->
-		<add key="CCDError" value="0" />
-		<!--换气时冲刷时间,单位秒-->
-		<add key="csTime" value="15" />
-		<!--换气结束时,缓冲瓶关闭进气阀后等待时间,单位秒-->
-		<add key="gbTime" value="10" />
-		<!--最大排气次数-->
-		<add key="VentNum" value="10" />
-		<!--排气目标气压-->
-		<add key="VentPre" value="20" />
-		<!--平衡时排气阀打开间歇时间,单位毫秒-->
-		<add key="VentWaitTimeB" value="4000" />
-		<!--培养时排气阀打开间歇时间,单位毫秒-->
-		<add key="VentWaitTimeD" value="4000" />
-		<!--自动对焦前,漏气补气时间,单位分钟-->
-		<add key="AutoWaitTime" value="10" />
-		<!--拍照失败后,自动对焦等待时间,单位分钟-->
-		<add key="CCDAutoWaitTime" value="5" />
-		<!--拍照失败后,等待时间,单位秒-->
-		<add key="CCDFailedWaitTime" value="15" />
-		<!--拍照异常报警次数-->
-		<add key="CCDFailedNumber" value="3" />
-
-		<!--0表示15分钟定时换气,1表示排队换气-->
-		<add key="QueuAir" value="0"/>
-		
-		<!--关闭软件倒计时,单位秒-->
-		<add key="StopPro" value="15"/>
-		
-		<add key="userName" value="admin" />
-		<add key="passWord" value="123456" />
-		<add key="cacheDisk" value="C" />
-		<add key="urlIp" value="http://192.168.0.91" />
-		<add key="urlPort" value="10010" />
-		<add key="kfkaIP" value="192.168.0.91" />
-		<add key="kfkaPort" value="9092" />
-		<add key="mqttIp" value="192.168.0.91" />
-		<add key="mqttPort" value="1883" />
-
-		<add key="Language" value="Chinese.xaml" />
-		<!--<add key="Language" value="Chinese.xaml" />-->
-		<!--<add key="Language" value="English.xaml" />-->
-	</appSettings>
-</configuration>

+ 0 - 14
ivf_tl_operate_2.0/control/ivf_tl_ControlTest/App.xaml

@@ -1,14 +0,0 @@
-<Application x:Class="TLTest.App"
-             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-             xmlns:local="clr-namespace:TLTest"
-             StartupUri="Window1.xaml">
-    <Application.Resources>
-        <ResourceDictionary>
-            <ResourceDictionary.MergedDictionaries>
-                <ResourceDictionary Source="pack://application:,,,/ivf_tl_ControlMain;component/Language/Chinese.xaml"/>
-                <!--<ResourceDictionary Source="pack://application:,,,/ivf_tl_ControlMain;component/Language/English.xaml"/>-->
-            </ResourceDictionary.MergedDictionaries>
-        </ResourceDictionary>
-    </Application.Resources>
-</Application>

+ 0 - 210
ivf_tl_operate_2.0/control/ivf_tl_ControlTest/App.xaml.cs

@@ -1,210 +0,0 @@
-using IvfTl.Control.Services;
-using Newtonsoft.Json;
-using System;
-using System.Collections.Generic;
-using System.Configuration;
-using System.Data;
-using System.IO;
-using System.Linq;
-using System.Threading;
-using System.Threading.Tasks;
-using System.Windows;
-using System.Windows.Threading;
-
-namespace TLTest
-{
-    /// <summary>
-    /// Interaction logic for App.xaml
-    /// </summary>
-    public partial class App : Application
-    {
-        private static Mutex instance;
-        /// <summary>
-        /// 分支说明:15分钟定时换气,下位机不能接管换气
-        /// </summary>
-        public App()
-        {
-            Log4netHelper.WriteLog("程序启动");
-            //首先注册开始和退出事件
-            this.Startup += new StartupEventHandler(App_Startup);
-            //this.Exit += new ExitEventHandler(App_Exit);
-        }
-
-
-        protected override void OnStartup(StartupEventArgs e)
-        {
-            bool isNotRunning;  //互斥体判断
-            instance = new Mutex(true, "ivf_tl_ControlMain", out isNotRunning);   //同步基元变量
-            if (!isNotRunning)  // 如果不是未运行状态
-            {
-                MessageBox.Show("程序已启动 ");
-                App.Current.Shutdown();
-                return;
-            }
-            base.OnStartup(e);
-        }
-
-        protected override void OnExit(ExitEventArgs e)
-        {
-            base.OnExit(e);
-            Log4netHelper.WriteLog("程序退出");
-        }
-
-        private void App_Exit(object sender, ExitEventArgs e)
-        {
-            Log4netHelper.WriteLog("App_Exit");
-        }
-
-        private void App_Startup(object sender, StartupEventArgs e)
-        {
-            //UI线程未捕获异常处理事件
-            this.DispatcherUnhandledException += new DispatcherUnhandledExceptionEventHandler(App_DispatcherUnhandledException);
-            //Task线程内未捕获异常处理事件
-            TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException;
-            //非UI线程未捕获异常处理事件
-            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
-            ChangeLanguage(ConfigurationManager.AppSettings["Language"].ToString());
-        }
-
-        /// <summary>
-        /// 非UI线程未捕获异常处理事件
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        /// <exception cref="NotImplementedException"></exception>
-        private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
-        {
-            try
-            {
-                if (e.IsTerminating)
-                {
-                    Log4netHelper.WriteLog($"非UI线程发生致命错误,程序即将终止");
-                }
-                if (e.ExceptionObject is Exception ex)
-                {
-                    if (ex.InnerException != null)
-                    {
-                        Log4netHelper.WriteLog($"非UI线程异常详细:{ex.InnerException.Message}{ex.InnerException.StackTrace}");
-                    }
-                    Log4netHelper.WriteLog($"非UI线程异常:{ex.Message}{ex.StackTrace}");
-                }
-                else
-                {
-                    Log4netHelper.WriteLog($"非UI线程异常:异常对象类型不是Exception");
-                }
-            }
-            catch (Exception exx)
-            {
-                if (exx.InnerException != null)
-                {
-                    Log4netHelper.WriteLog($"捕获非UI线程异常时发生异常详细:{exx.InnerException.Message}{exx.InnerException.StackTrace}");
-                }
-                Log4netHelper.WriteLog($"捕获非UI线程异常时发生异常:{exx.Message}{exx.StackTrace}");
-            }
-        }
-
-        /// <summary>
-        /// Task线程内未捕获异常处理事件
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        /// <exception cref="NotImplementedException"></exception>
-        private void TaskScheduler_UnobservedTaskException(object? sender, UnobservedTaskExceptionEventArgs e)
-        {
-            try
-            {
-                if (e.Exception.InnerException != null)
-                {
-                    Log4netHelper.WriteLog($"Task线程异常详细:{e.Exception.InnerException.Message}{e.Exception.InnerException.StackTrace}");
-                }
-                Log4netHelper.WriteLog($"Task线程异常:{e.Exception.Message}{e.Exception.StackTrace}");
-                e.SetObserved();//设置该异常已察觉(这样处理后就不会引起程序崩溃)
-            }
-            catch (Exception ex)
-            {
-                if (ex.InnerException != null)
-                {
-                    Log4netHelper.WriteLog($"捕获Task线程异常时发生异常详细:{ex.InnerException.Message}{ex.InnerException.StackTrace}");
-                }
-                Log4netHelper.WriteLog($"捕获Task线程异常时发生异常:{ex.Message}{ex.StackTrace}");
-            }
-            finally
-            {
-                e.SetObserved();//设置该异常已察觉(这样处理后就不会引起程序崩溃)
-            }
-        }
-
-        /// <summary>
-        /// UI线程未捕获异常处理事件
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        /// <exception cref="NotImplementedException"></exception>
-        private void App_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
-        {
-
-            try
-            {
-                if (e.Exception.InnerException != null)
-                {
-                    Log4netHelper.WriteLog($"UI线程异常详细:{e.Exception.InnerException.Message}{e.Exception.InnerException.StackTrace}");
-                }
-                Log4netHelper.WriteLog($"UI线程异常:{e.Exception.Message}{e.Exception.StackTrace}");
-                //把 Handled 属性设为true,表示此异常已处理,程序可以继续运行,不会强制退出      
-            }
-            catch (Exception ex)
-            {
-                //此时程序出现严重异常,将强制结束退出
-                if (ex.InnerException != null)
-                {
-                    Log4netHelper.WriteLog($"捕获UI线程异常时发生异常详细:{ex.InnerException.Message}{ex.InnerException.StackTrace}");
-                }
-                Log4netHelper.WriteLog($"捕获UI线程异常时发生异常:{ex.Message}{ex.StackTrace}");
-            }
-            finally
-            {
-                e.Handled = true;
-            }
-        }
-
-        public void ChangeLanguage(string languageName)
-        {
-            try
-            {
-                ResourceDictionary langRd = null;
-#if DEBUG
-                string xamlFilePath = @"C:\PersonalSpace\work\1 VisualWorkSpace\ControlLan\" + languageName;
-#else
-               string xamlFilePath = $"{System.AppDomain.CurrentDomain.BaseDirectory}Language\\{languageName}";
-#endif
-                if (!File.Exists(xamlFilePath))
-                {
-                    Log4netHelper.WriteLog($"切换语言失败,配置文件不存在:{xamlFilePath}");
-                    return;
-                }
-                using (var stream = new FileStream(xamlFilePath, FileMode.Open))
-                {
-                    langRd = System.Windows.Markup.XamlReader.Load(stream) as ResourceDictionary;
-                }
-                if (langRd != null)
-                {
-                    int count = Application.Current.Resources.MergedDictionaries.Count;
-                    if (count >= 3)
-                    {
-                        Application.Current.Resources.MergedDictionaries.RemoveAt(count - 1);
-                    }
-                    Application.Current.Resources.MergedDictionaries.Add(langRd);
-                }
-                else
-                {
-                    Log4netHelper.WriteLog($"切换语言失败,文件转ResourceDictionary失败;{xamlFilePath}");
-                }
-            }
-            catch (Exception ex)
-            {
-                Log4netHelper.WriteLog($"切换语言异常,{JsonConvert.SerializeObject(ex)}");
-                return;
-            }
-        }
-    }
-}

+ 0 - 10
ivf_tl_operate_2.0/control/ivf_tl_ControlTest/AssemblyInfo.cs

@@ -1,10 +0,0 @@
-using System.Windows;
-
-[assembly: ThemeInfo(
-    ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
-                                     //(used if a resource is not found in the page,
-                                     // or application resource dictionaries)
-    ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
-                                              //(used if a resource is not found in the page,
-                                              // app, or any theme specific resource dictionaries)
-)]

+ 0 - 14
ivf_tl_operate_2.0/control/ivf_tl_ControlTest/Language/Chinese.xaml

@@ -1,14 +0,0 @@
-<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-                    xmlns:system="clr-namespace:System;assembly=mscorlib">
-    <system:String x:Key="D0001">账号:</system:String>
-    <system:String x:Key="D0002">密码:</system:String>
-    <system:String x:Key="D0003">开始</system:String>
-    <system:String x:Key="D0004">退出</system:String>
-    <system:String x:Key="D0005">程序运行中,请勿关闭</system:String>
-    <system:String x:Key="D0006">时差下位机控制软件</system:String>
-    <system:String x:Key="D0007">检测到</system:String>
-    <system:String x:Key="D0008">个模块,是否继续运行?</system:String>
-    <system:String x:Key="D0009">提示</system:String>
-    <system:String x:Key="D0010">拍照失败,等待</system:String>
-</ResourceDictionary>

+ 0 - 14
ivf_tl_operate_2.0/control/ivf_tl_ControlTest/Language/English.xaml

@@ -1,14 +0,0 @@
-<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"                
-                    xmlns:system="clr-namespace:System;assembly=mscorlib">
-    <system:String x:Key="D0001">Account:</system:String>
-    <system:String x:Key="D0002">Password:</system:String>
-    <system:String x:Key="D0003">Starte</system:String>
-    <system:String x:Key="D0004">Exit</system:String>
-    <system:String x:Key="D0005">Do not close the control software</system:String>
-    <system:String x:Key="D0006">NEO Lower computer control software</system:String>
-    <system:String x:Key="D0007" xml:space="preserve" >Detected&#x20;</system:String>
-    <system:String x:Key="D0008" xml:space="preserve" >&#x20;cabin, are you sure to run?</system:String>
-    <system:String x:Key="D0009">Tip</system:String>
-    <system:String x:Key="D0010" xml:space="preserve" >take photos failed,wait for&#x20;</system:String>
-</ResourceDictionary>

+ 0 - 40
ivf_tl_operate_2.0/control/ivf_tl_ControlTest/MainWindow.xaml

@@ -1,40 +0,0 @@
-<Window x:Class="TLTest.MainWindow"
-        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:TLTest"
-        mc:Ignorable="d"
-        Title="MainWindow" Height="450" Width="800">
-    <StackPanel  HorizontalAlignment="Center" VerticalAlignment="Center">
-        <StackPanel Orientation="Horizontal" Margin="10">
-            <TextBlock Text="topic:" Margin="10 0 0 0"/>
-            <TextBox x:Name="topic_TextBox" Text="jiangxuebingPicTestTopic" Width="200"/>
-
-            <TextBlock Text="ip:" Margin="10 0 0 0"/>
-            <TextBox x:Name="ip_TextBox" Text="192.168.31.89:9092" Width="200"/>
-
-            <Button Content="设置" Margin="10 0 0 0" Click="Button_Click_1"/>
-        </StackPanel>
-        <StackPanel Orientation="Horizontal" Margin="10">
-            <TextBlock Text="仓室编号:"/>
-            <TextBox x:Name="housesn_TextBox" Text="1" Width="50"/>
-
-            <TextBlock Text="分区数量:" Margin="10 0 0 0"/>
-            <TextBox x:Name="paNum_TextBox" Text="3" Width="50"/>
-        </StackPanel>
-        <StackPanel Orientation="Horizontal" Margin="10">
-            <Button Margin="10" Width="100" Height="50" Content="握手" Click="Button_Click"/>
-
-            <Button Margin="10" Width="100" Height="50" Content="kafka监听" Click="Button_Click1"/>
-
-            <Button Margin="10" Width="100" Height="50" Content="kafka发送" Click="Button_Click2"/>
-
-            <Button Margin="10" Width="100" Height="50" Content="kafka创建分区" Click="Button_Click3"/>
-
-            <Button Margin="10" Width="100" Height="50" Content="kafka获取分区" Click="Button_Click4"/>
-
-            <Button Margin="10" Width="120" Height="50" Content="kafka判断分区存在" Click="Button_Click5"/>
-        </StackPanel>
-    </StackPanel>
-</Window>

+ 0 - 298
ivf_tl_operate_2.0/control/ivf_tl_ControlTest/MainWindow.xaml.cs

@@ -1,298 +0,0 @@
-using Google.Protobuf;
-using ivf_tl_Control;
-using IvfTl.Control.Entity.DTO;
-using ivf_tl_SerialHelper.Util;
-using ivf_tl_ServicesImpl.DBServices;
-using ivf_tl_ServicesImpl.KafkaServices;
-using ivf_tl_ServicesImpl.MqttServices;
-using Newtonsoft.Json;
-using System;
-using System.Collections.Generic;
-using System.Drawing.Imaging;
-using System.IO;
-using System.Security.Principal;
-using System.Threading.Tasks;
-using System.Windows;
-
-namespace TLTest
-{
-    /// <summary>
-    /// Interaction logic for MainWindow.xaml
-    /// </summary>
-    public partial class MainWindow : Window
-    {
-        public MainWindow()
-        {
-            InitializeComponent();
-        }
-        ComBin comBin = null;
-        private void Button_Click(object sender, RoutedEventArgs e)
-        {
-            //DBServiceImpl.Instance.BuildEntity();
-            string ss = "";
-            //return;
-
-            //StartMain startMain = new StartMain();
-            //MessageBox.Show(startMain.StartRun());
-            AppData.Instance.Login("admin", "123456");
-
-            Dictionary<int, DateTime?> keyValuePairs = new Dictionary<int, DateTime?>();
-            for (int i = 1; i < 17; i++)
-            {
-                keyValuePairs.Add(i, null);
-            }
-            for (int i = 1; i < 11; i++)
-            {
-                var aaaaa = AppData.Instance.HouseBin_GetCCDServiceEventTest(i, keyValuePairs);
-                var bbbb = AppData.Instance.HouseBin_GetAutoFocusServiceEventTest(i, keyValuePairs);
-            }
-            //var bbbb = AppData.Instance.HouseBin_GetAutoFocusDBEventTest(5, keyValuePairs);
-
-            string ss123 = "";
-        }
-
-      
-        KafkaService kafkaService = AppData.Instance.KafkaService;
-
-        MqttService mqttService = AppData.Instance.MqttService;
-
-        /// <summary>
-        /// kafka监听
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private async void Button_Click1(object sender, RoutedEventArgs e)
-        {
-            try
-            {
-                await mqttService.PublishAsync("测试12354646");
-                //kafkaService.kafkaConsumerTest();
-            }
-            catch (Exception ex)
-            {
-                MessageBox.Show($"{ex.Message}{ex.StackTrace}");
-            }
-
-        }
-
-        /// <summary>
-        /// kafka发送
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private async void Button_Click2(object sender, RoutedEventArgs e)
-        {
-            try
-            {
-                await kafkaService.kafkaProducerAsync(GetImageDTO());
-                MessageBox.Show("完成");
-            }
-            catch (Exception ex)
-            {
-                MessageBox.Show($"{ex.Message}{ex.StackTrace}");
-            }
-        }
-
-        private ImageDTO GetImageDTO()
-        {
-            try
-            {
-                ImageDTO imageDTO = new ImageDTO();
-                imageDTO.TlSn = "TlSn";
-                imageDTO.HouseSn = int.Parse(this.housesn_TextBox.Text.Trim());
-                imageDTO.WellSn = 1;
-                imageDTO.CcdSn = "1";
-                imageDTO.SourceImageName = "1.jpg";
-                imageDTO.SourceImagePath = "1";
-                //imageDTO.SourceImageWidth = "1";
-                //imageDTO.SourceImageHeight = "1";
-                imageDTO.ImageTime = "2020-10-10 00:00:00";
-                imageDTO.FertilizationTime = "2020-10-10 00:00:00";
-                imageDTO.PhotographType = 1;
-                imageDTO.TotalLayer = 1;
-                imageDTO.PictureLayer = 1;
-                imageDTO.ShootingPosition = 1;
-                imageDTO.Clearest = 1;
-                imageDTO.End = 1;
-                imageDTO.EmbryoCultureRecordId = 1;
-                imageDTO.EmbryoId = 1;
-
-                string fileName = $"{Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, @"DependFile\PicLoadFailed.jpg")}";
-
-
-                imageDTO.ImageData = ByteString.CopyFrom(GetImageData(fileName));
-
-                return imageDTO;
-            }
-            catch (Exception ex)
-            {
-                MessageBox.Show($"获取imagedto{ex.Message}{ex.StackTrace}");
-                return null;
-            }
-
-        }
-
-        private byte[] GetImageData(string fileName)
-        {
-            try
-            {
-                if (!File.Exists(fileName))
-                {
-                    return null;
-                }
-                ImageFormat imageFormat = ImageFormat.Jpeg;
-                switch (Path.GetExtension(fileName).ToLower())
-                {
-                    case ".jpg":
-                        imageFormat = ImageFormat.Jpeg;
-                        break;
-                    case ".bmp":
-                        imageFormat = ImageFormat.Bmp;
-                        break;
-                    case ".png":
-                        imageFormat = ImageFormat.Png;
-                        break;
-                    default:
-                        break;
-                }
-                System.Drawing.Bitmap bitmap = new System.Drawing.Bitmap(fileName);
-                MemoryStream memoryStream = new MemoryStream();
-                bitmap.Save(memoryStream, imageFormat);
-                var a = memoryStream.ToArray();
-                memoryStream.Close();
-                memoryStream.Dispose();
-                bitmap.Dispose();
-                return a;
-            }
-            catch (Exception ex)
-            {
-                return null;
-            }
-        }
-
-        /// <summary>
-        /// kafka创建分区
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private async void Button_Click3(object sender, RoutedEventArgs e)
-        {
-            try
-            {
-                await kafkaService.CreateTopicAsync(int.Parse(this.paNum_TextBox.Text.Trim()));
-                MessageBox.Show("完成");
-            }
-            catch (Exception ex)
-            {
-                MessageBox.Show($"{ex.Message}{ex.StackTrace}");
-            }
-        }
-
-        /// <summary>
-        /// kafka获取分区
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void Button_Click4(object sender, RoutedEventArgs e)
-        {
-            try
-            {
-                kafkaService.GetAllTopic();
-                MessageBox.Show("完成");
-            }
-            catch (Exception ex)
-            {
-                MessageBox.Show($"{ex.Message}{ex.StackTrace}");
-            }
-        }
-
-        /// <summary>
-        /// 判断分区存在,若不存在则创建
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private async void Button_Click5(object sender, RoutedEventArgs e)
-        {
-            try
-            {
-                var sdf = await kafkaService.CreateTopicAsync(int.Parse(this.paNum_TextBox.Text.Trim()));
-                MessageBox.Show($"完成{sdf}");
-            }
-            catch (Exception ex)
-            {
-                MessageBox.Show($"{ex.Message}{ex.StackTrace}");
-            }
-        }
-
-        private void Button_Click_1(object sender, RoutedEventArgs e)
-        {
-            try
-            {
-                kafkaService.KafkaSetNameAndIp(this.topic_TextBox.Text.Trim(), this.ip_TextBox.Text.Trim());
-            }
-            catch (Exception ex)
-            {
-                MessageBox.Show($"{ex.Message}{ex.StackTrace}");
-            }
-        }
-
-
-        private void _channel_ReceiveLogEvent(int arg1, DateTime arg2, string arg3)
-        {
-            WriteRunRecordLog(arg2, $"[ReceiveLogEvent][{arg1}][{arg3}]");
-        }
-
-        private void _channel_SendLogEvent(int arg1, DateTime arg2, string arg3)
-        {
-            WriteRunRecordLog(arg2, $"[SendLogEvent][{arg1}][{arg3}]");
-        }
-
-        private void _channel_ErrorLogEvent(string obj)
-        {
-            WriteRunRecordLog(DateTime.Now, $"[ErrorLogEvent]{obj}");
-        }
-
-        private void _channel_LogEvent(string obj)
-        {
-            WriteRunRecordLog(DateTime.Now, $"[LogEvent]{obj}");
-        }
-
-        private void _channel_ExceptionLogEvent(Exception arg1, string arg2, string arg3)
-        {
-            WriteRunRecordLog(DateTime.Now, $"[ExceptionLogEvent][{arg2}][{arg3}][{arg1.Message}:{arg1.StackTrace}]");
-        }
-
-        private static object WriteRunRecordLock = new object();
-        /// <summary>
-        /// 记录程序运行情况
-        /// </summary>
-        private static void WriteRunRecordLog(DateTime recordTime, string content)
-        {
-            try
-            {
-                string dirTime = recordTime.ToString("yyyy-MM-dd");
-                string path = $"{System.AppDomain.CurrentDomain.BaseDirectory}log";
-
-                lock (WriteRunRecordLock)
-                {
-                    if (!Directory.Exists(path))
-                    {
-                        Directory.CreateDirectory(path);
-                    }
-                    string filename = Path.Combine(path, "RunRecord.log");
-
-                    string wroteContent = $"[{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:fff")}]  {recordTime.ToString("yyyy-MM-dd HH:mm:ss:fff")}  {content}";
-
-                    using (StreamWriter mySw = File.AppendText(filename))
-                    {
-                        mySw.WriteLine(wroteContent);
-                        mySw.Close();
-                    }
-                }
-            }
-            catch (Exception ex)
-            {
-            }
-        }
-    }
-}

+ 0 - 18
ivf_tl_operate_2.0/control/ivf_tl_ControlTest/Properties/PublishProfiles/FolderProfile.pubxml

@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-https://go.microsoft.com/fwlink/?LinkID=208121.
--->
-<Project>
-  <PropertyGroup>
-    <Configuration>Release</Configuration>
-    <Platform>x64</Platform>
-    <PublishDir>bin\Release\net6.0-windows\publish\win-x64\</PublishDir>
-    <PublishProtocol>FileSystem</PublishProtocol>
-    <_TargetId>Folder</_TargetId>
-    <TargetFramework>net6.0-windows</TargetFramework>
-    <RuntimeIdentifier>win-x64</RuntimeIdentifier>
-    <SelfContained>true</SelfContained>
-    <PublishSingleFile>true</PublishSingleFile>
-    <PublishReadyToRun>true</PublishReadyToRun>
-  </PropertyGroup>
-</Project>

+ 0 - 34
ivf_tl_operate_2.0/control/ivf_tl_ControlTest/StopWindow.xaml

@@ -1,34 +0,0 @@
-<Window x:Class="ivf_tl_ControlMain.StopWindow"
-        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_ControlMain"
-        mc:Ignorable="d"
-        WindowStyle="ToolWindow"
-        WindowStartupLocation="CenterScreen"
-        Title="时差下位机控制软件"
-        Topmost="True"
-        x:Name="cWindow"
-        Height="310" Width="800">
-    <StackPanel Margin="5">
-        <TextBlock FontSize="40">
-            <Run Text="相机异常:自动重启倒计时【"/><Run Text="{Binding ElementName=cWindow, Path=MyProperty}"/><Run Text="】秒!"/>
-        </TextBlock>
-        <TextBlock Margin="0 20 0 0" TextAlignment="Center" FontSize="24" >
-            系统检测到相机拍照异常,需重启控制软件恢复拍照,
-            <LineBreak/>
-            请注意当前数据保存!
-        </TextBlock>
-        <StackPanel Margin="0 20 0 0" HorizontalAlignment="Center" Orientation="Horizontal">
-
-            <Button x:Name="_button" Width="100" Height="80" FontSize="30" Margin="20 20 60 20"
-                    Click="Button_Click" Content="取消"
-                    HorizontalAlignment="Center" VerticalAlignment="Bottom"/>
-
-            <Button Width="180" Height="80" FontSize="30" Margin="60 20 20 20"
-                    Click="Button_Click1" Content="立即重启"
-                    HorizontalAlignment="Center" VerticalAlignment="Bottom"/>
-        </StackPanel>
-    </StackPanel>
-</Window>

+ 0 - 81
ivf_tl_operate_2.0/control/ivf_tl_ControlTest/StopWindow.xaml.cs

@@ -1,81 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Linq;
-using System.Text;
-using System.Threading;
-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_ControlMain
-{
-    /// <summary>
-    /// StopWindow.xaml 的交互逻辑
-    /// </summary>
-    public partial class StopWindow : Window
-    {
-        public StopWindow(Window w,int val)
-        {
-            InitializeComponent();
-            MyProperty = val;
-            Task.Run(() =>
-            {
-                bool stop = false;
-                try
-                {
-                    while (true)
-                    {
-                        Dispatcher.Invoke(() =>
-                        {
-                            if (MyProperty <= 0)
-                            {
-                                Application.Current.Shutdown();
-                                stop = true;
-                            }
-                            MyProperty--;
-                            //Debug.WriteLine(MyProperty);
-                        });
-                        if (stop)
-                        {
-                            return;
-                        }
-                        Thread.Sleep(999);
-                    }
-                }
-                catch (Exception ex) 
-                {
-                    string sss = ex.Message;
-                }
-            });
-        }
-
-
-
-        public int MyProperty
-        {
-            get { return (int)GetValue(MyPropertyProperty); }
-            set { SetValue(MyPropertyProperty, value); }
-        }
-
-        // Using a DependencyProperty as the backing store for MyProperty.  This enables animation, styling, binding, etc...
-        public static readonly DependencyProperty MyPropertyProperty =
-            DependencyProperty.Register("MyProperty", typeof(int), typeof(StopWindow), new PropertyMetadata(15));
-
-        private void Button_Click(object sender, RoutedEventArgs e)
-        {
-            this.Close();
-        }
-
-        private void Button_Click1(object sender, RoutedEventArgs e)
-        {
-            Application.Current.Shutdown();
-        }
-    }
-}

+ 0 - 43
ivf_tl_operate_2.0/control/ivf_tl_ControlTest/Window1.xaml

@@ -1,43 +0,0 @@
-<Window x:Class="ivf_tl_ControlTest.Window1"
-        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_ControlTest"
-        mc:Ignorable="d"
-        Title="{DynamicResource D0006}" Height="450" Width="800">
-    <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
-        <TextBlock FontSize="40" Text="{DynamicResource D0005}" FontWeight="Bold" Foreground="Red" 
-                   HorizontalAlignment="Center" VerticalAlignment="Center"/>
-        <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="10">
-            <TextBlock Width="133" TextAlignment="Right"  FontSize="24" Text="{DynamicResource D0001}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
-            <TextBox x:Name="_account_TextBox" FontSize="24" Width="200" Text=""/>
-        </StackPanel>
-
-        <StackPanel Orientation="Horizontal" HorizontalAlignment="Center"  Margin="10">
-            <TextBlock Width="133" TextAlignment="Right" FontSize="24" Text="{DynamicResource D0002}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
-            <PasswordBox x:Name="_password_TextBox" FontSize="24" Width="200" />
-        </StackPanel>
-        <StackPanel  Orientation="Horizontal" HorizontalAlignment="Center">
-            <!--<Button x:Name="_butto1n" Width="130" Height="80" FontSize="30" Margin=" 20"
-                Click="Button1_Click" Content="断开mq" Visibility="Visible"
-                HorizontalAlignment="Center" VerticalAlignment="Bottom"/>
-
-            <Button  Width="130" Height="80" FontSize="30" Margin=" 20"
-     Click="Button2_Click" Content="连接mq" Visibility="Visible"
-     HorizontalAlignment="Center" VerticalAlignment="Bottom"/>-->
-
-            <Button x:Name="_button" Width="100" Height="80" FontSize="30" Margin=" 20"
-                Click="Button_Click" Content="{DynamicResource D0003}"
-                HorizontalAlignment="Center" VerticalAlignment="Bottom"/>
-
-            <Button x:Name="_button1" IsEnabled="False" Width="100" Height="80" FontSize="30" Margin="20"
-                Click="End_Click" Content="{DynamicResource D0004}"
-                HorizontalAlignment="Center" VerticalAlignment="Bottom"/>
-
-            <Button Width="150" Height="80" FontSize="30" Margin="20" Visibility="Collapsed"
-                Click="End_1Click" Content="重启电脑"
-                HorizontalAlignment="Center" VerticalAlignment="Bottom"/>
-        </StackPanel>
-    </StackPanel>
-</Window>

+ 0 - 328
ivf_tl_operate_2.0/control/ivf_tl_ControlTest/Window1.xaml.cs

@@ -1,328 +0,0 @@
-using ivf_tl_Control;
-using ivf_tl_ControlMain;
-using IvfTl.Control.Entity.GlobalEnums;
-using IvfTl.Control.Services;
-using ivf_tl_UtilHelper;
-using System;
-using System.ComponentModel;
-using System.Configuration;
-using System.IO;
-using System.Threading.Tasks;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Media.Imaging;
-using System.Xml;
-
-namespace ivf_tl_ControlTest
-{
-    /// <summary>
-    /// Window1.xaml 的交互逻辑
-    /// </summary>
-    public partial class Window1 : Window
-    {
-        bool stop = false;
-        int stopPro = 15;
-        public Window1()
-        {
-            InitializeComponent();
-
-            if (int.TryParse(ConfigurationManager.AppSettings["StopPro"].ToString(), out int newTime12)) stopPro = newTime12;
-
-            AppData.Instance.StopProEvent += Instance_StopProEvent;
-
-            string mvcFileName = @"C:\Windows\System32\MVCCamera.ini";
-            if (File.Exists(mvcFileName)) File.Delete(mvcFileName);
-            Loaded += Window1_Loaded1;
-            //Closed += Window1_Closed;
-            //Closing += Window1_Closing;
-        }
-
-        private void Window1_Closing(object? sender, CancelEventArgs e)
-        {
-            Log4netHelper.WriteLog("Window1_Closing");
-           
-        }
-
-        private void Window1_Closed(object? sender, EventArgs e)
-        {
-            Log4netHelper.WriteLog("窗口关闭");
-        }
-
-        private void Window1_Loaded1(object sender, RoutedEventArgs e)
-        {
-            string account = ConfigurationManager.AppSettings["userName"].ToString();
-            string password = ConfigurationManager.AppSettings["passWord"].ToString();
-            string cacheDisk = ConfigurationManager.AppSettings["cacheDisk"].ToString();
-            this._account_TextBox.Text = account;
-            this._password_TextBox.Password = password;
-            this._button.IsEnabled = false;
-            this._button1.IsEnabled = true;
-            Task.Run(() =>
-            {
-                if (string.IsNullOrEmpty(account) || string.IsNullOrEmpty(password))
-                {
-                    AppData.Instance.LogService.TLLog($"请输入账号或密码", LogEnum.RunRecord);
-                    Environment.Exit(0);
-                    return;
-                }
-                if (!AppData.Instance.Login(account, password))
-                {
-                    AppData.Instance.LogService.TLLog($"登录失败", LogEnum.RunRecord);
-                    Environment.Exit(0);
-                    return;
-                }
-                PathHelper.pan = cacheDisk;
-                AppData.Instance.LogService.Pan = cacheDisk;
-                SetApp1(account, password);
-                StartMain startMain = new StartMain();
-                string ss = startMain.StartRun();
-                if (!string.IsNullOrEmpty(ss))
-                {
-                    AppData.Instance.LogService.TLLog($"启动失败:{ss}", LogEnum.RunRecord);
-                    Environment.Exit(0);
-                    return;
-                }
-                SetApp1(AppData.Instance.TLSetting.tmpDir);
-            });
-        }
-
-        private void Window1_Loaded(object sender, RoutedEventArgs e)
-        {
-            this._account_TextBox.Text = ConfigurationManager.AppSettings["userName"].ToString();
-            this._password_TextBox.Password = ConfigurationManager.AppSettings["passWord"].ToString();
-        }
-
-        //[DllImport("user32.dll", SetLastError = true)]
-        //static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
-
-        //[DllImport("user32.dll", CharSet = CharSet.Auto)]
-        //static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
-
-        //delegate bool EnumWindowsProc(IntPtr hWnd, IntPtr lParam);
-        //[DllImport("user32.dll")]
-        //static extern bool EnumChildWindows(IntPtr hWndParent, EnumWindowsProc lpEnumFunc, IntPtr lParam);
-        //[DllImport("user32.dll")]
-        //static extern int GetClassName(IntPtr hWnd, StringBuilder lpClassName, int nMaxCount);
-        //[DllImport("user32.dll", CharSet = CharSet.Auto)]
-        //static extern int GetWindowText(IntPtr hWnd, StringBuilder lpString, int nMaxCount);
-
-        //const uint WM_CLOSE = 0x0010;
-        //const uint BM_CLICK = 0x00F5;
-
-        /// <summary>
-        /// 开始按钮
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void Button_Click(object sender, RoutedEventArgs e)
-        {
-            //AppData.Instance.TestEvent();
-            //return;
-
-            //var aaa = MessageBoxResult.Cancel;
-            //var dialogTask = Task.Run(() =>
-            //{
-            //    aaa = MessageBox.Show("messageinfo", "提示", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No, MessageBoxOptions.DefaultDesktopOnly);
-            //    Debug.WriteLine(1);
-            //});
-
-            //Task.Delay(3000).ContinueWith(t =>
-            //{
-            //    if (!dialogTask.IsCompleted)
-            //    {
-            //        IntPtr hWnd = FindWindow("#32770", "提示");
-            //        if (hWnd != IntPtr.Zero)
-            //        {
-            //            EnumChildWindows(hWnd, (childHwnd, lParam) =>
-            //            {
-            //                StringBuilder className = new StringBuilder(256);
-            //                GetClassName(childHwnd, className, className.Capacity);
-            //                if (className.ToString() == "Button")
-            //                {
-            //                    StringBuilder text = new StringBuilder(256);
-            //                    GetWindowText(childHwnd, text, text.Capacity);
-            //                    if (text.ToString().Contains("Y"))
-            //                    {
-            //                        SendMessage(childHwnd, BM_CLICK, IntPtr.Zero, IntPtr.Zero);
-            //                        return false;
-            //                    }
-            //                }
-            //                return true;
-            //            }, IntPtr.Zero);
-            //        }
-            //        Debug.WriteLine(2);
-            //    }
-            //});
-            //dialogTask.Wait();
-            //Debug.WriteLine(aaa);
-            //return;
-            string account = this._account_TextBox.Text.Trim();
-            string password = this._password_TextBox.Password.Trim();
-            if (string.IsNullOrEmpty(account) || string.IsNullOrEmpty(password))
-            {
-                MessageBox.Show("请输入账号或密码");
-                return;
-            }
-            if (!AppData.Instance.Login(account, password))
-            {
-                MessageBox.Show("登录失败");
-                return;
-            }
-            SetApp1(account, password);
-            //var aa = AppData.Instance.SerialBinController.SearchPictureController("3_1_7_69_2023-09-28-22-41-41_71900_75000.jpg", "NEO-1-20230107");
-            StartMain startMain = new StartMain();
-            MessageBox.Show(startMain.StartRun());
-            this._button.IsEnabled = false;
-            this._button1.IsEnabled = true;
-        }
-        private object lockObject = new object();
-        private void Instance_StopProEvent()
-        {
-            return;
-            AppData.Instance.LogService.TLLog($"拍照异常退出软件", LogEnum.RunError);
-            lock (lockObject)
-            {
-                if (stop) return;
-                stop = true;
-            }
-            Dispatcher.Invoke(() =>
-            {
-                StopWindow stopWindow = new StopWindow(this, stopPro);
-                stopWindow.Show();
-            });
-        }
-
-        private void SetApp(string name, string pass)
-        {
-            Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
-            config.AppSettings.Settings["userName"].Value = name;
-            config.AppSettings.Settings["passWord"].Value = pass;
-            config.Save(ConfigurationSaveMode.Modified);
-            System.Configuration.ConfigurationManager.RefreshSection("appSettings");
-        }
-        public void SetApp1(string name, string pass)
-        {
-            try
-            {
-                string fileName = $"{System.AppDomain.CurrentDomain.BaseDirectory}ivf_tl_ControlMain.dll.config";
-                if (!File.Exists(fileName)) return;
-                var xmlDoc = new XmlDocument();
-                xmlDoc.Load(fileName);
-                var tags = xmlDoc.GetElementsByTagName("appSettings");
-                XmlNode appSettingsNode = xmlDoc.SelectSingleNode("configuration/appSettings");
-                if (appSettingsNode != null)
-                {
-                    XmlNodeList addNodes = appSettingsNode.SelectNodes("add");
-                    foreach (XmlNode addNode in addNodes)
-                    {
-                        //string key = addNode.Attributes["key"].Value;
-                        //string value = addNode.Attributes["value"].Value;
-                        //Debug.WriteLine("键: " + key + ", 值: " + value);
-                        if (addNode.Attributes["key"].Value == "userName")
-                        {
-                            addNode.Attributes["value"].Value = name;
-                        }
-                        if (addNode.Attributes["key"].Value == "passWord")
-                        {
-                            addNode.Attributes["value"].Value = pass;
-                        }
-                    }
-                }
-                xmlDoc.Save(fileName);
-                System.Configuration.ConfigurationManager.RefreshSection("appSettings");
-                xmlDoc = null;
-            }
-            catch (Exception ex)
-            {
-                return;
-            }
-        }
-        private void SetApp(string newDisk)
-        {
-            Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
-            config.AppSettings.Settings["cacheDisk"].Value = newDisk;
-            config.Save(ConfigurationSaveMode.Modified);
-            System.Configuration.ConfigurationManager.RefreshSection("appSettings");
-        }
-        public void SetApp1(string newDisk)
-        {
-            try
-            {
-                string fileName = $"{System.AppDomain.CurrentDomain.BaseDirectory}ivf_tl_ControlMain.dll.config";
-                if (!File.Exists(fileName)) return;
-                var xmlDoc = new XmlDocument();
-                xmlDoc.Load(fileName);
-                var tags = xmlDoc.GetElementsByTagName("appSettings");
-                XmlNode appSettingsNode = xmlDoc.SelectSingleNode("configuration/appSettings");
-                if (appSettingsNode != null)
-                {
-                    XmlNodeList addNodes = appSettingsNode.SelectNodes("add");
-                    foreach (XmlNode addNode in addNodes)
-                    {
-                        //string key = addNode.Attributes["key"].Value;
-                        //string value = addNode.Attributes["value"].Value;
-                        //Debug.WriteLine("键: " + key + ", 值: " + value);
-                        if (addNode.Attributes["key"].Value == "cacheDisk")
-                        {
-                            addNode.Attributes["value"].Value = newDisk;
-                            break;
-                        }
-                    }
-                }
-                xmlDoc.Save(fileName);
-                System.Configuration.ConfigurationManager.RefreshSection("appSettings");
-                xmlDoc = null;
-            }
-            catch (Exception ex)
-            {
-                return;
-            }
-        }
-
-        private void End_Click(object sender, RoutedEventArgs e)
-        {
-            //Log4netHelper.WriteLog("点击退出按钮");
-            //Application.Current.Shutdown();
-            //e.Handled = true;
-            //return;
-
-            Log4netHelper.WriteLog("点击退出按钮");
-            AppData.Instance.SerialBinController.PushMessageController(AppData.Instance.TLSetting.tlSn, 0, null);
-            Application.Current.Shutdown();
-            e.Handled = true;
-        }
-
-        private void Button1_Click(object sender, RoutedEventArgs e)
-        {
-            if (AppData.Instance.MqttService != null)
-            {
-                AppData.Instance.MqttService.DisconnectAsync();
-            }
-            //string account = this._account_TextBox.Text.Trim();
-            //string password = this._password_TextBox.Password.Trim();
-            //if (string.IsNullOrEmpty(account) || string.IsNullOrEmpty(password))
-            //{
-            //    MessageBox.Show("请输入账号或密码");
-            //    return;
-            //}
-            //if (!AppData.Instance.Login(account, password))
-            //{
-            //    MessageBox.Show("登录失败");
-            //    return;
-            //}
-            //AppData.Instance.UpdateSetting("NEO-1-20230107");
-        }
-        private void Button2_Click(object sender, RoutedEventArgs e)
-        {
-            if (AppData.Instance.MqttService != null)
-            {
-                AppData.Instance.MqttService.ClientMqtt();
-            }
-        }
-
-        private void End_1Click(object sender, RoutedEventArgs e)
-        {
-            System.Diagnostics.Process.Start("shutdown", " /r /t 0");
-        }
-    }
-}

+ 0 - 79
ivf_tl_operate_2.0/control/ivf_tl_ControlTest/app.manifest

@@ -1,79 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
-  <assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
-  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
-    <security>
-      <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
-        <!-- UAC 清单选项
-             如果想要更改 Windows 用户帐户控制级别,请使用
-             以下节点之一替换 requestedExecutionLevel 节点。
-
-        <requestedExecutionLevel  level="asInvoker" uiAccess="false" />
-        <requestedExecutionLevel  level="requireAdministrator" uiAccess="false" />
-        <requestedExecutionLevel  level="highestAvailable" uiAccess="false" />
-
-            指定 requestedExecutionLevel 元素将禁用文件和注册表虚拟化。
-            如果你的应用程序需要此虚拟化来实现向后兼容性,则移除此
-            元素。
-        -->
-        <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
-      </requestedPrivileges>
-    </security>
-  </trustInfo>
-
-  <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
-    <application>
-      <!-- 设计此应用程序与其一起工作且已针对此应用程序进行测试的
-           Windows 版本的列表。取消评论适当的元素,
-           Windows 将自动选择最兼容的环境。 -->
-
-      <!-- Windows Vista -->
-      <!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
-
-      <!-- Windows 7 -->
-      <!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
-
-      <!-- Windows 8 -->
-      <!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
-
-      <!-- Windows 8.1 -->
-      <!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
-
-      <!-- Windows 10 -->
-      <!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->
-
-    </application>
-  </compatibility>
-
-  <!-- 指示该应用程序可感知 DPI 且 Windows 在 DPI 较高时将不会对其进行
-       自动缩放。Windows Presentation Foundation (WPF)应用程序自动感知 DPI,无需
-       选择加入。选择加入此设置的 Windows 窗体应用程序(面向 .NET Framework 4.6)还应
-       在其 app.config 中将 "EnableWindowsFormsHighDpiAutoResizing" 设置设置为 "true"。
-       
-       将应用程序设为感知长路径。请参阅 https://docs.microsoft.com/windows/win32/fileio/maximum-file-path-limitation -->
-  <!--
-  <application xmlns="urn:schemas-microsoft-com:asm.v3">
-    <windowsSettings>
-      <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
-      <longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
-    </windowsSettings>
-  </application>
-  -->
-
-  <!-- 启用 Windows 公共控件和对话框的主题(Windows XP 和更高版本) -->
-  <!--
-  <dependency>
-    <dependentAssembly>
-      <assemblyIdentity
-          type="win32"
-          name="Microsoft.Windows.Common-Controls"
-          version="6.0.0.0"
-          processorArchitecture="*"
-          publicKeyToken="6595b64144ccf1df"
-          language="*"
-        />
-    </dependentAssembly>
-  </dependency>
-  -->
-
-</assembly>

+ 0 - 29
ivf_tl_operate_2.0/control/ivf_tl_ControlTest/ivf_tl_ControlMain.csproj

@@ -1,29 +0,0 @@
-<Project Sdk="Microsoft.NET.Sdk">
-
-  <PropertyGroup>
-    <OutputType>WinExe</OutputType>
-    <TargetFramework>net6.0-windows</TargetFramework>
-    <Nullable>enable</Nullable>
-    <UseWPF>true</UseWPF>
-    <Platforms>AnyCPU;x64</Platforms>
-    <ApplicationManifest>app.manifest</ApplicationManifest>
-    <ApplicationIcon>1.ico</ApplicationIcon>
-  </PropertyGroup>
-
-  <ItemGroup>
-    <None Remove="1.ico" />
-  </ItemGroup>
-
-  <ItemGroup>
-    <Content Include="1.ico" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\ivf_tl_Control\ivf_tl_Control.csproj" />
-    <ProjectReference Include="..\ivf_tl_ServicesImpl\ivf_tl_ServicesImpl.csproj" />
-  </ItemGroup>
-  <ItemGroup>
-    <Resource Include="1.ico">
-      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
-    </Resource>
-  </ItemGroup>
-</Project>