| | |
| | | return true; |
| | | } |
| | | HStation.Vmo.AssetsValveMainVmo vmo = null; |
| | | int firstCount = 0; |
| | | //口径最小差值 |
| | | // 绝对匹配 |
| | | |
| | | adaptingManageVmos = adaptingManageVmos.Where(x => x.Type.ToString() == input.ValveType).ToList(); |
| | | var nameMatching = adaptingManageVmos.Where(x => GetIntersect(x.KeyWord == string.Empty |
| | | ? x.Name : x.KeyWord, input.ModelType) >= 2) |
| | | ? x.Name : x.KeyWord, input.ModelType) >= 1) |
| | | .OrderByDescending(x => GetIntersect(x.KeyWord == string.Empty ? x.Name : x.KeyWord, input.ModelType)) |
| | | .ToList();//使用型号名或者关键字找出相同字符在2以上并且进行排序 |
| | | if (nameMatching.Count > 0) |
| | | { |
| | | /* var absoluteMatch = nameMatching.Where(i => |
| | | ((i.Caliber == null) || i.Caliber == input.Diameter) && |
| | | ((input.MaterialName == null && i.MaterialName == null) || i.MaterialName == input.MaterialName)).ToList(); |
| | | if (absoluteMatch.Count > 1) |
| | | { |
| | | }*/ |
| | | var absoluteMatching = nameMatching.Where(i => |
| | | ((i.Caliber == null) || Math.Abs(Convert.ToInt64(i.Caliber) - input.Diameter) <= _caliberTolerance) && //直径约束 |
| | | i.MaterialName == input.Material && //材料约束 |
| | | (i.ValveLift == input.ValveLift || Math.Abs(Convert.ToInt64(i.ValveLift) - Convert.ToInt64(input.ValveLift)) <= _valveLift) //阀门开度约束 |
| | | ).ToList(); |
| | | if (absoluteMatching.Count > 1) |
| | | { |
| | | return false; |
| | | } |
| | | else if (absoluteMatching.Count == 1) |
| | | { |
| | | vmo = absoluteMatching.First(); |
| | | } |
| | | else |
| | | return false; |
| | | } |
| | | else if (nameMatching.Count == 1) |
| | | { |
| | | vmo = nameMatching.First(); |
| | | } |
| | | else |
| | | { |
| | | var absoluteMatching = adaptingManageVmos.Where(i => |
| | | ((i.Caliber == null) || Math.Abs(Convert.ToInt64(i.Caliber) - input.Diameter) <= _caliberTolerance) && //直径约束 |
| | | i.MaterialName == input.Material && //材料约束 |
| | | (i.ValveLift == input.ValveLift || Math.Abs(Convert.ToInt64(i.ValveLift) - Convert.ToInt64(input.ValveLift)) <= _valveLift) //阀门开度约束 |
| | | ).ToList(); |
| | | if (absoluteMatching.Count > 1) |
| | | { |
| | | return false; |
| | | } |
| | | else if (absoluteMatching.Count == 1) |
| | | { |
| | | vmo = absoluteMatching.First(); |
| | | } |
| | | else |
| | | return false; |
| | | } |
| | | |
| | | var absoluteMatch = adaptingManageVmos.Where(i => |
| | | /*var absoluteMatch = adaptingManageVmos.Where(i => |
| | | ((i.Caliber == null) || i.Caliber == input.Diameter) && |
| | | ((input.Material == null && i.MaterialName == null) || i.MaterialName == input.Material)).ToList(); |
| | | if (absoluteMatch.Count > 1) |
| | |
| | | return false;//通过型号名没有找到,则视为没有匹配到 |
| | | foreach (var item in allMatchingList) |
| | | { |
| | | /* if (item.IsDefault) |
| | | { |
| | | vmo = item; |
| | | }*/ |
| | | if (item.IsDefault) |
| | | { |
| | | vmo = item; |
| | | } |
| | | } |
| | | vmo = allMatchingList.First();//如果没有设置默认值,则默认返回匹配字符最多的一条数据 |
| | | } |
| | |
| | | return false;//通过型号名没有找到,则视为没有匹配到 |
| | | foreach (var item in allMatchingList) |
| | | { |
| | | /* if (item.IsDefault) |
| | | { |
| | | vmo = item; |
| | | }*/ |
| | | if (item.IsDefault) |
| | | { |
| | | vmo = item; |
| | | } |
| | | } |
| | | vmo = allMatchingList.First();//如果没有设置默认值,则默认返回匹配字符最多的一条数据 |
| | | } |
| | | } |
| | | //口径和材料都没有匹配上,就用型号名匹配 |
| | | firstCount = 0; |
| | | firstCount = 0;*/ |
| | | if (vmo != null) |
| | | { |
| | | input.MatchingMinorLoss = vmo.Coefficient; |
| | |
| | | input.MatchingDiameter = vmo.Caliber; |
| | | input.MatchingMaterial = vmo.MaterialName; |
| | | input.MatchingModelType = vmo.Name; |
| | | // input.MatchingValveSetting = |
| | | input.MatchingValveSetting = vmo.ValveSetting; |
| | | input.MatchingValveLift = vmo.ValveLift; |
| | | input.MatchingValveType = vmo.Type.ToString(); |
| | | return true; |
| | |
| | | public static int GetIntersect(string str1, string str2) |
| | | { |
| | | if (str1 == null || str2 == null) return 0; |
| | | |
| | | var a = string.Join("", str1.Intersect(str2)).Count(); |
| | | return string.Join("", str1.Intersect(str2)).Count(); |
| | | } |
| | | } |
| | |
| | | public double? MatchingMinorLoss { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 管路连接长度 |
| | | /// 弯头类型 |
| | | /// </summary> |
| | | [DisplayName("匹配连接长度")] |
| | | [DisplayName("弯头类型")] |
| | | [Browsable(true)] |
| | | public eLengthType? MatchingConnectionLength { get; set; } |
| | | |
| | |
| | | /// </summary> |
| | | [DisplayName("阀门开度")] |
| | | [Browsable(true)] |
| | | public int ValveLift { get; set; } |
| | | public int? ValveLift { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 匹配型号 |
| | |
| | | gridView1.Name = "gridView1"; |
| | | gridView1.OptionsView.ShowGroupPanel = false; |
| | | gridView1.RowCellClick += gridView1_RowCellClick; |
| | | gridView1.FocusedRowChanged += gridView1_FocusedRowChanged; |
| | | // |
| | | // |
| | | // ColShowChart |
| | | // |
| | | ColShowChart.AppearanceCell.Options.UseTextOptions = true; |
| | |
| | | this.gridControl1.DataSource = _allPhartList; |
| | | } |
| | | |
| | | //曲线列表选择项切换事件 |
| | | private async void gridView1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e) |
| | | { |
| | | } |
| | | |
| | | //查看曲线 |
| | | private async void gridView1_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e) |
| | | { |
| | |
| | | if (vmo != null) |
| | | { |
| | | _pumpMatchingViewModel.MatchingChartDbId = vm.ID.ToString(); |
| | | var graph_qh = vmo.Diagram.GraphList.Find(x => x.GraphType == HStation.PhartRelation.eGraphType.ValveQL); |
| | | if (graph_qh != null) |
| | | var graph_ql = vmo.Diagram.GraphList.Find(x => x.GraphType == HStation.PhartRelation.eGraphType.ValveQL); |
| | | if (graph_ql != null) |
| | | { |
| | | var points_qh = PhartPerformCurveHelper.GetFeatPointList(graph_qh.GraphType, graph_qh.GeometryInfo, 100, null); |
| | | var points_qh = PhartPerformCurveHelper.GetFeatPointList(graph_ql.GraphType, graph_ql.GeometryInfo, 100, null); |
| | | _pumpMatchingViewModel.MatchingCurveQL = new List<CurvePointMatchingViewModel>(); |
| | | foreach (var item in points_qh) |
| | | { |
| | |
| | | this.Material = rhs.Material; |
| | | this.Caliber = rhs.Diameter; |
| | | this.Code = rhs.Code; |
| | | this.Name = rhs.Name; |
| | | this.DbId = rhs.DbId; |
| | | this.ModelType = rhs.ModelType; |
| | | this.MatchingDiameter = rhs.MatchingDiameter.ToString(); |
| | |
| | | private void InitializeComponent() |
| | | { |
| | | layoutControl1 = new DevExpress.XtraLayout.LayoutControl(); |
| | | pipeLineSingleMatchingForm1 = new PipeSingleMatchingForm(); |
| | | btnComplete = new SimpleButton(); |
| | | btnCancel = new SimpleButton(); |
| | | Root = new DevExpress.XtraLayout.LayoutControlGroup(); |
| | | itemForCancel = new DevExpress.XtraLayout.LayoutControlItem(); |
| | | itemForComplete = new DevExpress.XtraLayout.LayoutControlItem(); |
| | | pipeLineSingleMatchingForm1 = new PipeSingleMatchingForm(); |
| | | layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem(); |
| | | emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem(); |
| | | itemForCancel = new DevExpress.XtraLayout.LayoutControlItem(); |
| | | itemForComplete = new DevExpress.XtraLayout.LayoutControlItem(); |
| | | ((ISupportInitialize)layoutControl1).BeginInit(); |
| | | layoutControl1.SuspendLayout(); |
| | | ((ISupportInitialize)Root).BeginInit(); |
| | | ((ISupportInitialize)itemForCancel).BeginInit(); |
| | | ((ISupportInitialize)itemForComplete).BeginInit(); |
| | | ((ISupportInitialize)layoutControlItem1).BeginInit(); |
| | | ((ISupportInitialize)emptySpaceItem1).BeginInit(); |
| | | ((ISupportInitialize)itemForCancel).BeginInit(); |
| | | ((ISupportInitialize)itemForComplete).BeginInit(); |
| | | SuspendLayout(); |
| | | // |
| | | // layoutControl1 |
| | |
| | | layoutControl1.Size = new Size(747, 432); |
| | | layoutControl1.TabIndex = 6; |
| | | layoutControl1.Text = "layoutControl1"; |
| | | // |
| | | // pipeLineSingleMatchingForm1 |
| | | // |
| | | pipeLineSingleMatchingForm1.Location = new Point(2, 2); |
| | | pipeLineSingleMatchingForm1.Name = "pipeLineSingleMatchingForm1"; |
| | | pipeLineSingleMatchingForm1.Size = new Size(743, 402); |
| | | pipeLineSingleMatchingForm1.TabIndex = 0; |
| | | // |
| | | // btnComplete |
| | | // |
| | |
| | | // |
| | | // btnCancel |
| | | // |
| | | btnCancel.Appearance.BackColor = DevExpress.LookAndFeel.DXSkinColors.FillColors.Danger; |
| | | btnCancel.Appearance.BackColor = DevExpress.LookAndFeel.DXSkinColors.FillColors.Warning; |
| | | btnCancel.Appearance.Options.UseBackColor = true; |
| | | btnCancel.DialogResult = DialogResult.Cancel; |
| | | btnCancel.Location = new Point(641, 408); |
| | |
| | | Root.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); |
| | | Root.Size = new Size(747, 432); |
| | | Root.TextVisible = false; |
| | | // |
| | | // layoutControlItem1 |
| | | // |
| | | layoutControlItem1.Control = pipeLineSingleMatchingForm1; |
| | | layoutControlItem1.Location = new Point(0, 0); |
| | | layoutControlItem1.Name = "layoutControlItem1"; |
| | | layoutControlItem1.Size = new Size(747, 406); |
| | | layoutControlItem1.TextSize = new Size(0, 0); |
| | | layoutControlItem1.TextVisible = false; |
| | | // |
| | | // emptySpaceItem1 |
| | | // |
| | | emptySpaceItem1.AllowHotTrack = false; |
| | | emptySpaceItem1.Location = new Point(0, 406); |
| | | emptySpaceItem1.Name = "emptySpaceItem1"; |
| | | emptySpaceItem1.Size = new Size(531, 26); |
| | | emptySpaceItem1.TextSize = new Size(0, 0); |
| | | // |
| | | // itemForCancel |
| | | // |
| | |
| | | itemForComplete.TextSize = new Size(0, 0); |
| | | itemForComplete.TextVisible = false; |
| | | // |
| | | // elbowSingleMatchingForm1 |
| | | // |
| | | pipeLineSingleMatchingForm1.Location = new Point(2, 2); |
| | | pipeLineSingleMatchingForm1.Name = "pipeLineSingleMatchingForm1"; |
| | | pipeLineSingleMatchingForm1.Size = new Size(743, 402); |
| | | pipeLineSingleMatchingForm1.TabIndex = 0; |
| | | // |
| | | // layoutControlItem1 |
| | | // |
| | | layoutControlItem1.Control = pipeLineSingleMatchingForm1; |
| | | layoutControlItem1.Location = new Point(0, 0); |
| | | layoutControlItem1.Name = "layoutControlItem1"; |
| | | layoutControlItem1.Size = new Size(747, 406); |
| | | layoutControlItem1.TextSize = new Size(0, 0); |
| | | layoutControlItem1.TextVisible = false; |
| | | // |
| | | // emptySpaceItem1 |
| | | // |
| | | emptySpaceItem1.AllowHotTrack = false; |
| | | emptySpaceItem1.Location = new Point(0, 406); |
| | | emptySpaceItem1.Name = "emptySpaceItem1"; |
| | | emptySpaceItem1.Size = new Size(531, 26); |
| | | emptySpaceItem1.TextSize = new Size(0, 0); |
| | | // |
| | | // PipeSingMatchingDlg |
| | | // |
| | | AutoScaleDimensions = new SizeF(7F, 14F); |
| | | AutoScaleMode = AutoScaleMode.Font; |
| | | ClientSize = new Size(747, 432); |
| | | Controls.Add(layoutControl1); |
| | | Name = "PipeLineSingMatchingDlg"; |
| | | Name = "PipeSingMatchingDlg"; |
| | | StartPosition = FormStartPosition.CenterScreen; |
| | | Text = "管道匹配"; |
| | | ((ISupportInitialize)layoutControl1).EndInit(); |
| | | layoutControl1.ResumeLayout(false); |
| | | ((ISupportInitialize)Root).EndInit(); |
| | | ((ISupportInitialize)itemForCancel).EndInit(); |
| | | ((ISupportInitialize)itemForComplete).EndInit(); |
| | | ((ISupportInitialize)layoutControlItem1).EndInit(); |
| | | ((ISupportInitialize)emptySpaceItem1).EndInit(); |
| | | ((ISupportInitialize)itemForCancel).EndInit(); |
| | | ((ISupportInitialize)itemForComplete).EndInit(); |
| | | ResumeLayout(false); |
| | | } |
| | | |
| | |
| | | public PipeSingMatchingDlg() |
| | | { |
| | | InitializeComponent(); |
| | | this.IconOptions.Icon = Yw.WinFrmUI.GlobalParas.AppIcon; |
| | | } |
| | | |
| | | public event Action<PipeMatchingViewModel> ReloadDataEvent; |
| | |
| | | private void btnComplete_Click(object sender, EventArgs e) |
| | | { |
| | | ReloadDataEvent.Invoke(_ValveMatchingView); |
| | | this.Close(); |
| | | } |
| | | } |
| | | } |
| | |
| | | public PipeSingleMatchingForm() |
| | | { |
| | | InitializeComponent(); |
| | | this.gridView3.SetNormalView(); |
| | | } |
| | | |
| | | private PipeMatchingViewModel _pipeMatchingViewModel; |
| | |
| | | this.Material = rhs.Material; |
| | | this.Caliber = rhs.Diameter; |
| | | this.Code = rhs.Code; |
| | | this.Name = rhs.Name; |
| | | this.Dbid = rhs.DbId; |
| | | this.ModelType = rhs.ModelType; |
| | | this.eAlgorithmType = rhs.eAlgorithmType; |
| | |
| | | private void InitializeComponent() |
| | | { |
| | | layoutControl1 = new DevExpress.XtraLayout.LayoutControl(); |
| | | elbowSingleMatchingForm1 = new ElbowSingleMatchingForm(); |
| | | btnComplete = new SimpleButton(); |
| | | btnCancel = new SimpleButton(); |
| | | Root = new DevExpress.XtraLayout.LayoutControlGroup(); |
| | | itemForCancel = new DevExpress.XtraLayout.LayoutControlItem(); |
| | | itemForComplete = new DevExpress.XtraLayout.LayoutControlItem(); |
| | | elbowSingleMatchingForm1 = new ElbowSingleMatchingForm(); |
| | | layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem(); |
| | | emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem(); |
| | | itemForCancel = new DevExpress.XtraLayout.LayoutControlItem(); |
| | | itemForComplete = new DevExpress.XtraLayout.LayoutControlItem(); |
| | | ((ISupportInitialize)layoutControl1).BeginInit(); |
| | | layoutControl1.SuspendLayout(); |
| | | ((ISupportInitialize)Root).BeginInit(); |
| | | ((ISupportInitialize)itemForCancel).BeginInit(); |
| | | ((ISupportInitialize)itemForComplete).BeginInit(); |
| | | ((ISupportInitialize)layoutControlItem1).BeginInit(); |
| | | ((ISupportInitialize)emptySpaceItem1).BeginInit(); |
| | | ((ISupportInitialize)itemForCancel).BeginInit(); |
| | | ((ISupportInitialize)itemForComplete).BeginInit(); |
| | | SuspendLayout(); |
| | | // |
| | | // layoutControl1 |
| | |
| | | layoutControl1.Size = new Size(747, 432); |
| | | layoutControl1.TabIndex = 6; |
| | | layoutControl1.Text = "layoutControl1"; |
| | | // |
| | | // elbowSingleMatchingForm1 |
| | | // |
| | | elbowSingleMatchingForm1.Location = new Point(2, 2); |
| | | elbowSingleMatchingForm1.Name = "elbowSingleMatchingForm1"; |
| | | elbowSingleMatchingForm1.Size = new Size(743, 402); |
| | | elbowSingleMatchingForm1.TabIndex = 0; |
| | | // |
| | | // btnComplete |
| | | // |
| | |
| | | // |
| | | // btnCancel |
| | | // |
| | | btnCancel.Appearance.BackColor = DevExpress.LookAndFeel.DXSkinColors.FillColors.Danger; |
| | | btnCancel.Appearance.BackColor = DevExpress.LookAndFeel.DXSkinColors.FillColors.Warning; |
| | | btnCancel.Appearance.Options.UseBackColor = true; |
| | | btnCancel.DialogResult = DialogResult.Cancel; |
| | | btnCancel.Location = new Point(641, 408); |
| | |
| | | Root.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); |
| | | Root.Size = new Size(747, 432); |
| | | Root.TextVisible = false; |
| | | // |
| | | // layoutControlItem1 |
| | | // |
| | | layoutControlItem1.Control = elbowSingleMatchingForm1; |
| | | layoutControlItem1.Location = new Point(0, 0); |
| | | layoutControlItem1.Name = "layoutControlItem1"; |
| | | layoutControlItem1.Size = new Size(747, 406); |
| | | layoutControlItem1.TextSize = new Size(0, 0); |
| | | layoutControlItem1.TextVisible = false; |
| | | // |
| | | // emptySpaceItem1 |
| | | // |
| | | emptySpaceItem1.AllowHotTrack = false; |
| | | emptySpaceItem1.Location = new Point(0, 406); |
| | | emptySpaceItem1.Name = "emptySpaceItem1"; |
| | | emptySpaceItem1.Size = new Size(531, 26); |
| | | emptySpaceItem1.TextSize = new Size(0, 0); |
| | | // |
| | | // itemForCancel |
| | | // |
| | |
| | | itemForComplete.TextSize = new Size(0, 0); |
| | | itemForComplete.TextVisible = false; |
| | | // |
| | | // elbowSingleMatchingForm1 |
| | | // |
| | | elbowSingleMatchingForm1.Location = new Point(2, 2); |
| | | elbowSingleMatchingForm1.Name = "pipeLineSingleMatchingForm1"; |
| | | elbowSingleMatchingForm1.Size = new Size(743, 402); |
| | | elbowSingleMatchingForm1.TabIndex = 0; |
| | | // |
| | | // layoutControlItem1 |
| | | // |
| | | layoutControlItem1.Control = elbowSingleMatchingForm1; |
| | | layoutControlItem1.Location = new Point(0, 0); |
| | | layoutControlItem1.Name = "layoutControlItem1"; |
| | | layoutControlItem1.Size = new Size(747, 406); |
| | | layoutControlItem1.TextSize = new Size(0, 0); |
| | | layoutControlItem1.TextVisible = false; |
| | | // |
| | | // emptySpaceItem1 |
| | | // |
| | | emptySpaceItem1.AllowHotTrack = false; |
| | | emptySpaceItem1.Location = new Point(0, 406); |
| | | emptySpaceItem1.Name = "emptySpaceItem1"; |
| | | emptySpaceItem1.Size = new Size(531, 26); |
| | | emptySpaceItem1.TextSize = new Size(0, 0); |
| | | // |
| | | // PipeSingMatchingDlg |
| | | // ElbowSingMatchingDlg |
| | | // |
| | | AutoScaleDimensions = new SizeF(7F, 14F); |
| | | AutoScaleMode = AutoScaleMode.Font; |
| | | ClientSize = new Size(747, 432); |
| | | Controls.Add(layoutControl1); |
| | | Name = "PipeLineSingMatchingDlg"; |
| | | Name = "ElbowSingMatchingDlg"; |
| | | StartPosition = FormStartPosition.CenterScreen; |
| | | Text = "管道匹配"; |
| | | ((ISupportInitialize)layoutControl1).EndInit(); |
| | | layoutControl1.ResumeLayout(false); |
| | | ((ISupportInitialize)Root).EndInit(); |
| | | ((ISupportInitialize)itemForCancel).EndInit(); |
| | | ((ISupportInitialize)itemForComplete).EndInit(); |
| | | ((ISupportInitialize)layoutControlItem1).EndInit(); |
| | | ((ISupportInitialize)emptySpaceItem1).EndInit(); |
| | | ((ISupportInitialize)itemForCancel).EndInit(); |
| | | ((ISupportInitialize)itemForComplete).EndInit(); |
| | | ResumeLayout(false); |
| | | } |
| | | |
| | |
| | | public ElbowSingMatchingDlg() |
| | | { |
| | | InitializeComponent(); |
| | | this.IconOptions.Icon = Yw.WinFrmUI.GlobalParas.AppIcon; |
| | | } |
| | | |
| | | public event Action<ElbowMatchingViewModel> ReloadDataEvent; |
| | |
| | | private void btnComplete_Click(object sender, EventArgs e) |
| | | { |
| | | ReloadDataEvent.Invoke(_ValveMatchingView); |
| | | this.Close(); |
| | | } |
| | | } |
| | | } |
| | |
| | | simpleLabelItem1 = new DevExpress.XtraLayout.SimpleLabelItem(); |
| | | layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem(); |
| | | layoutControlItem5 = new DevExpress.XtraLayout.LayoutControlItem(); |
| | | colConnectionLength = new DevExpress.XtraGrid.Columns.GridColumn(); |
| | | colAngle = new DevExpress.XtraGrid.Columns.GridColumn(); |
| | | ((ISupportInitialize)layoutControl1).BeginInit(); |
| | | layoutControl1.SuspendLayout(); |
| | | ((ISupportInitialize)gridControl3).BeginInit(); |
| | |
| | | layoutControl1.Name = "layoutControl1"; |
| | | layoutControl1.OptionsCustomizationForm.DesignTimeCustomizationFormPositionAndSize = new Rectangle(713, 300, 650, 400); |
| | | layoutControl1.Root = Root; |
| | | layoutControl1.Size = new Size(1343, 607); |
| | | layoutControl1.Size = new Size(769, 577); |
| | | layoutControl1.TabIndex = 0; |
| | | layoutControl1.Text = "layoutControl1"; |
| | | // |
| | |
| | | gridControl3.Location = new Point(2, 26); |
| | | gridControl3.MainView = gridView3; |
| | | gridControl3.Name = "gridControl3"; |
| | | gridControl3.Size = new Size(1339, 579); |
| | | gridControl3.Size = new Size(765, 549); |
| | | gridControl3.TabIndex = 4; |
| | | gridControl3.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { gridView3 }); |
| | | // |
| | |
| | | // |
| | | gridView3.Appearance.HeaderPanel.Options.UseTextOptions = true; |
| | | gridView3.Appearance.HeaderPanel.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; |
| | | gridView3.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] { colModelType, colMaterial, colCaliber, colMinorLoss }); |
| | | gridView3.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] { colModelType, colMaterial, colCaliber, colMinorLoss, colConnectionLength, colAngle }); |
| | | gridView3.GridControl = gridControl3; |
| | | gridView3.Name = "gridView3"; |
| | | gridView3.OptionsView.ShowGroupPanel = false; |
| | |
| | | colModelType.Name = "colModelType"; |
| | | colModelType.Visible = true; |
| | | colModelType.VisibleIndex = 0; |
| | | colModelType.Width = 243; |
| | | // |
| | | // colMaterial |
| | | // |
| | |
| | | colMaterial.Name = "colMaterial"; |
| | | colMaterial.Visible = true; |
| | | colMaterial.VisibleIndex = 1; |
| | | colMaterial.Width = 154; |
| | | // |
| | | // colCaliber |
| | | // |
| | |
| | | colCaliber.Name = "colCaliber"; |
| | | colCaliber.Visible = true; |
| | | colCaliber.VisibleIndex = 2; |
| | | colCaliber.Width = 141; |
| | | // |
| | | // colMinorLoss |
| | | // |
| | | colMinorLoss.FieldName = "MinorLoss"; |
| | | colMinorLoss.Name = "colMinorLoss"; |
| | | colMinorLoss.Visible = true; |
| | | colMinorLoss.VisibleIndex = 3; |
| | | colMinorLoss.VisibleIndex = 4; |
| | | colMinorLoss.Width = 165; |
| | | // |
| | | // searchControl1 |
| | | // |
| | | searchControl1.Location = new Point(59, 2); |
| | | searchControl1.Name = "searchControl1"; |
| | | searchControl1.Properties.Buttons.AddRange(new EditorButton[] { new DevExpress.XtraEditors.Repository.ClearButton(), new DevExpress.XtraEditors.Repository.SearchButton() }); |
| | | searchControl1.Size = new Size(387, 20); |
| | | searchControl1.Size = new Size(196, 20); |
| | | searchControl1.StyleController = layoutControl1; |
| | | searchControl1.TabIndex = 0; |
| | | // |
| | |
| | | Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { simpleLabelItem1, layoutControlItem1, layoutControlItem5 }); |
| | | Root.Name = "Root"; |
| | | Root.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); |
| | | Root.Size = new Size(1343, 607); |
| | | Root.Size = new Size(769, 577); |
| | | Root.TextVisible = false; |
| | | // |
| | | // simpleLabelItem1 |
| | | // |
| | | simpleLabelItem1.AllowHotTrack = false; |
| | | simpleLabelItem1.Location = new Point(448, 0); |
| | | simpleLabelItem1.Location = new Point(257, 0); |
| | | simpleLabelItem1.Name = "simpleLabelItem1"; |
| | | simpleLabelItem1.Size = new Size(895, 24); |
| | | simpleLabelItem1.Size = new Size(512, 24); |
| | | simpleLabelItem1.Text = " "; |
| | | simpleLabelItem1.TextSize = new Size(4, 14); |
| | | // |
| | |
| | | layoutControlItem1.Control = searchControl1; |
| | | layoutControlItem1.Location = new Point(0, 0); |
| | | layoutControlItem1.Name = "layoutControlItem1"; |
| | | layoutControlItem1.Size = new Size(448, 24); |
| | | layoutControlItem1.Size = new Size(257, 24); |
| | | layoutControlItem1.Text = "模糊搜索:"; |
| | | layoutControlItem1.TextAlignMode = DevExpress.XtraLayout.TextAlignModeItem.AutoSize; |
| | | layoutControlItem1.TextSize = new Size(52, 14); |
| | |
| | | layoutControlItem5.Control = gridControl3; |
| | | layoutControlItem5.Location = new Point(0, 24); |
| | | layoutControlItem5.Name = "layoutControlItem5"; |
| | | layoutControlItem5.Size = new Size(1343, 583); |
| | | layoutControlItem5.Size = new Size(769, 553); |
| | | layoutControlItem5.TextSize = new Size(0, 0); |
| | | layoutControlItem5.TextVisible = false; |
| | | // |
| | | // colConnectionLength |
| | | // |
| | | colConnectionLength.FieldName = "ConnectionLength"; |
| | | colConnectionLength.Name = "colConnectionLength"; |
| | | colConnectionLength.Visible = true; |
| | | colConnectionLength.VisibleIndex = 5; |
| | | colConnectionLength.Width = 182; |
| | | // |
| | | // colAngle |
| | | // |
| | | colAngle.FieldName = "Angle"; |
| | | colAngle.Name = "colAngle"; |
| | | colAngle.Visible = true; |
| | | colAngle.VisibleIndex = 3; |
| | | colAngle.Width = 121; |
| | | // |
| | | // ElbowSingleMatchingForm |
| | | // |
| | |
| | | AutoScaleMode = AutoScaleMode.Font; |
| | | Controls.Add(layoutControl1); |
| | | Name = "ElbowSingleMatchingForm"; |
| | | Size = new Size(1343, 607); |
| | | Size = new Size(769, 577); |
| | | ((ISupportInitialize)layoutControl1).EndInit(); |
| | | layoutControl1.ResumeLayout(false); |
| | | ((ISupportInitialize)gridControl3).EndInit(); |
| | |
| | | private DevExpress.XtraGrid.Columns.GridColumn colMaterial; |
| | | private DevExpress.XtraGrid.Columns.GridColumn colCaliber; |
| | | private DevExpress.XtraGrid.Columns.GridColumn colMinorLoss; |
| | | private DevExpress.XtraGrid.Columns.GridColumn colConnectionLength; |
| | | private DevExpress.XtraGrid.Columns.GridColumn colAngle; |
| | | } |
| | | } |
| | |
| | | public ElbowSingleMatchingForm() |
| | | { |
| | | InitializeComponent(); |
| | | this.gridView3.SetNormalView(); |
| | | } |
| | | |
| | | private ElbowMatchingViewModel _ElbowMatchingViewModel; |
| | |
| | | _ElbowMatchingViewModel.MatchingCaliber = vm.Caliber; |
| | | _ElbowMatchingViewModel.MatchingMaterial = vm.Material; |
| | | _ElbowMatchingViewModel.MatchingModelType = vm.ModelType; |
| | | _ElbowMatchingViewModel.MatchingAngle = vm.Angle; |
| | | _ElbowMatchingViewModel.MatchingConnectionLength = vm.ConnectionLength; |
| | | } |
| | | } |
| | | } |
| | |
| | | namespace HStation.WinFrmUI |
| | | using HStation.Assets; |
| | | |
| | | namespace HStation.WinFrmUI |
| | | { |
| | | public class ElbowSingleMatchingViewModel |
| | | { |
| | |
| | | this.Material = rhs.MaterialName; |
| | | this.ModelType = rhs.Name; |
| | | this.MinorLoss = rhs.Coefficient; |
| | | this.Angle = rhs.Angle; |
| | | this.ConnectionLength = rhs.ConnectionLength; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | [DisplayName("损失系数")] |
| | | [Browsable(true)] |
| | | public double? MinorLoss { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 管路连接长度 |
| | | /// </summary> |
| | | |
| | | [DisplayName("弯头类型")] |
| | | [Browsable(true)] |
| | | public eLengthType? ConnectionLength { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 角度 |
| | | /// </summary> |
| | | |
| | | [DisplayName("角度")] |
| | | [Browsable(true)] |
| | | public int? Angle { get; set; } |
| | | } |
| | | } |
| | |
| | | this.Material = rhs.Material; |
| | | this.Caliber = rhs.Caliber; |
| | | this.Code = rhs.Code; |
| | | this.Name = rhs.Name; |
| | | this.Dbid = rhs.DbId; |
| | | this.ModelType = rhs.ModelType; |
| | | this.MatchingCaliber = rhs.MatchingCaliber.ToString(); |
| | |
| | | private void InitializeComponent() |
| | | { |
| | | layoutControl1 = new DevExpress.XtraLayout.LayoutControl(); |
| | | ThreeLinkSingleMatchingForm1 = new ThreeLinkSingleMatchingForm(); |
| | | btnComplete = new SimpleButton(); |
| | | btnCancel = new SimpleButton(); |
| | | Root = new DevExpress.XtraLayout.LayoutControlGroup(); |
| | | itemForCancel = new DevExpress.XtraLayout.LayoutControlItem(); |
| | | itemForComplete = new DevExpress.XtraLayout.LayoutControlItem(); |
| | | ThreeLinkSingleMatchingForm1 = new ThreeLinkSingleMatchingForm(); |
| | | layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem(); |
| | | emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem(); |
| | | itemForCancel = new DevExpress.XtraLayout.LayoutControlItem(); |
| | | itemForComplete = new DevExpress.XtraLayout.LayoutControlItem(); |
| | | ((ISupportInitialize)layoutControl1).BeginInit(); |
| | | layoutControl1.SuspendLayout(); |
| | | ((ISupportInitialize)Root).BeginInit(); |
| | | ((ISupportInitialize)itemForCancel).BeginInit(); |
| | | ((ISupportInitialize)itemForComplete).BeginInit(); |
| | | ((ISupportInitialize)layoutControlItem1).BeginInit(); |
| | | ((ISupportInitialize)emptySpaceItem1).BeginInit(); |
| | | ((ISupportInitialize)itemForCancel).BeginInit(); |
| | | ((ISupportInitialize)itemForComplete).BeginInit(); |
| | | SuspendLayout(); |
| | | // |
| | | // layoutControl1 |
| | |
| | | layoutControl1.Size = new Size(747, 432); |
| | | layoutControl1.TabIndex = 6; |
| | | layoutControl1.Text = "layoutControl1"; |
| | | // |
| | | // ThreeLinkSingleMatchingForm1 |
| | | // |
| | | ThreeLinkSingleMatchingForm1.Location = new Point(2, 2); |
| | | ThreeLinkSingleMatchingForm1.Name = "ThreeLinkSingleMatchingForm1"; |
| | | ThreeLinkSingleMatchingForm1.Size = new Size(743, 402); |
| | | ThreeLinkSingleMatchingForm1.TabIndex = 0; |
| | | // |
| | | // btnComplete |
| | | // |
| | |
| | | // |
| | | // btnCancel |
| | | // |
| | | btnCancel.Appearance.BackColor = DevExpress.LookAndFeel.DXSkinColors.FillColors.Danger; |
| | | btnCancel.Appearance.BackColor = DevExpress.LookAndFeel.DXSkinColors.FillColors.Warning; |
| | | btnCancel.Appearance.Options.UseBackColor = true; |
| | | btnCancel.DialogResult = DialogResult.Cancel; |
| | | btnCancel.Location = new Point(641, 408); |
| | |
| | | Root.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); |
| | | Root.Size = new Size(747, 432); |
| | | Root.TextVisible = false; |
| | | // |
| | | // layoutControlItem1 |
| | | // |
| | | layoutControlItem1.Control = ThreeLinkSingleMatchingForm1; |
| | | layoutControlItem1.Location = new Point(0, 0); |
| | | layoutControlItem1.Name = "layoutControlItem1"; |
| | | layoutControlItem1.Size = new Size(747, 406); |
| | | layoutControlItem1.TextSize = new Size(0, 0); |
| | | layoutControlItem1.TextVisible = false; |
| | | // |
| | | // emptySpaceItem1 |
| | | // |
| | | emptySpaceItem1.AllowHotTrack = false; |
| | | emptySpaceItem1.Location = new Point(0, 406); |
| | | emptySpaceItem1.Name = "emptySpaceItem1"; |
| | | emptySpaceItem1.Size = new Size(531, 26); |
| | | emptySpaceItem1.TextSize = new Size(0, 0); |
| | | // |
| | | // itemForCancel |
| | | // |
| | |
| | | itemForComplete.TextSize = new Size(0, 0); |
| | | itemForComplete.TextVisible = false; |
| | | // |
| | | // ThreeLinkSingleMatchingForm1 |
| | | // |
| | | ThreeLinkSingleMatchingForm1.Location = new Point(2, 2); |
| | | ThreeLinkSingleMatchingForm1.Name = "pipeLineSingleMatchingForm1"; |
| | | ThreeLinkSingleMatchingForm1.Size = new Size(743, 402); |
| | | ThreeLinkSingleMatchingForm1.TabIndex = 0; |
| | | // |
| | | // layoutControlItem1 |
| | | // |
| | | layoutControlItem1.Control = ThreeLinkSingleMatchingForm1; |
| | | layoutControlItem1.Location = new Point(0, 0); |
| | | layoutControlItem1.Name = "layoutControlItem1"; |
| | | layoutControlItem1.Size = new Size(747, 406); |
| | | layoutControlItem1.TextSize = new Size(0, 0); |
| | | layoutControlItem1.TextVisible = false; |
| | | // |
| | | // emptySpaceItem1 |
| | | // |
| | | emptySpaceItem1.AllowHotTrack = false; |
| | | emptySpaceItem1.Location = new Point(0, 406); |
| | | emptySpaceItem1.Name = "emptySpaceItem1"; |
| | | emptySpaceItem1.Size = new Size(531, 26); |
| | | emptySpaceItem1.TextSize = new Size(0, 0); |
| | | // |
| | | // PipeSingMatchingDlg |
| | | // ThreeLinkSingMatchingDlg |
| | | // |
| | | AutoScaleDimensions = new SizeF(7F, 14F); |
| | | AutoScaleMode = AutoScaleMode.Font; |
| | | ClientSize = new Size(747, 432); |
| | | Controls.Add(layoutControl1); |
| | | Name = "PipeLineSingMatchingDlg"; |
| | | Name = "ThreeLinkSingMatchingDlg"; |
| | | StartPosition = FormStartPosition.CenterScreen; |
| | | Text = "管道匹配"; |
| | | ((ISupportInitialize)layoutControl1).EndInit(); |
| | | layoutControl1.ResumeLayout(false); |
| | | ((ISupportInitialize)Root).EndInit(); |
| | | ((ISupportInitialize)itemForCancel).EndInit(); |
| | | ((ISupportInitialize)itemForComplete).EndInit(); |
| | | ((ISupportInitialize)layoutControlItem1).EndInit(); |
| | | ((ISupportInitialize)emptySpaceItem1).EndInit(); |
| | | ((ISupportInitialize)itemForCancel).EndInit(); |
| | | ((ISupportInitialize)itemForComplete).EndInit(); |
| | | ResumeLayout(false); |
| | | } |
| | | |
| | |
| | | public ThreeLinkSingMatchingDlg() |
| | | { |
| | | InitializeComponent(); |
| | | this.IconOptions.Icon = Yw.WinFrmUI.GlobalParas.AppIcon; |
| | | } |
| | | |
| | | public event Action<ThreelinkMatchingViewModel> ReloadDataEvent; |
| | |
| | | private void btnComplete_Click(object sender, EventArgs e) |
| | | { |
| | | ReloadDataEvent.Invoke(_ValveMatchingView); |
| | | this.Close(); |
| | | } |
| | | } |
| | | } |
| | |
| | | public ThreeLinkSingleMatchingForm() |
| | | { |
| | | InitializeComponent(); |
| | | this.gridView3.SetNormalView(); |
| | | } |
| | | |
| | | private ThreelinkMatchingViewModel _pipeMatchingViewModel; |
| | |
| | | this.Caliber = rhs.Caliber; |
| | | this.Code = rhs.Code; |
| | | this.DbId = rhs.DbId; |
| | | this.Name = rhs.Name; |
| | | this.ModelType = rhs.ModelType; |
| | | this.MatchingCaliber = rhs.MatchingCaliber.ToString(); |
| | | this.MatchingMinorLoss = rhs.MatchingMinorLoss; |
| | |
| | | private void InitializeComponent() |
| | | { |
| | | layoutControl1 = new DevExpress.XtraLayout.LayoutControl(); |
| | | FourlinkSingleMatchingForm1 = new FourLinkSingleMatchingForm(); |
| | | btnComplete = new SimpleButton(); |
| | | btnCancel = new SimpleButton(); |
| | | Root = new DevExpress.XtraLayout.LayoutControlGroup(); |
| | | itemForCancel = new DevExpress.XtraLayout.LayoutControlItem(); |
| | | itemForComplete = new DevExpress.XtraLayout.LayoutControlItem(); |
| | | FourlinkSingleMatchingForm1 = new FourLinkSingleMatchingForm(); |
| | | layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem(); |
| | | emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem(); |
| | | itemForCancel = new DevExpress.XtraLayout.LayoutControlItem(); |
| | | itemForComplete = new DevExpress.XtraLayout.LayoutControlItem(); |
| | | ((ISupportInitialize)layoutControl1).BeginInit(); |
| | | layoutControl1.SuspendLayout(); |
| | | ((ISupportInitialize)Root).BeginInit(); |
| | | ((ISupportInitialize)itemForCancel).BeginInit(); |
| | | ((ISupportInitialize)itemForComplete).BeginInit(); |
| | | ((ISupportInitialize)layoutControlItem1).BeginInit(); |
| | | ((ISupportInitialize)emptySpaceItem1).BeginInit(); |
| | | ((ISupportInitialize)itemForCancel).BeginInit(); |
| | | ((ISupportInitialize)itemForComplete).BeginInit(); |
| | | SuspendLayout(); |
| | | // |
| | | // layoutControl1 |
| | |
| | | layoutControl1.Size = new Size(747, 432); |
| | | layoutControl1.TabIndex = 6; |
| | | layoutControl1.Text = "layoutControl1"; |
| | | // |
| | | // FourlinkSingleMatchingForm1 |
| | | // |
| | | FourlinkSingleMatchingForm1.Location = new Point(2, 2); |
| | | FourlinkSingleMatchingForm1.Name = "FourlinkSingleMatchingForm1"; |
| | | FourlinkSingleMatchingForm1.Size = new Size(743, 402); |
| | | FourlinkSingleMatchingForm1.TabIndex = 0; |
| | | // |
| | | // btnComplete |
| | | // |
| | |
| | | // |
| | | // btnCancel |
| | | // |
| | | btnCancel.Appearance.BackColor = DevExpress.LookAndFeel.DXSkinColors.FillColors.Danger; |
| | | btnCancel.Appearance.BackColor = DevExpress.LookAndFeel.DXSkinColors.FillColors.Warning; |
| | | btnCancel.Appearance.Options.UseBackColor = true; |
| | | btnCancel.DialogResult = DialogResult.Cancel; |
| | | btnCancel.Location = new Point(641, 408); |
| | |
| | | Root.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); |
| | | Root.Size = new Size(747, 432); |
| | | Root.TextVisible = false; |
| | | // |
| | | // layoutControlItem1 |
| | | // |
| | | layoutControlItem1.Control = FourlinkSingleMatchingForm1; |
| | | layoutControlItem1.Location = new Point(0, 0); |
| | | layoutControlItem1.Name = "layoutControlItem1"; |
| | | layoutControlItem1.Size = new Size(747, 406); |
| | | layoutControlItem1.TextSize = new Size(0, 0); |
| | | layoutControlItem1.TextVisible = false; |
| | | // |
| | | // emptySpaceItem1 |
| | | // |
| | | emptySpaceItem1.AllowHotTrack = false; |
| | | emptySpaceItem1.Location = new Point(0, 406); |
| | | emptySpaceItem1.Name = "emptySpaceItem1"; |
| | | emptySpaceItem1.Size = new Size(531, 26); |
| | | emptySpaceItem1.TextSize = new Size(0, 0); |
| | | // |
| | | // itemForCancel |
| | | // |
| | |
| | | itemForComplete.TextSize = new Size(0, 0); |
| | | itemForComplete.TextVisible = false; |
| | | // |
| | | // FourlinkSingleMatchingForm1 |
| | | // |
| | | FourlinkSingleMatchingForm1.Location = new Point(2, 2); |
| | | FourlinkSingleMatchingForm1.Name = "pipeLineSingleMatchingForm1"; |
| | | FourlinkSingleMatchingForm1.Size = new Size(743, 402); |
| | | FourlinkSingleMatchingForm1.TabIndex = 0; |
| | | // |
| | | // layoutControlItem1 |
| | | // |
| | | layoutControlItem1.Control = FourlinkSingleMatchingForm1; |
| | | layoutControlItem1.Location = new Point(0, 0); |
| | | layoutControlItem1.Name = "layoutControlItem1"; |
| | | layoutControlItem1.Size = new Size(747, 406); |
| | | layoutControlItem1.TextSize = new Size(0, 0); |
| | | layoutControlItem1.TextVisible = false; |
| | | // |
| | | // emptySpaceItem1 |
| | | // |
| | | emptySpaceItem1.AllowHotTrack = false; |
| | | emptySpaceItem1.Location = new Point(0, 406); |
| | | emptySpaceItem1.Name = "emptySpaceItem1"; |
| | | emptySpaceItem1.Size = new Size(531, 26); |
| | | emptySpaceItem1.TextSize = new Size(0, 0); |
| | | // |
| | | // PipeSingMatchingDlg |
| | | // FourLinkSingMatchingDlg |
| | | // |
| | | AutoScaleDimensions = new SizeF(7F, 14F); |
| | | AutoScaleMode = AutoScaleMode.Font; |
| | | ClientSize = new Size(747, 432); |
| | | Controls.Add(layoutControl1); |
| | | Name = "PipeLineSingMatchingDlg"; |
| | | Name = "FourLinkSingMatchingDlg"; |
| | | StartPosition = FormStartPosition.CenterScreen; |
| | | Text = "管道匹配"; |
| | | ((ISupportInitialize)layoutControl1).EndInit(); |
| | | layoutControl1.ResumeLayout(false); |
| | | ((ISupportInitialize)Root).EndInit(); |
| | | ((ISupportInitialize)itemForCancel).EndInit(); |
| | | ((ISupportInitialize)itemForComplete).EndInit(); |
| | | ((ISupportInitialize)layoutControlItem1).EndInit(); |
| | | ((ISupportInitialize)emptySpaceItem1).EndInit(); |
| | | ((ISupportInitialize)itemForCancel).EndInit(); |
| | | ((ISupportInitialize)itemForComplete).EndInit(); |
| | | ResumeLayout(false); |
| | | } |
| | | |
| | |
| | | public FourLinkSingMatchingDlg() |
| | | { |
| | | InitializeComponent(); |
| | | this.IconOptions.Icon = Yw.WinFrmUI.GlobalParas.AppIcon; |
| | | } |
| | | |
| | | public event Action<FourlinkMatchingViewModel> ReloadDataEvent; |
| | |
| | | private void btnComplete_Click(object sender, EventArgs e) |
| | | { |
| | | ReloadDataEvent.Invoke(_ValveMatchingView); |
| | | this.Close(); |
| | | } |
| | | } |
| | | } |
| | |
| | | public FourLinkSingleMatchingForm() |
| | | { |
| | | InitializeComponent(); |
| | | this.gridView3.SetNormalView(); |
| | | } |
| | | |
| | | private FourlinkMatchingViewModel _FourlinkMatchingViewModel; |
| | |
| | | this.Caliber = rhs.Caliber; |
| | | this.Code = rhs.Code; |
| | | this.Dbid = rhs.DbId; |
| | | this.Name = rhs.Name; |
| | | this.ModelType = rhs.ModelType; |
| | | this.MatchingCaliber = rhs.MatchingCaliber.ToString(); |
| | | this.MatchingMinorLoss = rhs.MatchingMinorLoss; |