示例#1
0
        public List <TestPointImageEntity> GetTestPointImagesByModuleSubAuto(string moduleList)
        {
            List <TestPointImageEntity> resultList = new List <TestPointImageEntity>();
            var moduleArray = moduleList.Split(',');
            List <DAL.COMPART_TOOL_IMAGE> resultListRaw = new List <DAL.COMPART_TOOL_IMAGE>();

            foreach (var s in moduleArray)
            {
                int moduleId = 0;
                Int32.TryParse(s, out moduleId);
                if (moduleId == 0)
                {
                    continue;
                }
                BLL.Core.Domain.LuModuleSub LogicalEquipment = new BLL.Core.Domain.LuModuleSub(new DAL.UndercarriageContext());
                var k = LogicalEquipment.GetEquipmentCompartToolImageListByModuleSubAuto(moduleId);
                resultListRaw.AddRange(k);
            }
            resultListRaw = resultListRaw.GroupBy(m => m.Id).Select(m => m.First()).ToList();
            foreach (var img in resultListRaw)
            {
                TestPointImageEntity ent = new TestPointImageEntity();
                ent.CompartType    = img.CompartId;
                ent.TestPointImage = img.ImageData;
                ent.Tool           = img.Tool.tool_code;
                resultList.Add(ent);
            }
            return(resultList);
        }
示例#2
0
        public List <LimitsEntity> GetEquipmentLimitsByCompartIdAuto(string compartIdAutoList)
        {
            List <LimitsEntity> resultList = new List <LimitsEntity>();
            var compartIdAutoArray         = compartIdAutoList.Split(',');

            List <BLL.Core.Domain.CompartWornExtViewModel> modelList = new List <BLL.Core.Domain.CompartWornExtViewModel>();

            foreach (var compartIdAuto in compartIdAutoArray)
            {
                int compartAuto = 0;
                Int32.TryParse(compartIdAuto, out compartAuto);
                if (compartAuto == 0)
                {
                    continue;
                }
                BLL.Core.Domain.LuModuleSub LogicalEquipment = new BLL.Core.Domain.LuModuleSub(new DAL.UndercarriageContext());
                modelList.AddRange(LogicalEquipment.getWornLimitListByCompartIdAuto(compartAuto));
            }
            foreach (var model in modelList)
            {
                int max = 0;
                if (model.ITMExtList != null && model.ITMExtList.Count > max)
                {
                    max = model.ITMExtList.Count;
                }
                if (model.CATExtList != null && model.CATExtList.Count > max)
                {
                    max = model.CATExtList.Count;
                }
                if (model.KomatsuExtList != null && model.KomatsuExtList.Count > max)
                {
                    max = model.KomatsuExtList.Count;
                }
                if (model.HitachiExtList != null && model.HitachiExtList.Count > max)
                {
                    max = model.HitachiExtList.Count;
                }
                if (model.LiebherrExtList != null && model.LiebherrExtList.Count > max)
                {
                    max = model.LiebherrExtList.Count;
                }

                for (int k = 0; k < max; k++)
                {
                    bool ITM      = model.ITMExtList != null && model.ITMExtList.Count > k ? true : false;
                    bool CAT      = model.CATExtList != null && model.CATExtList.Count > k ? true : false;
                    bool Komatsu  = model.KomatsuExtList != null && model.KomatsuExtList.Count > k ? true : false;
                    bool Hitachi  = model.HitachiExtList != null && model.HitachiExtList.Count > k ? true : false;
                    bool Liebherr = model.LiebherrExtList != null && model.LiebherrExtList.Count > k ? true : false;

                    var res = new LimitsEntity
                    {
                        CompartIdAuto = model.Id,
                        Method        = getMethodById((int)model.method)
                    };
                    if (ITM)
                    {
                        res.ITMTool             = GetToolCode(model.ITMExtList.ElementAt(k).track_tools_auto);
                        res.StartDepthNew       = model.ITMExtList.ElementAt(k).start_depth_new;
                        res.WearDepth10Percent  = model.ITMExtList.ElementAt(k).wear_depth_10_percent;
                        res.WearDepth20Percent  = model.ITMExtList.ElementAt(k).wear_depth_20_percent;
                        res.WearDepth30Percent  = model.ITMExtList.ElementAt(k).wear_depth_30_percent;
                        res.WearDepth40Percent  = model.ITMExtList.ElementAt(k).wear_depth_40_percent;
                        res.WearDepth50Percent  = model.ITMExtList.ElementAt(k).wear_depth_50_percent;
                        res.WearDepth60Percent  = model.ITMExtList.ElementAt(k).wear_depth_60_percent;
                        res.WearDepth70Percent  = model.ITMExtList.ElementAt(k).wear_depth_70_percent;
                        res.WearDepth80Percent  = model.ITMExtList.ElementAt(k).wear_depth_80_percent;
                        res.WearDepth90Percent  = model.ITMExtList.ElementAt(k).wear_depth_90_percent;
                        res.WearDepth100Percent = model.ITMExtList.ElementAt(k).wear_depth_100_percent;
                        res.WearDepth110Percent = model.ITMExtList.ElementAt(k).wear_depth_110_percent;
                        res.WearDepth120Percent = model.ITMExtList.ElementAt(k).wear_depth_120_percent;
                    }
                    if (CAT)
                    {
                        res.CATTool           = GetToolCode(model.CATExtList.ElementAt(k).track_tools_auto);
                        res.Slope             = model.CATExtList.ElementAt(k).slope;
                        res.AdjToBase         = model.CATExtList.ElementAt(k).adjust_base;
                        res.HiInflectionPoint = model.CATExtList.ElementAt(k).hi_inflectionPoint;
                        res.HiSlope1          = model.CATExtList.ElementAt(k).hi_slope1;
                        res.HiIntercept1      = model.CATExtList.ElementAt(k).hi_intercept1;
                        res.HiSlope2          = model.CATExtList.ElementAt(k).hi_slope2;
                        res.HiIntercept2      = model.CATExtList.ElementAt(k).hi_intercept2;
                        res.MiInflectionPoint = model.CATExtList.ElementAt(k).mi_inflectionPoint;
                        res.MiSlope1          = model.CATExtList.ElementAt(k).mi_slope1;
                        res.MiIntercept1      = model.CATExtList.ElementAt(k).mi_intercept1;
                        res.MiSlope2          = model.CATExtList.ElementAt(k).mi_slope2;
                        res.MiIntercept2      = model.CATExtList.ElementAt(k).mi_intercept2;
                    }
                    if (Komatsu)
                    {
                        res.KomatsuTool       = GetToolCode(model.KomatsuExtList.ElementAt(k).track_tools_auto);
                        res.ImpactSecondOrder = model.KomatsuExtList.ElementAt(k).impact_secondorder;
                        res.NormalSecondOrder = model.KomatsuExtList.ElementAt(k).normal_secondorder;
                        res.ImpactSlope       = model.KomatsuExtList.ElementAt(k).impact_slope;
                        res.ImpactIntercept   = model.KomatsuExtList.ElementAt(k).impact_intercept;
                        res.NormalSlope       = model.KomatsuExtList.ElementAt(k).normal_slope;
                        res.NormalIntercept   = model.KomatsuExtList.ElementAt(k).normal_intercept;
                    }

                    if (Hitachi)
                    {
                        res.HitachiTool        = GetToolCode(model.HitachiExtList.ElementAt(k).track_tools_auto);
                        res.ImpactSlopeHit     = model.HitachiExtList.ElementAt(k).impact_slope;
                        res.ImpactInterceptHit = model.HitachiExtList.ElementAt(k).impact_intercept;
                        res.NormalSlopeHit     = model.HitachiExtList.ElementAt(k).normal_slope;
                        res.NormalInterceptHit = model.HitachiExtList.ElementAt(k).normal_intercept;
                    }
                    if (Liebherr)
                    {
                        res.LiebherrTool       = GetToolCode(model.LiebherrExtList.ElementAt(k).track_tools_auto);
                        res.ImpactSlopeLie     = model.LiebherrExtList.ElementAt(k).impact_slope;
                        res.ImpactInterceptLie = model.LiebherrExtList.ElementAt(k).impact_intercept;
                        res.NormalSlopeLie     = model.LiebherrExtList.ElementAt(k).normal_slope;
                        res.NormalInterceptLie = model.LiebherrExtList.ElementAt(k).normal_intercept;
                    }
                    resultList.Add(res);
                }
            }
            return(resultList);
        }