Exemplo n.º 1
0
 private void ConfigureAcSettings(FrequencyParameters frequencyConfiguration, ICircuitContext context)
 {
     if (context.Result.SimulationConfiguration.KeepOpInfo.HasValue)
     {
         frequencyConfiguration.KeepOpInfo = context.Result.SimulationConfiguration.KeepOpInfo.Value;
     }
 }
        public FrequencyProperties(
            DashboardHelper dashboardHelper,
            IGadget gadget,
            FrequencyParameters parameters,
            List <Grid> strataGridList
            )
        {
            InitializeComponent();
            this.DashboardHelper = dashboardHelper;
            this.Gadget          = gadget;
            this.Parameters      = parameters;
            this.StrataGridList  = strataGridList;

            List <string> fields       = new List <string>();
            List <string> weightFields = new List <string>();
            List <string> strataItems  = new List <string>();

            //Variable fields
            fields.Add(String.Empty);
            ColumnDataType columnDataType = ColumnDataType.Boolean | ColumnDataType.DateTime | ColumnDataType.Numeric | ColumnDataType.Text | ColumnDataType.UserDefined;

            foreach (string fieldName in DashboardHelper.GetFieldsAsList(columnDataType))
            {
                if (DashboardHelper.IsUsingEpiProject)
                {
                    if (!(fieldName == "RecStatus"))
                    {
                        fields.Add(fieldName);
                    }
                }
                else
                {
                    fields.Add(fieldName);
                }
            }
            //  cbxField.ItemsSource = fields;
            lbxField.ItemsSource = fields;
            // Set the height of the field list to fit
            lbxField.Height = System.Windows.SystemParameters.PrimaryScreenHeight / 1.7;
            //Weight Fields
            weightFields.Add(String.Empty);
            columnDataType = ColumnDataType.Numeric | ColumnDataType.UserDefined;
            foreach (string fieldName in DashboardHelper.GetFieldsAsList(columnDataType))
            {
                if (DashboardHelper.IsUsingEpiProject)
                {
                    if (!(fieldName == "RecStatus"))
                    {
                        weightFields.Add(fieldName);
                    }
                }
                else
                {
                    weightFields.Add(fieldName);
                }
            }
            weightFields.Sort();
            cbxFieldWeight.ItemsSource = weightFields;

            //Strata Fields
            strataItems.Add(String.Empty);
            columnDataType = ColumnDataType.Numeric | ColumnDataType.Boolean | ColumnDataType.Text | ColumnDataType.UserDefined;
            foreach (string fieldName in DashboardHelper.GetFieldsAsList(columnDataType))
            {
                if (DashboardHelper.IsUsingEpiProject)
                {
                    if (!(fieldName == "RecStatus" || fieldName == "FKEY" || fieldName == "GlobalRecordId"))
                    {
                        strataItems.Add(fieldName);
                    }
                }
                else
                {
                    strataItems.Add(fieldName);
                }
            }
            lbxFieldStrata.ItemsSource = strataItems;
            // Set the height of the stratification list to fit
            lbxFieldStrata.Height = System.Windows.SystemParameters.PrimaryScreenHeight / 2.2;

            // CollectionView view = (CollectionView)CollectionViewSource.GetDefaultView(cbxField.ItemsSource);
            PropertyGroupDescription groupDescription = new PropertyGroupDescription("VariableCategory");

            // view.GroupDescriptions.Add(groupDescription);

            RowFilterControl = new RowFilterControl(this.DashboardHelper, Dialogs.FilterDialogMode.ConditionalMode, (gadget as FrequencyControl).DataFilters, true);
            RowFilterControl.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
            panelFilters.Children.Add(RowFilterControl);

            txtRows.PreviewKeyDown     += new KeyEventHandler(txtInput_PositiveIntegerOnly_PreviewKeyDown);
            txtBarWidth.PreviewKeyDown += new KeyEventHandler(txtInput_PositiveIntegerOnly_PreviewKeyDown);

            #region Translation

            tbtnVariables.Title                     = DashboardSharedStrings.GADGET_TABBUTTON_VARIABLES;
            tbtnVariables.Description               = DashboardSharedStrings.GADGET_TABDESC_FREQUENCY;
            tbtnSorting.Title                       = DashboardSharedStrings.GADGET_TABBUTTON_SORTING;
            tbtnSorting.Description                 = DashboardSharedStrings.GADGET_TABDESC_SORTING;
            tbtnDisplay.Title                       = DashboardSharedStrings.GADGET_TABBUTTON_DISPLAY;
            tbtnDisplay.Description                 = DashboardSharedStrings.GADGET_TABDESC_DISPLAY;
            tbtnFilters.Title                       = DashboardSharedStrings.GADGET_TABBUTTON_FILTERS;
            tbtnFilters.Description                 = DashboardSharedStrings.GADGET_TABDESC_FILTERS;
            tblockPanelVariablesTxt.Text            = DashboardSharedStrings.GADGET_PANELHEADER_VARIABLES;
            tblockPanelSortingTxt.Text              = DashboardSharedStrings.GADGET_PANELHEADER_SORTING;
            tblockGroupingSubheaderTxt.Text         = DashboardSharedStrings.GADGET_PANELSUBHEADER_GROUPING;
            tblockSortingSubheader.Content          = DashboardSharedStrings.GADGET_PANELSUBHEADER_SORTING;
            tblockSortMethod.Text                   = DashboardSharedStrings.GADGET_SORT_METHOD;
            tblockPanelDisplayTxt.Text              = DashboardSharedStrings.GADGET_PANELHEADER_DISPLAY;
            tblockTitleNDescSubheader.Content       = DashboardSharedStrings.GADGET_PANELSUBHEADER_TITLENDESC;
            tblockTitleTxt.Text                     = DashboardSharedStrings.GADGET_GADET_TITLE;
            tblockDescTxt.Text                      = DashboardSharedStrings.GADGET_DESCRIPTION;
            tblockPanelOutputOptTxt.Text            = DashboardSharedStrings.GADGET_OUTPUT_OPTIONS;
            checkboxAllValuesTxt.Text               = DashboardSharedStrings.GADGET_DISPLAY_LIST_VALUE;
            checkboxDrawBordersTxt.Text             = DashboardSharedStrings.GADGET_DRAW_BORDERS;
            checkboxDrawHeaderTxt.Text              = DashboardSharedStrings.GADGET_DRAW_HEADER_ROW;
            checkboxDrawTotalTxt.Text               = DashboardSharedStrings.GADGET_DRAW_TOTAL_ROW;
            tblockOutputDisplaySubheaderTxt.Text    = DashboardSharedStrings.GADGET_OUTPUT_COLUMNS_DISPLAY;
            checkboxColumnFrequencyTxt.Text         = DashboardSharedStrings.GADGET_COLUMN_FREQUENCY;
            checkboxColumnPercentTxt.Text           = DashboardSharedStrings.GADGET_COLUMN_PERCENT;
            checkboxColumnCumulativePercentTxt.Text = DashboardSharedStrings.GADGET_COLUMN_CUMULATIVE_PERCENT;
            checkboxColumn95CILowerTxt.Text         = DashboardSharedStrings.GADGET_COLUMN_95_CILOWER;
            checkboxColumn95CIUpperTxt.Text         = DashboardSharedStrings.GADGET_COLUMN_95_CIUPPER;
            checkboxColumnPercentBarsTxt.Text       = DashboardSharedStrings.GADGET_COLUMN_PERCENTBAR;
            tblockPanelDataFilterTxt.Text           = DashboardSharedStrings.GADGET_PANELHEADER_DATA_FILTER;
            tblockAnyFilterGadgetOnlyTxt.Text       = DashboardSharedStrings.GADGET_FILTER_GADGET_ONLY;


            lblConfigExpandedTitleTxt.Text = DashboardSharedStrings.GADGET_CONFIG_TITLE_FREQUENCY;
            //expanderAdvancedOptions.Header = DashboardSharedStrings.GADGET_ADVANCED_OPTIONS;
            //expanderDisplayOptions.Header = DashboardSharedStrings.GADGET_DISPLAY_OPTIONS;
            tblockMainVariable.Text   = DashboardSharedStrings.GADGET_FREQUENCY_VARIABLE;
            tblockStrataVariable.Text = DashboardSharedStrings.GADGET_STRATA_VARIABLE;
            tblockWeightVariable.Text = DashboardSharedStrings.GADGET_WEIGHT_VARIABLE;

            //checkboxAllValues.Content = DashboardSharedStrings.GADGET_ALL_LIST_VALUES;
            checkboxCommentLegalLabelsTxt.Text = DashboardSharedStrings.GADGET_LIST_LABELS;
            checkboxIncludeMissingTxt.Text     = DashboardSharedStrings.GADGET_INCLUDE_MISSING;

            checkboxSortHighLowTxt.Text = DashboardSharedStrings.GADGET_SORT_HI_LOW;
            checkboxUsePromptsTxt.Text  = DashboardSharedStrings.GADGET_USE_FIELD_PROMPTS;
            //tblockOutputColumns.Text = DashboardSharedStrings.GADGET_OUTPUT_COLUMNS_DISPLAY;
            tblockPrecisionTxt.Text = DashboardSharedStrings.GADGET_DECIMALS_TO_DISPLAY;

            tblockRows.Text     = DashboardSharedStrings.GADGET_MAX_ROWS_TO_DISPLAY;
            tblockBarWidth.Text = DashboardSharedStrings.GADGET_MAX_PERCENT_BAR_WIDTH;

            btnOKTxt.Text     = DashboardSharedStrings.BUTTON_OK;
            btnCancelTxt.Text = DashboardSharedStrings.BUTTON_CANCEL;
            //btnRun.Content = DashboardSharedStrings.GADGET_RUN_BUTTON;
            #endregion // Translation
        }