| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- using CCDCount.MODEL.ConfigModel;
- using CCDCount.MODEL.PlcModel;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace CCDCount.DLL
- {
- public static class FormulationClass
- {
- /// <summary>
- /// 初始化配方数据
- /// </summary>
- /// <param name="cameraConfig"></param>
- /// <param name="shuLiConfig"></param>
- /// <returns></returns>
- public static FormulationConfigClass InitFormulation(CameraConfig cameraConfig, ShuLiConfigClass shuLiConfig, PlcParaModelClass plcParaModel)
- {
- var result = 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,
- ScaleX = shuLiConfig.ScaleX,
- ScaleY = shuLiConfig.ScaleY,
- };
- if(plcParaModel != null)
- {
- result.FillingMode = plcParaModel.FillingMode;
- result.BeltsSpeed = plcParaModel.BeltsSpeed;
- result.ShakeTable1H_FillingSpeed = plcParaModel.ShakeTable1H_FillingSpeed;
- result.ShakeTable2H_FillingSpeed = plcParaModel.ShakeTable2H_FillingSpeed;
- result.ShakeTable3H_FillingSpeed = plcParaModel.ShakeTable3H_FillingSpeed;
- result.ShakeTable1M_FillingSpeed = plcParaModel.ShakeTable1M_FillingSpeed;
- result.ShakeTable2M_FillingSpeed = plcParaModel.ShakeTable2M_FillingSpeed;
- result.ShakeTable3M_FillingSpeed = plcParaModel.ShakeTable3M_FillingSpeed;
- result.ShakeTable1L_FillingSpeed = plcParaModel.ShakeTable1L_FillingSpeed;
- result.ShakeTable2L_FillingSpeed = plcParaModel.ShakeTable2L_FillingSpeed;
- result.ShakeTable3L_FillingSpeed = plcParaModel.ShakeTable3L_FillingSpeed;
- result.ShakeTable1H_CacheSpeed = plcParaModel.ShakeTable1H_CacheSpeed;
- result.ShakeTable2H_CacheSpeed = plcParaModel.ShakeTable2H_CacheSpeed;
- result.ShakeTable3H_CacheSpeed = plcParaModel.ShakeTable3H_CacheSpeed;
- result.ShakeTable1M_CacheSpeed = plcParaModel.ShakeTable1M_CacheSpeed;
- result.ShakeTable2M_CacheSpeed = plcParaModel.ShakeTable2M_CacheSpeed;
- result.ShakeTable3M_CacheSpeed = plcParaModel.ShakeTable3M_CacheSpeed;
- result.ShakeTable1L_CacheSpeed = plcParaModel.ShakeTable1L_CacheSpeed;
- result.ShakeTable2L_CacheSpeed = plcParaModel.ShakeTable2L_CacheSpeed;
- result.ShakeTable3L_CacheSpeed = plcParaModel.ShakeTable3L_CacheSpeed;
- result.FillingH_SpeedRatio = plcParaModel.FillingH_SpeedRatio;
- result.FillingM_SpeedRatio = plcParaModel.FillingM_SpeedRatio;
- result.FillingL_SpeedRatio = plcParaModel.FillingL_SpeedRatio;
- result.CacheH_SpeedRatio = plcParaModel.CacheH_SpeedRatio;
- result.CacheM_SpeedRatio = plcParaModel.CacheM_SpeedRatio;
- result.CacheL_SpeedRatio = plcParaModel.CacheL_SpeedRatio;
- result.ScrewJogSpeed = plcParaModel.ScrewJogSpeed;
- result.InBottleSpeed = plcParaModel.InBottleSpeed;
- result.BottlePosSpeed = plcParaModel.BottlePosSpeed;
- result.BottlePosPosition = plcParaModel.BottlePosPosition;
- result.FillingValveOpenSpeed = plcParaModel.FillingValveOpenSpeed;
- result.FillingValveOpenPosition = plcParaModel.FillingValveOpenPosition;
- result.FillingValveCloseSpeed = plcParaModel.FillingValveCloseSpeed;
- result.FillingValveClosePosition = plcParaModel.FillingValveClosePosition;
- result.FillingValveCacheSpeed = plcParaModel.FillingValveCacheSpeed;
- result.FillingValueCachePosition = plcParaModel.FillingValueCachePosition;
- result.FillingValueJogSpeed = plcParaModel.FillingValueJogSpeed;
- result.MachineDelayFunneDownTime = plcParaModel.MachineDelayFunneDownTime;
- result.MachineDelayFunneUpTime = plcParaModel.MachineDelayFunneUpTime;
- result.MachineDelayFillingValveOpenTime = plcParaModel.MachineDelayFillingValveOpenTime;
- result.MachineDelayFillingValveCloseTime = plcParaModel.MachineDelayFillingValveCloseTime;
- result.MachineDelayInBottleTime = plcParaModel.MachineDelayInBottleTime;
- result.ValveDelytime = plcParaModel.ValveDelytime;
- result.BottValueSet = plcParaModel.BottValueSet;
- result.CacheShutdownValue = plcParaModel.CacheShutdownValue;
- }
- else
- {
- result = null;
- }
- return result;
- }
- /// <summary>
- /// 更新配方数据
- /// </summary>
- /// <param name="formulationConfig"></param>
- /// <param name="cameraConfig"></param>
- /// <param name="shuLiConfig"></param>
- 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;
- formulationConfig.ScaleX = shuLiConfig.ScaleX;
- formulationConfig.ScaleY = shuLiConfig.ScaleY;
- }
- }
- }
|