105040 Remove 移除未使用的函数;布线助手增加转至电机功能;抓取BOM中型号时增加包含刹车线;

This commit is contained in:
lihanbo 2025-01-13 17:16:25 +08:00
parent cbda1c9f8f
commit 8342f4dd09
7 changed files with 51 additions and 40 deletions

View File

@ -46,6 +46,6 @@ using System.Windows;
// 生成号
// 修订号
//
[assembly: AssemblyVersion("1.0.0.19")]
[assembly: AssemblyFileVersion("1.0.0.19")]
[assembly: AssemblyInformationalVersion("1.0.0.19")]
[assembly: AssemblyVersion("1.0.0.20")]
[assembly: AssemblyFileVersion("1.0.0.20")]
[assembly: AssemblyInformationalVersion("1.0.0.20-rls")]

View File

@ -147,29 +147,6 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.View
}
}
public void ToMotorSource(string motorId)
{
try
{
if (string.IsNullOrEmpty(LectotypeManager.CURRENT_DOC_ID)) return;
var doc = FlexProject.CurrentProject.GetDesigners().FirstOrDefault(designer => designer.ID == LectotypeManager.CURRENT_DOC_ID);
var part = doc.GetOccurrenceByID(motorId);
//var cable = doc.GetOccurrenceByName(cableName, typeof(OccCableForked));
if (part != null)
{
doc.SelectSet.Clear();
var oriOcc = SelfControler<BaseOccurrence>.FindInstance(part.ID);
oriOcc.SetVisibility(true, null);
doc.SelectSet.Add(oriOcc);
doc.FitToSelectSet();
doc.SelectSet.OnSelectionChanged();
}
}
catch (Exception ex)
{
FlexMessageBox.Error(ex.Message);
}
}
}
}

View File

@ -86,6 +86,7 @@
Grid.Row="0"
Grid.RowSpan="2"
Grid.Column="1"
Click="ToMotorBtn_Click"
Content="转到电机"
Style="{StaticResource ButtonPrimary}" />
</Grid>
@ -110,11 +111,12 @@
Width="80"
DisplayMemberBinding="{Binding CableType}"
Header="线类型" />
<GridViewColumn Header="线型号">
<GridViewColumn Width="330" Header="线型号">
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBox
MaxWidth="230"
Width="300"
MaxWidth="300"
GotFocus="TextBox_GotFocus"
IsReadOnly="True"
Text="{Binding CableModel}" />

View File

@ -8,8 +8,10 @@ using EPLAN.Harness.Core.Controls;
using EPLAN.Harness.Core.UIFactory;
using EPLAN.Harness.Primitives.ActionControls;
using EPLAN.Harness.ProjectCore;
using EPLAN.Harness.ProjectCore.Occurrences;
using EPLAN.Harness.ProjectCore.Occurrences.Designer;
using HandyControl.Controls;
using Sinvo.EplanHpD.Plugin.WPFUI.Utils;
using Sinvo.EplanHpD.Plugin.WPFUI.ViewModel;
using System;
using System.Collections.Generic;
@ -162,6 +164,34 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.View
{
return _currentFlexDesigner.CurrentView.UserControlFactory_Create<CmdD3DPlaceCableForked.IForkedCableControl>(UIObject.ctrl_Designer_ForkedPathPlace, new object[] { side });
}
private void ToMotorBtn_Click(object sender, RoutedEventArgs e)
{
ToMotorSource(viewModel.Motor.OccPartId);
}
public void ToMotorSource(string motorId)
{
try
{
if (string.IsNullOrEmpty(LectotypeManager.CURRENT_DOC_ID)) return;
var doc = FlexProject.CurrentProject.GetDesigners().FirstOrDefault(designer => designer.ID == LectotypeManager.CURRENT_DOC_ID);
var part = doc.GetOccurrenceByID(motorId);
//var cable = doc.GetOccurrenceByName(cableName, typeof(OccCableForked));
if (part != null)
{
doc.SelectSet.Clear();
var oriOcc = SelfControler<BaseOccurrence>.FindInstance(part.ID);
oriOcc.SetVisibility(true, null);
doc.SelectSet.Add(oriOcc);
doc.FitToSelectSet();
doc.SelectSet.OnSelectionChanged();
}
}
catch (Exception ex)
{
FlexMessageBox.Error(ex.Message);
}
}
}
}

View File

@ -177,8 +177,7 @@ public class CableLectotypeViewModel : INotifyPropertyChanged
//CurrentLineNumber = i,
CurrentLine = i,
Motor = Motor,
IsLectotype = true
IsLectotype = true
//CableFlag = GetCableModelFlag(MotorPower, PowerLineName, cableConnectionType, false)
};
powerLine.DrawingNo = powerLine.GetCableDrawNo();
@ -232,7 +231,8 @@ public class CableLectotypeViewModel : INotifyPropertyChanged
{
return MotorExcelHelper.Instance.GetBomList(drawingNo).Where(it =>
{
return it.Name == "编码器线" || it.Name == "动力线";
// BOM表中只有 编码器线 和 动力线 不区分是不是带刹车
return it.Name == "编码器线" || it.Name == "动力线" || it.Name == "刹车线";
}).Select(it => new LectotypeLineModel
{
SeqNo = 0,

View File

@ -216,7 +216,7 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel
cableLectotypeViewModel = data;
if (cableLectotypeViewModel?.SelectedLines?.Any() ?? false)
{
SelectedLines = cableLectotypeViewModel.SelectedLines;
SelectedLines = cableLectotypeViewModel.SelectedLines.OrderBy(it => it.CableType).ThenBy(it => it.CurrentLine).ToList();
SelectedLine = SelectedLines[CurrentMotorSelectLineIndex];
ReSetSubLines();
Motor = cableLectotypeViewModel.Motor;
@ -329,7 +329,7 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel
{
subLine.IsChecked = true;
//cableLectotypeViewModel.SaveToDb();
SetSubLineAndSave(subLine.CableLectotypeId);
SetSubLineAndSave(subLine.LectotypeLineId);
return SubLines.All(it => it.IsChecked);
}
else
@ -386,9 +386,11 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel
{
SubLines = SelectedLine.SubLines.Distinct(it => it.CableModel).ToList();
}
internal void SetSubLineAndSave(string cableLectotypeId)
internal void SetSubLineAndSave(string lectotypeLineId)
{
var motorId = Motor.OccPartId;
var service = new MotorLectotypeService();
service.SetLineDone(motorId, lectotypeLineId);
}
}
}

View File

@ -28,6 +28,6 @@ using System.Runtime.InteropServices;
// 生成号
// 修订号
//
[assembly: AssemblyVersion("1.0.0.19")]
[assembly: AssemblyFileVersion("1.0.0.19")]
[assembly: AssemblyInformationalVersion("1.0.0.19")]
[assembly: AssemblyVersion("1.0.0.20")]
[assembly: AssemblyFileVersion("1.0.0.20")]
[assembly: AssemblyInformationalVersion("1.0.0.20-rls")]