/// <summary>
        /// ќбновл¤ет информацию
        /// </summary>
        public void UpdateInformation()
        {
            BaseDetailDirective[] directives;
            directives = baseDetail.ContainedDirectives;
            List <BaseDetailDirective> ADDirectives = new List <BaseDetailDirective>();
            List <BaseDetailDirective> engineeringOrdersDirectives = new List <BaseDetailDirective>();
            List <BaseDetailDirective> SBStatusDirectives          = new List <BaseDetailDirective>();

            for (int i = 0; i < directives.Length; i++)
            {
                switch (directives[i].DirectiveType.ID)
                {
                case (int)DirectiveTypeID.ADDirectiveTypeID:
                    ADDirectives.Add(directives[i]);
                    break;

                case (int)DirectiveTypeID.EngeneeringOrdersDirectiveTypeID:
                    engineeringOrdersDirectives.Add(directives[i]);
                    break;

                case (int)DirectiveTypeID.SBDirectiveTypeID:
                    SBStatusDirectives.Add(directives[i]);
                    break;
                }
            }
            linkADStatus.Status          = GetStatus(ADDirectives);
            linkDiscrepancies.Status     = (Statuses)baseDetail.ConditionState;
            linkEngineeringOrders.Status = GetStatus(engineeringOrdersDirectives);
            DetailCollectionFilter filter = new DetailCollectionFilter(baseDetail.ContainedDetails, new DetailFilter[] { new LLPFilter() });

            linkLLPDiskSheetStatus.Status = GetStatus(filter.GatherDetails());
            linkSBStatus.Status           = GetStatus(SBStatusDirectives);
        }
Beispiel #2
0
        /// <summary>
        /// Выборка агрегатов с отклонениями
        /// </summary>
        /// <returns></returns>
        public Detail[] GatherDetails()
        {
            List <DetailFilter> filters = new List <DetailFilter>();

/*
 *          if (discrepanciesFilter != null)
 *              filters.Add(new DetailLimitationFilter(discrepanciesFilter));todo
 */
            if (additionalFilter != null)
            {
                filters.AddRange(additionalFilter.Filters);
            }
            if (detailSource == null)
            {
                count = 0;
                return(new Detail[0]);
            }

            IDetail[]     idetails = detailSource.ContainedDetails;
            List <Detail> details  = new List <Detail>(idetails.Length);

            for (int i = 0; i < idetails.Length; i++)
            {
                if (idetails[i] is Detail)
                {
                    details.Add(idetails[i] as Detail);
                }
            }
            DetailCollectionFilter detailFilter = new DetailCollectionFilter(details.ToArray(), filters.ToArray());

            Detail[] items = detailFilter.GatherDetails();
            count = items.Length;
            return(items);
        }