using CCDCount.MODEL.ConfigModel; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CCDCount.DLL { public static class FormulationClass { /// /// 初始化配方数据 /// /// /// /// public static FormulationConfigClass InitFormulation(CameraConfig cameraConfig, ShuLiConfigClass shuLiConfig) { return new FormulationConfigClass() { Channel = shuLiConfig.Channel, ExposureTimeValue = cameraConfig.ExposureTimeValue, AcquistionLineRateValue = cameraConfig.AcquistionLineRateValue, DeviceName = cameraConfig.DeviceName, FormulationName = string.Empty, //IdentifyStartX = shuLiConfig.IdentifyStartX, //IdentifyStopX = shuLiConfig.IdentifyStopX, //IsIdentifyRoiOpen = shuLiConfig.IsIdentifyRoiOpen, MaxArea = shuLiConfig.MaxArea, MinArea = shuLiConfig.MinArea, NoiseFilter_Threshold = shuLiConfig.NoiseFilter_Threshold, PandingCode = shuLiConfig.PandingCode, RegionThreshold = shuLiConfig.RegionThreshold, MAX_GAP = shuLiConfig.MAX_GAP, MAX_Object_LENGTH = shuLiConfig.MAX_Object_LENGTH, MIN_Object_LENGTH = shuLiConfig.MIN_Object_LENGTH }; } /// /// 更新配方数据 /// /// /// /// public static void UpdateFormulation(ref FormulationConfigClass formulationConfig,CameraConfig cameraConfig, ShuLiConfigClass shuLiConfig) { formulationConfig.Channel = shuLiConfig.Channel; formulationConfig.ExposureTimeValue = cameraConfig.ExposureTimeValue; formulationConfig.AcquistionLineRateValue = cameraConfig.AcquistionLineRateValue; formulationConfig.DeviceName = cameraConfig.DeviceName; //formulationConfig.IdentifyStartX = shuLiConfig.IdentifyStartX; //formulationConfig.IdentifyStopX = shuLiConfig.IdentifyStopX; //formulationConfig.IsIdentifyRoiOpen = shuLiConfig.IsIdentifyRoiOpen; formulationConfig.MaxArea = shuLiConfig.MaxArea; formulationConfig.MinArea = shuLiConfig.MinArea; formulationConfig.NoiseFilter_Threshold = shuLiConfig.NoiseFilter_Threshold; formulationConfig.PandingCode = shuLiConfig.PandingCode; formulationConfig.RegionThreshold = shuLiConfig.RegionThreshold; formulationConfig.MAX_GAP = shuLiConfig.MAX_GAP; formulationConfig.MAX_Object_LENGTH = shuLiConfig.MAX_Object_LENGTH; formulationConfig.MIN_Object_LENGTH = shuLiConfig.MIN_Object_LENGTH; } } }