/// <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);
        }
Beispiel #3
0
 /// <summary>
 /// Создается отображение Component Ststus - списка агрегатов для ВС
 /// </summary>
 /// <param name="currentBaseDetail"></param>
 /// <param name="initialFilter"></param>
 /// <param name="reportBuilder"></param>
 public DispatcheredComponentStatusControl(BaseDetail currentBaseDetail, DetailCollectionFilter initialFilter, DetailListReportBuilder reportBuilder) : base(currentBaseDetail, initialFilter)
 {
     detailContainer    = currentBaseDetail;
     this.initialFilter = initialFilter;
     ReportBuilder      = reportBuilder;
     Dock = DockStyle.Fill;
 }
        /// <summary>
        ///
        /// </summary>
        protected virtual void OnFilterApplying()
        {
            try
            {
                if (ReloadForDate != null)
                {
                    if (DateAsOfFilterAppliance && dateAsOfChanged)
                    {
                        ReloadForDate(dateTimePicker.Value);
                    }
                    else if (!DateAsOfFilterAppliance && dateTimePicker.Value < DateTime.Today)
                    {
                        ReloadForDate(DateTime.Today);
                    }
                }
            }
            catch (Exception ex)
            {
                Program.Provider.Logger.Log("Error while loading data", ex);
                return;
            }

            DetailCollectionFilter newFilters = GetDetailCollectionFilter();

            if (!newFilters.Equals(lastAppliedFilters))
            {
                lastAppliedFilters = newFilters;
                if (ApplyFilter != null)
                {
                    ApplyFilter(this, new EventArgs());
                }
            }
        }
Beispiel #5
0
 /// <summary>
 /// Создается отображение Component Ststus - списка агрегатов для ВС
 /// </summary>
 /// <param name="currentAircraft"></param>
 /// <param name="initialFilter"></param>
 /// <param name="additionlaFilter"></param>
 /// <param name="builder"></param>
 public DispatcheredComponentStatusScreen(Aircraft currentAircraft, DetailCollectionFilter initialFilter, DetailCollectionFilter additionlaFilter, DetailListReportBuilder builder) : base(currentAircraft, initialFilter, additionlaFilter)
 {
     detailContainer    = currentAircraft;
     this.initialFilter = initialFilter;
     ReportBuilder      = builder;
     Dock = DockStyle.Fill;
 }
 /// <summary>
 /// Создается экземпляр класса StoreDetailFilterSelectionForm
 /// </summary>
 public StoreDetailFilterSelectionForm()
 {
     InitializeComponent();
     Text = "Store Filter";
     Icon = Resources.LTR;
     Initialize();
     lastAppliedFiltersForReport = GetDetailCollectionFilter();
 }
 /// <summary>
 /// Создание экземпляра класса DetailFilterSelection
 /// </summary>
 public DetailFilterSelection()
 {
     InitializeComponent();
     Text = "Component Status Filter";
     Icon = Resources.LTR;
     Initialize();
     dateTimePicker.Value        = DateTime.Now;
     dateTimePicker.MaxDate      = DateTime.Now;
     lastAppliedFiltersForReport = GetDetailCollectionFilter();
 }
        /// <summary>
        /// ћетод, обрабатывающий событие нажати¤ ссылки LLP Disk Sheet Status
        /// </summary>
        /// <param name="e"></param>
        public void OnLLPDiskSheetStatusLinkDisplayRequested(ReferenceEventArgs e)
        {
            e.TypeOfReflection = ReflectionTypes.DisplayInNew;
            e.DisplayerText    = baseDetail.ParentAircraft.RegistrationNumber + ". " + baseDetail + ". LLP Disk Sheet Status";
            DetailCollectionFilter filter        = new DetailCollectionFilter(new DetailFilter[] { new EngineLLPFilter(baseDetail) });
            LLPStatusReportBuilder reportBuilder = new LLPStatusReportBuilder((Engine)baseDetail);

            DispatcheredComponentStatusScreen dispatcheredComponentStatusScreen = new DispatcheredComponentStatusScreen(baseDetail, filter, reportBuilder);

            dispatcheredComponentStatusScreen.StatusText = baseDetail + ". LLP Disk Sheet Status";
            dispatcheredComponentStatusScreen.Status     = Statuses.Satisfactory;//(Statuses)baseDetail.LimitationCondition;todo
            e.RequestedEntity = dispatcheredComponentStatusScreen;
        }
        /// <summary>
        ///
        /// </summary>
        protected virtual void OnFilterApplying()
        {
            DetailCollectionFilter newFilters = GetDetailCollectionFilter();

            if (!newFilters.Equals(lastAppliedFilters))
            {
                lastAppliedFilters = newFilters;
                if (ApplyFilter != null)
                {
                    ApplyFilter(this, new EventArgs());
                }
            }
        }
        private void DetailFilterSelection_Load(object sender, EventArgs e)
        {
            Css.OrdinaryText.Adjust(this);
            Css.OrdinaryText.Adjust(checkedListBoxItems);
            Css.OrdinaryText.Adjust(dateTimePicker);
            Css.OrdinaryText.Adjust(comboReportType);
            Css.OrdinaryText.Adjust(textBoxPartMask);
            Css.OrdinaryText.Adjust(textBoxSerialMask);
            Css.OrdinaryText.Adjust(textBoxATAChapter);

            checkedListBoxItems.BackColor      = Css.CommonAppearance.Colors.BackColor;
            checkedListBoxItems.ForeColor      = Css.SimpleLink.Colors.ActiveLinkColor;
            checkedListBoxATAChapter.BackColor = Css.CommonAppearance.Colors.BackColor;
            checkedListBoxATAChapter.ForeColor = Css.SimpleLink.Colors.ActiveLinkColor;

            Css.OrdinaryText.Adjust(checkBoxDateAsOfAppliance);
            Css.OrdinaryText.Adjust(label3);
            Css.OrdinaryText.Adjust(labelATAChapter);
            Css.OrdinaryText.Adjust(label5);
            Css.OrdinaryText.Adjust(label6);
            Css.OrdinaryText.Adjust(label7);
            Css.OrdinaryText.Adjust(checkBoxConditionMonitoring);

            checkBoxConditionMonitoring.ForeColor = Css.SimpleLink.Colors.ActiveLinkColor;
            Css.OrdinaryText.Adjust(checkBoxHardTime);
            checkBoxHardTime.ForeColor = Css.SimpleLink.Colors.ActiveLinkColor;
            Css.OrdinaryText.Adjust(checkBoxOnCondition);
            checkBoxOnCondition.ForeColor = Css.SimpleLink.Colors.ActiveLinkColor;
            Css.OrdinaryText.Adjust(checkBoxPartFilterAppliance);
            checkBoxPartFilterAppliance.ForeColor = Css.SimpleLink.Colors.ActiveLinkColor;
            checkBoxDateAsOfAppliance.ForeColor   = Css.SimpleLink.Colors.ActiveLinkColor;
            Css.OrdinaryText.Adjust(checkBoxUnknown);
            checkBoxUnknown.ForeColor = Css.SimpleLink.Colors.ActiveLinkColor;
            Css.OrdinaryText.Adjust(checkBoxSerialFilterAppliance);
            checkBoxSerialFilterAppliance.ForeColor = Css.SimpleLink.Colors.ActiveLinkColor;
            Css.OrdinaryText.Adjust(checkBoxNotSatisfactory);
            checkBoxNotSatisfactory.ForeColor = Css.SimpleLink.Colors.ActiveLinkColor;
            Css.OrdinaryText.Adjust(checkBoxNotification);
            checkBoxNotification.ForeColor = Css.SimpleLink.Colors.ActiveLinkColor;
            Css.OrdinaryText.Adjust(checkBoxSatisfactory);
            checkBoxSatisfactory.ForeColor = Css.SimpleLink.Colors.ActiveLinkColor;

            Css.OrdinaryText.Adjust(comboBoxComponent);

            LoadAtaChapters();
            LoadComponent();
            lastAppliedFiltersForReport = GetDetailCollectionFilter();
        }
        ///<summary>
        /// Создается фильтр коллекции агрегатов
        ///</summary>
        ///<returns>Созданная коллекция агрегатов</returns>
        public DetailCollectionFilter GetDetailCollectionFilter()
        {
            DetailCollectionFilter detailCollectionFilter = new DetailCollectionFilter(new DetailFilter[] {});
            List <DetailFilter>    filters = new List <DetailFilter>();

            if (MaintenanceFilterAppliance)
            {
                if (MaintenanceTypeCheckBoxesEnabled)
                {
                    filters.Add(
                        new MaintananceFilter(OnConditionChecked, UnknownChecked, ConditionMonitroringChecked,
                                              HardTimeChecked));
                }
            }
            if (ATAChapterFilterAppliance)
            {
                filters.Add(GetATAChapterFillter());
            }
            if (DetailConditionFilterAppliance)
            {
                filters.Add(new DetailConditionFilter(SatisfactoryChecked, NotSatisfactoryChecked, NotificationChecked));
            }
            if (SerialNumberFilterAppliance)
            {
                filters.Add(new Core.Types.ReportFilters.SerialNumberFilter(textBoxSerialMask.Text));
            }
            if (PartNumberFilterAppliance)
            {
                filters.Add(new PartNumberFilter(textBoxPartMask.Text));
            }
            if (filters.Count > 0)
            {
                detailCollectionFilter.IsNonReportFilterApply = true;
            }
            AddSpecialReportFilters(filters);
            AddComponentFilters(filters);
            if (DateAsOfFilterAppliance)
            {
                filters.Add(new DateAsOfFilter(dateTimePicker.Value));
            }

            detailCollectionFilter.Filters = filters.ToArray();
            return(detailCollectionFilter);
        }
 /// <summary>
 /// Задаются параеметры фильтрации
 /// </summary>
 /// <param name="filter"></param>
 public void SetFilterParameters(DetailCollectionFilter filter)
 {
     for (int i = 0; i < filter.Filters.Length; i++)
     {
         DetailFilter detailFilter = filter.Filters[i];
         if (detailFilter is PartNumberFilter)
         {
             PartNumberFilterAppliance = true;
             textBoxPartMask.Text      = ((PartNumberFilter)detailFilter).Mask;
         }
         if (detailFilter is SerialNumberFilter)
         {
             SerialNumberFilterAppliance = true;
             textBoxSerialMask.Text      = ((SerialNumberFilter)detailFilter).Mask;
         }
         if (detailFilter is DetailConditionFilter)
         {
             DetailConditionFilter detailConditionFilter = (DetailConditionFilter)detailFilter;
             SatisfactoryChecked    = detailConditionFilter.SatisfactoryAcceptance;
             NotSatisfactoryChecked = detailConditionFilter.NotSatisfactoryAcceptance;
             NotificationChecked    = detailConditionFilter.NotificationAcceptance;
         }
         if (detailFilter is ATAChapterFilter)
         {
             SelectCheckListBoxATAChapterByFilter(((ATAChapterFilter)detailFilter).TypeAppliance);
         }
         if (detailFilter is MaintananceFilter)
         {
             MaintananceFilter maintananceFilter = (MaintananceFilter)detailFilter;
             OnConditionChecked          = maintananceFilter.OnConditionAcceptance;
             HardTimeChecked             = maintananceFilter.HardTimeAcceptance;
             ConditionMonitroringChecked = maintananceFilter.ConditionMonitoringAcceptance;
             UnknownChecked = maintananceFilter.UnknownAcceptance;
         }
     }
 }
        /// <summary>
        /// Задаются параеметры фильтрации
        /// </summary>
        /// <param name="filter"></param>
        public void SetFilterParameters(DetailCollectionFilter filter)
        {
            dateAsOfChanged = false;
            for (int i = 0; i < filter.Filters.Length; i++)
            {
                DetailFilter detailFilter = filter.Filters[i];
                if (detailFilter is PartNumberFilter)
                {
                    PartNumberFilterAppliance = true;
                    textBoxPartMask.Text      = ((PartNumberFilter)detailFilter).Mask;
                }
                if (detailFilter is Core.Types.ReportFilters.SerialNumberFilter)
                {
                    SerialNumberFilterAppliance = true;
                    textBoxSerialMask.Text      = ((Core.Types.ReportFilters.SerialNumberFilter)detailFilter).Mask;
                }
                if (detailFilter is DetailConditionFilter)
                {
                    DetailConditionFilter detailConditionFilter = (DetailConditionFilter)detailFilter;
                    SatisfactoryChecked    = detailConditionFilter.SatisfactoryAcceptance;
                    NotSatisfactoryChecked = detailConditionFilter.NotSatisfactoryAcceptance;
                    NotificationChecked    = detailConditionFilter.NotificationAcceptance;
                }
                if (detailFilter is ATAChapterFilter)
                {
                    SelectCheckListBoxATAChapterByFilter(((ATAChapterFilter)detailFilter).TypeAppliance);
                }
                if (detailFilter is MaintananceFilter)
                {
                    MaintananceFilter maintananceFilter = (MaintananceFilter)detailFilter;
                    OnConditionChecked          = maintananceFilter.OnConditionAcceptance;
                    HardTimeChecked             = maintananceFilter.HardTimeAcceptance;
                    ConditionMonitroringChecked = maintananceFilter.ConditionMonitoringAcceptance;
                    UnknownChecked = maintananceFilter.UnknownAcceptance;
                }
                if (detailFilter is BaseDetailFilter)
                {
                    comboBoxComponent.SelectedItem = ((BaseDetailFilter)detailFilter).CurentBaseDetail.ToString();
                }

                if (detailFilter is HardTimeStatusFilter)
                {
                    comboReportType.SelectedItem = hardTimeStatus;
                }
                if (detailFilter is OnConditionStatusFilter)
                {
                    comboReportType.SelectedItem = onConditionStatus;
                }
                if (detailFilter is ConditionMonitoringStatusFilter)
                {
                    comboReportType.SelectedItem = cmStatus;
                }
                if (detailFilter is LLPFilter)
                {
                    comboReportType.SelectedItem = LLPStatus;
                }
                if (detailFilter is AvionicsInventoryFilter)
                {
                    comboReportType.SelectedItem = avionicsInventory;
                }
                if (detailFilter is LandingGearsFilter)
                {
                    comboReportType.SelectedItem = landingGearStatus;
                }
                if (detailFilter is EngineLLPFilter)
                {
                    comboReportType.SelectedItem = GetEngineLLPString(((EngineLLPFilter)detailFilter).CurentBaseDetail);
                }
            }
        }
Beispiel #14
0
 /// <summary>
 /// Создается элемент отображения отклонений для агрегатов
 /// </summary>
 /// <param name="discrepanciesFilter"></param>
 /// <param name="detailSource"></param>
 /// <param name="additionalFilter"></param>
 public ComponentDiscrepancies(DirectiveFilter discrepanciesFilter, IDetailContainer detailSource, DetailCollectionFilter additionalFilter) : this()
 {
     this.discrepanciesFilter = discrepanciesFilter;
     this.detailSource        = detailSource;
     this.additionalFilter    = additionalFilter;
 }
Beispiel #15
0
/*        #region public DispatcheredComponentStatusScreen(Aircraft currentAircraft, DetailCollectionFilter additionlaFilter) : this(currentAircraft, new DetailCollectionFilter(new DetailFilter[1] { new AllDetailFilter() }), additionlaFilter, new DetailListReportBuilder())
 *
 *      /// <summary>
 *      /// Создается отображение Component Ststus - списка агрегатов для ВС
 *      /// </summary>
 *      /// <param name="currentAircraft"></param>
 *      /// <param name="additionlaFilter"></param>
 *      public DispatcheredComponentStatusScreen(Aircraft currentAircraft, DetailCollectionFilter additionlaFilter) : this(currentAircraft, new DetailCollectionFilter(new DetailFilter[1] { new AllDetailFilter() }), additionlaFilter, new DetailListReportBuilder())
 *      {
 *      }
 *
 #endregion*/

        #region public DispatcheredComponentStatusScreen(Aircraft currentAircraft, DetailCollectionFilter additionlaFilter) : this(currentAircraft, new DetailCollectionFilter(new DetailFilter[1] { new AllDetailFilter() }), additionlaFilter, new DetailListReportBuilder())

        /// <summary>
        /// Создается отображение Component Ststus - списка агрегатов для ВС
        /// </summary>
        /// <param name="currentAircraft"></param>
        /// <param name="additionlaFilter"></param>
        public DispatcheredComponentStatusScreen(Aircraft currentAircraft, DetailCollectionFilter additionlaFilter, DetailListReportBuilder builder) : this(currentAircraft, new DetailCollectionFilter(new DetailFilter[1] { new AllDetailFilter() }), additionlaFilter, builder)
        {
        }