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: AssemblyVersion("1.0.0.20")]
[assembly: AssemblyFileVersion("1.0.0.19")] [assembly: AssemblyFileVersion("1.0.0.20")]
[assembly: AssemblyInformationalVersion("1.0.0.19")] [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.Row="0"
Grid.RowSpan="2" Grid.RowSpan="2"
Grid.Column="1" Grid.Column="1"
Click="ToMotorBtn_Click"
Content="转到电机" Content="转到电机"
Style="{StaticResource ButtonPrimary}" /> Style="{StaticResource ButtonPrimary}" />
</Grid> </Grid>
@ -110,11 +111,12 @@
Width="80" Width="80"
DisplayMemberBinding="{Binding CableType}" DisplayMemberBinding="{Binding CableType}"
Header="线类型" /> Header="线类型" />
<GridViewColumn Header="线型号"> <GridViewColumn Width="330" Header="线型号">
<GridViewColumn.CellTemplate> <GridViewColumn.CellTemplate>
<DataTemplate> <DataTemplate>
<TextBox <TextBox
MaxWidth="230" Width="300"
MaxWidth="300"
GotFocus="TextBox_GotFocus" GotFocus="TextBox_GotFocus"
IsReadOnly="True" IsReadOnly="True"
Text="{Binding CableModel}" /> Text="{Binding CableModel}" />

View File

@ -8,8 +8,10 @@ using EPLAN.Harness.Core.Controls;
using EPLAN.Harness.Core.UIFactory; using EPLAN.Harness.Core.UIFactory;
using EPLAN.Harness.Primitives.ActionControls; using EPLAN.Harness.Primitives.ActionControls;
using EPLAN.Harness.ProjectCore; using EPLAN.Harness.ProjectCore;
using EPLAN.Harness.ProjectCore.Occurrences;
using EPLAN.Harness.ProjectCore.Occurrences.Designer; using EPLAN.Harness.ProjectCore.Occurrences.Designer;
using HandyControl.Controls; using HandyControl.Controls;
using Sinvo.EplanHpD.Plugin.WPFUI.Utils;
using Sinvo.EplanHpD.Plugin.WPFUI.ViewModel; using Sinvo.EplanHpD.Plugin.WPFUI.ViewModel;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -163,5 +165,33 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.View
return _currentFlexDesigner.CurrentView.UserControlFactory_Create<CmdD3DPlaceCableForked.IForkedCableControl>(UIObject.ctrl_Designer_ForkedPathPlace, new object[] { side }); 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

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

View File

@ -216,7 +216,7 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel
cableLectotypeViewModel = data; cableLectotypeViewModel = data;
if (cableLectotypeViewModel?.SelectedLines?.Any() ?? false) if (cableLectotypeViewModel?.SelectedLines?.Any() ?? false)
{ {
SelectedLines = cableLectotypeViewModel.SelectedLines; SelectedLines = cableLectotypeViewModel.SelectedLines.OrderBy(it => it.CableType).ThenBy(it => it.CurrentLine).ToList();
SelectedLine = SelectedLines[CurrentMotorSelectLineIndex]; SelectedLine = SelectedLines[CurrentMotorSelectLineIndex];
ReSetSubLines(); ReSetSubLines();
Motor = cableLectotypeViewModel.Motor; Motor = cableLectotypeViewModel.Motor;
@ -329,7 +329,7 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel
{ {
subLine.IsChecked = true; subLine.IsChecked = true;
//cableLectotypeViewModel.SaveToDb(); //cableLectotypeViewModel.SaveToDb();
SetSubLineAndSave(subLine.CableLectotypeId); SetSubLineAndSave(subLine.LectotypeLineId);
return SubLines.All(it => it.IsChecked); return SubLines.All(it => it.IsChecked);
} }
else else
@ -386,9 +386,11 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel
{ {
SubLines = SelectedLine.SubLines.Distinct(it => it.CableModel).ToList(); 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: AssemblyVersion("1.0.0.20")]
[assembly: AssemblyFileVersion("1.0.0.19")] [assembly: AssemblyFileVersion("1.0.0.20")]
[assembly: AssemblyInformationalVersion("1.0.0.19")] [assembly: AssemblyInformationalVersion("1.0.0.20-rls")]