示例#1
0
        public override object CloneMethod()
        {
            L_BoardSetting ret = new L_BoardSetting();

            ret.Range = this.Range;
            ret.Full = this.Full;
            ret.SensorOutput = this.SensorOutput;

            return ret;
        }
示例#2
0
        /// <summary>
        /// get this.setting value from controls
        /// </summary>
        private bool GetValueFromControls()
        {
            //Channel設定ユーザコントロール
            for (int i = 0; i < this.uctrlArray.Length; i++)
            {
                if (this.uctrlArray[i].boardType == uctrlChannelSetting.BoardType.Type_B)
                {
                    if (this.setting.ChannelSettingList[i] == null)
                    {
                        this.setting.ChannelSettingList[i] = new ChannelSetting();
                        this.setting.ChannelSettingList[i].ChNo = i + 1;
                    }
                    this.setting.ChannelSettingList[i].ChKind = ChannelKindType.B;

                    B_BoardSetting b = new B_BoardSetting();
                    b.Hold = this.uctrlArray[i].Hold_B;
                    b.Precision = this.uctrlArray[i].Precision_B;
                    this.setting.ChannelSettingList[i].BoardSetting = b;
                }
                else if (this.uctrlArray[i].boardType == uctrlChannelSetting.BoardType.Type_D)
                {
                    if (this.setting.ChannelSettingList[i] == null)
                    {
                        this.setting.ChannelSettingList[i] = new ChannelSetting();
                        this.setting.ChannelSettingList[i].ChNo = i + 1;
                    }
                    this.setting.ChannelSettingList[i].ChKind = ChannelKindType.D;
                    this.setting.ChannelSettingList[i].BoardSetting = null;
                }
                else if (this.uctrlArray[i].boardType == uctrlChannelSetting.BoardType.Type_L)
                {
                    decimal tmp = (this.uctrlArray[i].Range_L + 1) * 0.5m;

                    if (this.uctrlArray[i].SensorOutput_L < tmp - 0.5m || this.uctrlArray[i].SensorOutput_L > tmp + 0.5m)
                    {
                        ShowWarningMessage(string.Format("ch{0} {1} {2} {3}~{4}",
                            i + 1, CommonResource.GetString("TXT_SENSOROUTPUT"), CommonResource.GetString("ERROR_VALUE_OUT_OF_RANGE"), tmp - 0.5m, tmp + 0.5m));
                        this.uctrlArray[i].FocusOnTextBox(3);
                        return false;
                    }
                    if (this.uctrlArray[i].FullScale_L < 0m || this.uctrlArray[i].FullScale_L > 999.999m)
                    {
                        ShowWarningMessage(string.Format("ch{0} {1} {2} {3}",
                            i + 1, CommonResource.GetString("TXT_FULLSCALE"), CommonResource.GetString("ERROR_VALUE_OUT_OF_RANGE"), "0~999.999"));
                        this.uctrlArray[i].FocusOnTextBox(4);
                        return false;
                    }

                    if (this.setting.ChannelSettingList[i] == null)
                    {
                        this.setting.ChannelSettingList[i] = new ChannelSetting();
                        this.setting.ChannelSettingList[i].ChNo = i + 1;
                    }
                    this.setting.ChannelSettingList[i].ChKind = ChannelKindType.L;
                    L_BoardSetting l = new L_BoardSetting();
                    l.Range = this.uctrlArray[i].Range_L;
                    l.SensorOutput = this.uctrlArray[i].SensorOutput_L;
                    l.Full = this.uctrlArray[i].FullScale_L;
                    this.setting.ChannelSettingList[i].BoardSetting = l;
                }
                else if (this.uctrlArray[i].boardType == uctrlChannelSetting.BoardType.Type_R)
                {
                    if (this.setting.ChannelSettingList[i] == null)
                    {
                        this.setting.ChannelSettingList[i] = new ChannelSetting();
                        this.setting.ChannelSettingList[i].ChNo = i + 1;
                    }
                    this.setting.ChannelSettingList[i].ChKind = ChannelKindType.R;
                    R_BoardSetting r = new R_BoardSetting();
                    r.Precision = this.uctrlArray[i].Precision_R;
                    this.setting.ChannelSettingList[i].BoardSetting = r;
                }
                else if (this.uctrlArray[i].boardType == uctrlChannelSetting.BoardType.Type_T)
                {
                    if (this.setting.ChannelSettingList[i] == null)
                    {
                        this.setting.ChannelSettingList[i] = new ChannelSetting();
                        this.setting.ChannelSettingList[i].ChNo = i + 1;
                    }
                    this.setting.ChannelSettingList[i].ChKind = ChannelKindType.T;
                    this.setting.ChannelSettingList[i].BoardSetting = null;
                }
                else if (this.uctrlArray[i].boardType == uctrlChannelSetting.BoardType.Type_V)
                {
                    if (this.uctrlArray[i].ZeroScale_V < -9999.999m || this.uctrlArray[i].ZeroScale_V > 9999.999m)
                    {
                        ShowWarningMessage(string.Format("ch{0} {1} {2} {3}",
                            i + 1, CommonResource.GetString("TXT_ZERO"), CommonResource.GetString("ERROR_VALUE_OUT_OF_RANGE"), "-9999.999~9999.999"));
                        this.uctrlArray[i].FocusOnTextBox(1);
                        return false;
                    }
                    if (this.uctrlArray[i].FullScale_V < -9999.999m || this.uctrlArray[i].FullScale_V > 9999.999m)
                    {
                        ShowWarningMessage(string.Format("ch{0} {1} {2} {3}",
                            i + 1, CommonResource.GetString("TXT_FULLSCALE"), CommonResource.GetString("ERROR_VALUE_OUT_OF_RANGE"), "-9999.999~9999.999"));
                        this.uctrlArray[i].FocusOnTextBox(2);
                        return false;
                    }
                    if (this.setting.ChannelSettingList[i] == null)
                    {
                        this.setting.ChannelSettingList[i] = new ChannelSetting();
                        this.setting.ChannelSettingList[i].ChNo = i + 1;
                    }
                    this.setting.ChannelSettingList[i].ChKind = ChannelKindType.V;
                    V_BoardSetting v = new V_BoardSetting();
                    v.Filter = this.uctrlArray[i].Filter_V;
                    v.Range = this.uctrlArray[i].Range_V;
                    v.Full = this.uctrlArray[i].FullScale_V;
                    v.Zero = this.uctrlArray[i].ZeroScale_V;
                    this.setting.ChannelSettingList[i].BoardSetting = v;
                }
                else if (this.uctrlArray[i].boardType == uctrlChannelSetting.BoardType.None)
                {
                    if (this.setting.ChannelSettingList[i] == null)
                    {
                        this.setting.ChannelSettingList[i] = new ChannelSetting();
                        this.setting.ChannelSettingList[i].ChNo = i + 1;
                    }
                    this.setting.ChannelSettingList[i].ChKind = ChannelKindType.N;
                    this.setting.ChannelSettingList[i].BoardSetting = null;
                }

                this.setting.ChannelSettingList[i].NumPoint = this.uctrlArray[i].NumPoint;
            }

            //タイミングユーザコントロール
            ucTimingSetting1.GetValueFromControls();

            this.dirtyFlag |= ucTimingSetting1.DirtyFlag;

            return true;
        }