public void SetConfigPolicy( U50Policy policy )
        {
            if ( policy.IsDateNow == true )
            {
                this.RadioButtonDataTimeNow.Checked = true;
                this.RadioButtonSelectDataTime.Checked = false;
            }
            else
            {
                this.RadioButtonSelectDataTime.Checked = true;
                this.RadioButtonDataTimeNow.Checked = false;
            }

            this.ComboBoxSelectDateTime.Text = policy.DateSelect.ToLongDateString();
            this.NumericUpDownKLine.Value = policy.KN;

            if ( policy.IsAllowDate == true )
                this.CheckBoxDataTime.Checked = true;
            else
                this.CheckBoxDataTime.Checked = false;

            this.NumericUpDownDataTimeStep.Value = policy.DateStep;
            this.ComboBoxDataTimeStop.Text = policy.DateEnd.ToLongDateString();

            if ( policy.IsAllowKN == true )
                this.CheckBoxKLine.Checked = true;
            else
                this.CheckBoxKLine.Checked = false;

            this.NumericUpDownKLineStep.Value = policy.KNStep;
            this.NumericUpDownKLineStop.Value = policy.KNEnd;

            if ( policy.Priority == U50PriorityType.BaseDate )
            {
                this.CheckBoxKLinePriority.Checked = false;
                this.CheckBoxDataTimePriority.Checked = true;
            }
            else if ( policy.Priority == U50PriorityType.BaseKN )
            {
                this.CheckBoxDataTimePriority.Checked = false;
                this.CheckBoxKLinePriority.Checked = true;
            }

            if ( policy.Output == U50OutputType.All )
            {
                this.CheckBoxOneOutput.Checked = false;
                this.CheckBoxAllOutput.Checked = true;
            }
            else if ( policy.Output == U50OutputType.One )
            {
                this.CheckBoxAllOutput.Checked = false;
                this.CheckBoxOneOutput.Checked = true;
            }
        }
        public U50Policy GetConfigPolicy()
        {
            U50Policy configPolicy = new U50Policy();

            if ( this.RadioButtonDataTimeNow.Checked == true )
                configPolicy.IsDateNow = true;
            else
                configPolicy.IsDateNow = false;

            configPolicy.DateSelect = DateTime.Parse( this.ComboBoxSelectDateTime.Text );
            configPolicy.KN = (uint)this.NumericUpDownKLine.Value;

            if ( this.CheckBoxDataTime.Checked == true )
                configPolicy.IsAllowDate = true;

            configPolicy.DateStep = (uint)this.NumericUpDownDataTimeStep.Value;
            configPolicy.DateEnd = DateTime.Parse( this.ComboBoxDataTimeStop.Text );

            if ( this.CheckBoxKLine.Checked == true )
                configPolicy.IsAllowKN = true;

            configPolicy.KNStep = (uint)this.NumericUpDownKLineStep.Value;
            configPolicy.KNEnd = (uint)this.NumericUpDownKLineStop.Value;

            if ( this.CheckBoxAllOutput.Checked == true )
            {
                configPolicy.Output = U50OutputType.All;
            }
            else if ( this.CheckBoxOneOutput.Checked == true )
            {
                configPolicy.Output = U50OutputType.One;
            }

            if ( this.CheckBoxDataTimePriority.Checked == true )
            {
                configPolicy.Priority = U50PriorityType.BaseDate;
            }
            else if ( this.CheckBoxKLinePriority.Checked == true )
            {
                configPolicy.Priority = U50PriorityType.BaseKN;
            }

            return configPolicy;
        }