105040 Fix 动力刹车线逻辑

This commit is contained in:
lihanbo 2024-12-23 12:04:21 +08:00
parent 9ffe8c8080
commit 5b11cae2cd
2 changed files with 7 additions and 5 deletions

View File

@ -102,7 +102,7 @@
Width="100" Width="100"
VerticalAlignment="Center" VerticalAlignment="Center"
Text="线材链接方式:" /> Text="线材链接方式:" />
<hc:ButtonGroup Width="263" Style="{StaticResource ButtonGroupSolid}"> <hc:ButtonGroup Width="263" Style="{StaticResource ButtonGroupSolid}" >
<RadioButton Content="直通" IsChecked="{Binding CableConnectionType, Converter={StaticResource ConnectionTypeConverter}, ConverterParameter={x:Static enum:ConnectionType.Passthrough}}" /> <RadioButton Content="直通" IsChecked="{Binding CableConnectionType, Converter={StaticResource ConnectionTypeConverter}, ConverterParameter={x:Static enum:ConnectionType.Passthrough}}" />
<RadioButton Content="全段" IsChecked="{Binding CableConnectionType, Converter={StaticResource ConnectionTypeConverter}, ConverterParameter={x:Static enum:ConnectionType.FullParagraph}}" /> <RadioButton Content="全段" IsChecked="{Binding CableConnectionType, Converter={StaticResource ConnectionTypeConverter}, ConverterParameter={x:Static enum:ConnectionType.FullParagraph}}" />
</hc:ButtonGroup> </hc:ButtonGroup>

View File

@ -1,5 +1,6 @@
using HandyControl.Controls; using HandyControl.Controls;
using Sinvo.EplanHpD.Plugin.Service; using Sinvo.EplanHpD.Plugin.Service;
using Sinvo.EplanHpD.Plugin.Service.Model;
using Sinvo.EplanHpD.Plugin.WPFUI.Enum; using Sinvo.EplanHpD.Plugin.WPFUI.Enum;
using Sinvo.EplanHpD.Plugin.WPFUI.Models; using Sinvo.EplanHpD.Plugin.WPFUI.Models;
using Sinvo.EplanHpD.Plugin.WPFUI.Utils; using Sinvo.EplanHpD.Plugin.WPFUI.Utils;
@ -8,6 +9,7 @@ using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Linq; using System.Linq;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices.WindowsRuntime;
using System.Security.Cryptography.X509Certificates; using System.Security.Cryptography.X509Certificates;
using System.Security.RightsManagement; using System.Security.RightsManagement;
using System.Windows.Shapes; using System.Windows.Shapes;
@ -106,7 +108,7 @@ public class CableLectotypeViewModel : INotifyPropertyChanged
//DrawingNo = DrawingNo, //DrawingNo = DrawingNo,
//CableModelNo = CableModelNo, //CableModelNo = CableModelNo,
CableConnectionClass = cableConnectionType, CableConnectionClass = cableConnectionType,
CableType = "动力线", CableType = CableType.Contains("刹车") ? "动力刹车线" : "动力线",
LineCount = PowerLineParagraph, LineCount = PowerLineParagraph,
//PowerLineLength = PowerLineLength, //PowerLineLength = PowerLineLength,
//CurrentLineNumber = i, //CurrentLineNumber = i,
@ -331,10 +333,10 @@ public class CableLectotypeViewModel : INotifyPropertyChanged
public bool SaveToDb() public bool SaveToDb()
{ {
var id = Motor.OccPartId;
var json = Newtonsoft.Json.JsonConvert.SerializeObject(this);
var service = new MotorLectotypeService(); var service = new MotorLectotypeService();
return service.SaveMotorLectotypeData(id, json); // 查找或添加 Motor
return service.SaveMotorLectotypeData(Motor.OccPartId, this);
} }
public event PropertyChangedEventHandler PropertyChanged; public event PropertyChangedEventHandler PropertyChanged;