布置图输入值改成可输入的下拉框,ini操作异常修改,布置图加载修改
This commit is contained in:
parent
93967b9e1d
commit
4eddfe1f59
Binary file not shown.
@ -69,9 +69,9 @@ namespace DI_Electrical.ViewModels
|
||||
MessageBox.Show("本地文件目录不存在。");
|
||||
return;
|
||||
}
|
||||
var data = _configService.parser.ReadFile(_configService.path);
|
||||
//var data = _configService.parser.ReadFile(_configService.path);
|
||||
|
||||
_configService._httpService.Init(address, port);
|
||||
//_configService._httpService.Init(address, port);
|
||||
IsBusy = true;
|
||||
BusyContent = "保存中...";
|
||||
var testRes = await _LoginService.Login("1", "11");
|
||||
@ -85,10 +85,17 @@ namespace DI_Electrical.ViewModels
|
||||
{
|
||||
address = address.Replace("https://", "").Replace("http://", "");
|
||||
}
|
||||
data["Profile"]["Address"] = address;
|
||||
data["Profile"]["Port"] = port.ToString();
|
||||
data["Profile"]["Directory"] = _directory;
|
||||
_configService.parser.WriteFile(_configService.path, data);
|
||||
//data["Profile"]["Address"] = address;
|
||||
//data["Profile"]["Port"] = port.ToString();
|
||||
//data["Profile"]["Directory"] = _directory;
|
||||
//_configService.parser.WriteFile(_configService.path, data);
|
||||
|
||||
//IniHelper.WriteValueFromIniFile("Profile", "strIPAddress", address);
|
||||
//IniHelper.WriteValueFromIniFile("Profile", "nPort", port.ToString());
|
||||
//IniHelper.WriteValueFromIniFile("Profile", "strLocalWorkDir", _directory);
|
||||
_configService.Save("Profile", "strIPAddress", address);
|
||||
_configService.Save("Profile", "nPort", port.ToString());
|
||||
_configService.Save("Profile", "strLocalWorkDir", _directory);
|
||||
GlobalObject.isConfigIniCreateBySys = false;
|
||||
GlobalObject.SetLocalFileDirectory(_directory);
|
||||
|
||||
|
@ -73,7 +73,7 @@ namespace DI_Electrical.ViewModels
|
||||
containerProvider = container;
|
||||
if (GlobalObject.isConfigIniCreateBySys)
|
||||
{
|
||||
var config= container.Resolve<Config>();
|
||||
var config = container.Resolve<Config>();
|
||||
config.ShowDialog();
|
||||
}
|
||||
|
||||
@ -91,14 +91,14 @@ namespace DI_Electrical.ViewModels
|
||||
{
|
||||
sPASSWORD = GlobalObject.userInfo.userPs;
|
||||
}
|
||||
curServer = "当前服务器: " + _configService.Read(nameof(ConfigIni.Address)) + ":" + _configService.Read(nameof(ConfigIni.Port));
|
||||
curServer = "当前服务器: " + _configService.Read("strIPAddress") + ":" + _configService.Read("nPort");
|
||||
|
||||
}
|
||||
public void onConfig(object o)
|
||||
{
|
||||
var config = containerProvider.Resolve<Config>();
|
||||
config.ShowDialog();
|
||||
curServer = "当前服务器: " + _configService.Read(nameof(ConfigIni.Address)) + ":" + _configService.Read(nameof(ConfigIni.Port));
|
||||
curServer = "当前服务器: " + _configService.Read("strIPAddress") + ":" + _configService.Read("nPort");
|
||||
|
||||
}
|
||||
public override async void ExecuteOKCommandAsync(object obj)
|
||||
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@ -5,6 +5,6 @@
|
||||
<StartProgram>D:\Program Files\KunHeng\KunHengCAD V21 zh_CN\kunhengcad.exe</StartProgram>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ProjectView>ShowAllFiles</ProjectView>
|
||||
<ProjectView>ProjectFiles</ProjectView>
|
||||
</PropertyGroup>
|
||||
</Project>
|
@ -70,7 +70,6 @@ namespace SWS.CAD.ViewModels
|
||||
Application.ShowAlertDialog("本地文件目录不存在。");
|
||||
return;
|
||||
}
|
||||
var data = _configService.parser.ReadFile(_configService.path);
|
||||
|
||||
_configService._httpService.Init(address, port);
|
||||
IsBusy = true;
|
||||
@ -85,10 +84,14 @@ namespace SWS.CAD.ViewModels
|
||||
{
|
||||
address = address.Replace("https://", "").Replace("http://", "");
|
||||
}
|
||||
data["Profile"]["Address"] = address;
|
||||
data["Profile"]["Port"] = port.ToString();
|
||||
data["Profile"]["Directory"] = _directory;
|
||||
_configService.parser.WriteFile(_configService.path, data);
|
||||
//var data = _configService.parser.ReadFile(_configService.path);
|
||||
//data["Profile"]["Address"] = address;
|
||||
//data["Profile"]["Port"] = port.ToString();
|
||||
//data["Profile"]["Directory"] = _directory;
|
||||
//_configService.parser.WriteFile(_configService.path, data);
|
||||
_configService.Save("Profile", "strIPAddress", address);
|
||||
_configService.Save("Profile", "nPort", port.ToString());
|
||||
_configService.Save("Profile", "strLocalWorkDir", _directory);
|
||||
GlobalObject.isConfigIniCreateBySys = false;
|
||||
GlobalObject.SetLocalFileDirectory(_directory);
|
||||
|
||||
|
@ -92,7 +92,7 @@ namespace SWS.CAD.ViewModels
|
||||
{
|
||||
sPASSWORD = GlobalObject.userInfo.userPs;
|
||||
}
|
||||
curServer = "当前服务器: " + _configService.Read(nameof(ConfigIni.Address)) + ":" + _configService.Read(nameof(ConfigIni.Port));
|
||||
curServer = "当前服务器: " + _configService.Read("strIPAddress") + ":" + _configService.Read("nPort");
|
||||
}
|
||||
public override async void ExecuteOKCommandAsync(object obj)
|
||||
{
|
||||
|
@ -1457,8 +1457,7 @@
|
||||
<ControlTemplate.Triggers>
|
||||
<!-- 按钮禁用 -->
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter TargetName="PART_Icon" Property="Fill"
|
||||
Value="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}"/>
|
||||
<Setter TargetName="PART_Icon" Property="Fill" Value="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="border" Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlLightBrushKey}}" />
|
||||
|
@ -154,10 +154,11 @@ namespace SWS.Commons
|
||||
{
|
||||
if (string.IsNullOrEmpty(_LocalFileDirectory))
|
||||
{
|
||||
string path = configPath;
|
||||
FileIniDataParser parser = new FileIniDataParser();
|
||||
var data = parser.ReadFile(path);
|
||||
_LocalFileDirectory = data["Profile"]["strLocalWorkDir"];
|
||||
//string path = configPath;
|
||||
//FileIniDataParser parser = new FileIniDataParser();
|
||||
//var data = parser.ReadFile(path);
|
||||
//_LocalFileDirectory = data["Profile"]["strLocalWorkDir"];
|
||||
_LocalFileDirectory = IniHelper.ReadValueFromIniFile("Profile", "strLocalWorkDir");
|
||||
return _LocalFileDirectory;
|
||||
}
|
||||
else
|
||||
|
56
newFront/c#前端/SWS.Commons/Helper/IniHelper.cs
Normal file
56
newFront/c#前端/SWS.Commons/Helper/IniHelper.cs
Normal file
@ -0,0 +1,56 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SWS.Commons
|
||||
{
|
||||
public static class IniHelper
|
||||
{
|
||||
[DllImport("kernel32", CharSet = CharSet.Unicode)]
|
||||
private static extern long WritePrivateProfileString(string section, string key, string val, string filePath);
|
||||
[DllImport("kernel32", CharSet = CharSet.Unicode)]
|
||||
private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);
|
||||
|
||||
/// <summary>
|
||||
///读取ini文件数据
|
||||
/// </summary>
|
||||
/// <param name="Section">段</param>
|
||||
/// <param name="Key">键名</param>
|
||||
/// <param name="def">默认值</param>
|
||||
/// <param name="filePath">文件路径</param>
|
||||
/// <returns>读出内容</returns>
|
||||
public static string ReadValueFromIniFile(string Section, string Key, string def=null, string filePath= null)
|
||||
{
|
||||
if (def == null)
|
||||
{ def = ""; }
|
||||
if (filePath == null)
|
||||
{
|
||||
filePath = GlobalObject.configPath;
|
||||
}
|
||||
StringBuilder temp = new StringBuilder(4096);
|
||||
int i = GetPrivateProfileString(Section, Key, def, temp, 4096, filePath);
|
||||
return temp.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 写入数据到ini文件
|
||||
/// </summary>
|
||||
/// <param name="Section">段</param>
|
||||
/// <param name="Key">键名</param>
|
||||
/// <param name="Value">键值</param>
|
||||
/// <param name="filePath">文件路径</param>
|
||||
public static void WriteValueFromIniFile(string Section, string Key, string Value, string filePath = null)
|
||||
{
|
||||
if (filePath == null)
|
||||
{
|
||||
filePath = GlobalObject.configPath;
|
||||
}
|
||||
WritePrivateProfileString(Section, Key, Value, filePath);
|
||||
}
|
||||
}
|
||||
}
|
@ -24,6 +24,8 @@ namespace SWS.Commons
|
||||
string dllPath = codeBase.Replace("file:///", "");
|
||||
dllPath = Path.GetDirectoryName(dllPath);
|
||||
logPath = Path.Combine(dllPath, "Logs\\");
|
||||
if (!Directory.Exists(logPath))
|
||||
{ Directory.CreateDirectory(logPath); }
|
||||
var configFile = new FileInfo(Path.Combine(dllPath, "log4net.config"));
|
||||
log4net.Config.XmlConfigurator.ConfigureAndWatch(configFile);
|
||||
}
|
||||
|
@ -110,6 +110,7 @@
|
||||
<Compile Include="Helper\Converter\RadGridViewRowToBoolConverter.cs" />
|
||||
<Compile Include="Helper\Converter\ColumnValueConverter.cs" />
|
||||
<Compile Include="Helper\Converter\StatusToColourConverter.cs" />
|
||||
<Compile Include="Helper\IniHelper.cs" />
|
||||
<Compile Include="Helper\FileHelper.cs" />
|
||||
<Compile Include="Helper\LoggerHelper.cs" />
|
||||
<Compile Include="Helper\PasswordHelper.cs" />
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectView>ShowAllFiles</ProjectView>
|
||||
<ProjectView>ProjectFiles</ProjectView>
|
||||
</PropertyGroup>
|
||||
</Project>
|
@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
@ -11,6 +12,7 @@ using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
using IniParser;
|
||||
using IniParser.Model;
|
||||
using Newtonsoft.Json;
|
||||
using Prism.Ioc;
|
||||
using SWS.Commons;
|
||||
@ -41,17 +43,29 @@ namespace SWS.Electrical
|
||||
{
|
||||
try
|
||||
{
|
||||
var data = configIni.ReadFile(GlobalObject.configPath);
|
||||
string token = data["LoginInfo"]["LoginToken"];
|
||||
string loginkey = data["LoginInfo"]["LoginMark"];
|
||||
string curProjId = data["LoginInfo"]["CurProjId"];
|
||||
LocalWorkDir= data["Profile"]["strLocalWorkDir"];
|
||||
string address = data["Profile"]["strIPAddress"];
|
||||
string port = data["Profile"]["nPort"];
|
||||
string dbType = data["Profile"]["nConType"];
|
||||
//var parser = new FileIniDataParser();
|
||||
//string[] lines = File.ReadAllLines(GlobalObject.configPath);
|
||||
//IniData data = parser.Parser.Parse(File.ReadAllText(GlobalObject.configPath));
|
||||
//var data = configIni.ReadFile(GlobalObject.configPath);
|
||||
//string token = data["LoginInfo"]["LoginToken"];
|
||||
//string loginkey = data["LoginInfo"]["LoginMark"];
|
||||
//string curProjId = data["LoginInfo"]["CurProjId"];
|
||||
//LocalWorkDir= data["Profile"]["strLocalWorkDir"];
|
||||
//string address = data["Profile"]["strIPAddress"];
|
||||
//string port = data["Profile"]["nPort"];
|
||||
//string dbType = data["Profile"]["nConType"];
|
||||
//string domain= data["Profile"]["strDomainName"];
|
||||
string token = IniHelper.ReadValueFromIniFile("LoginInfo", "LoginToken");
|
||||
string loginkey = IniHelper.ReadValueFromIniFile("LoginInfo", "LoginMark");
|
||||
string curProjId = IniHelper.ReadValueFromIniFile("LoginInfo", "CurProjId");
|
||||
LocalWorkDir = IniHelper.ReadValueFromIniFile("Profile", "strLocalWorkDir");
|
||||
string address = IniHelper.ReadValueFromIniFile("Profile", "strIPAddress");
|
||||
string port = IniHelper.ReadValueFromIniFile("Profile", "nPort");
|
||||
string dbType = IniHelper.ReadValueFromIniFile("Profile", "nConType");
|
||||
string domain = IniHelper.ReadValueFromIniFile("Profile", "strDomainName");
|
||||
if (dbType == "1")
|
||||
{
|
||||
string strDomain = data["Profile"]["strDomainName"];
|
||||
string strDomain = domain;
|
||||
GlobalObject.client = new HttpClient()
|
||||
{
|
||||
BaseAddress = new Uri($"{strDomain}/api/"),
|
||||
|
@ -153,6 +153,7 @@
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
<None Include="packages.config" />
|
||||
<None Include="配置说明.docx" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\SWS.CAD.Base\SWS.CAD.Base.csproj">
|
||||
|
@ -130,6 +130,7 @@ namespace SWS.Electrical.ViewModels
|
||||
if (value != this._selectRange)
|
||||
{
|
||||
this._selectRange = value;
|
||||
RangeChange(value);
|
||||
RaisePropertyChanged(nameof(selectRange));
|
||||
}
|
||||
}
|
||||
@ -167,6 +168,22 @@ namespace SWS.Electrical.ViewModels
|
||||
}
|
||||
}
|
||||
}
|
||||
private ObservableCollection<KeyValueModel> _listValue;
|
||||
/// <summary>
|
||||
/// 输入值 列表
|
||||
/// </summary>
|
||||
public ObservableCollection<KeyValueModel> listValue
|
||||
{
|
||||
get { return this._listValue; }
|
||||
set
|
||||
{
|
||||
if (value != this._listValue)
|
||||
{
|
||||
this._listValue = value;
|
||||
RaisePropertyChanged(nameof(listValue));
|
||||
}
|
||||
}
|
||||
}
|
||||
private string _inputValue = "";
|
||||
/// <summary>
|
||||
/// 输入值
|
||||
@ -195,11 +212,15 @@ namespace SWS.Electrical.ViewModels
|
||||
EnginedataService _ServiceEnginedata;
|
||||
ObjectTypeService _ServiceObjectType;
|
||||
ProjectSettingsService _ServiceProjectSettings;
|
||||
DataItemService _ServiceDataItem;
|
||||
List<string> listTagNumberSucc = new List<string>();
|
||||
private bool isSearch = false;//是否正在查询
|
||||
private bool isDrawing = false;//是否正在画图
|
||||
private string dwgName = string.Empty;
|
||||
private List<string> listLibraryTagName = new List<string>();//元件图纸上的位号属性名称,
|
||||
private List<KeyValueModel> listDeck=new List<KeyValueModel>();//甲板号值列表
|
||||
private List<KeyValueModel> listArea = new List<KeyValueModel>();//区域值列表
|
||||
private List<KeyValueModel> listSystem = new List<KeyValueModel>();//所属系统值列表
|
||||
public DialogAutoArrangeLayoutViewModel()
|
||||
{
|
||||
Command_StartDrawing = new DelegateCommand(onStartDrawing);
|
||||
@ -215,6 +236,7 @@ namespace SWS.Electrical.ViewModels
|
||||
_ServiceEnginedata = GlobalObject.container.Resolve<EnginedataService>();
|
||||
_ServiceObjectType = GlobalObject.container.Resolve<ObjectTypeService>();
|
||||
_ServiceProjectSettings = GlobalObject.container.Resolve<ProjectSettingsService>();
|
||||
_ServiceDataItem= GlobalObject.container.Resolve<DataItemService>();
|
||||
listDrawings = new ObservableCollection<DtoDrawing>();
|
||||
listBasePoint = new ObservableCollection<DtoAutoPlotLayout>();
|
||||
listMsg = new ObservableCollection<TextBlock>();
|
||||
@ -223,7 +245,6 @@ namespace SWS.Electrical.ViewModels
|
||||
list.Add(new KeyValueModel { Key = "区域", Value = "区域" });
|
||||
list.Add(new KeyValueModel { Key = "所属系统", Value = "所属系统" });
|
||||
listRange = new ObservableCollection<KeyValueModel>(list);
|
||||
selectRange = listRange[0];
|
||||
listOperator = new ObservableCollection<KeyValueModel>()
|
||||
{ new KeyValueModel { Key = "等于", Value = "=" }
|
||||
};
|
||||
@ -243,7 +264,33 @@ namespace SWS.Electrical.ViewModels
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private List<TreeModel> GetChildNodes(TreeModel treeModel)
|
||||
{
|
||||
List<TreeModel> listModel = new List<TreeModel>();
|
||||
if (treeModel.ChildNodes != null && treeModel.ChildNodes.Any())
|
||||
{
|
||||
foreach (var item in treeModel.ChildNodes)
|
||||
{
|
||||
if (item.NodeType == "1")
|
||||
{
|
||||
listModel.Add(item);
|
||||
}
|
||||
else
|
||||
{
|
||||
var list = GetChildNodes(item);
|
||||
if (list.Any())
|
||||
{
|
||||
listModel.AddRange(list);
|
||||
}
|
||||
}
|
||||
}
|
||||
return listModel;
|
||||
}
|
||||
else
|
||||
{
|
||||
return listModel;
|
||||
}
|
||||
}
|
||||
public async void OnDialogOpened(IDialogParameters parameters)
|
||||
{
|
||||
try
|
||||
@ -259,8 +306,19 @@ namespace SWS.Electrical.ViewModels
|
||||
if (item.NodeType == "1")
|
||||
{
|
||||
listDrawings.Add(new DtoDrawing() { DrawingFileID = item.ID, DrawingFileName = item.Text });
|
||||
ec_drawing_file dwgFile = JsonConvert.DeserializeObject<ec_drawing_file>(model.NodeExtData.ToString());
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (item.Text == "封面、目录、设计说明" || item.Text == "材料表")
|
||||
{ continue; }
|
||||
var list = GetChildNodes(item);
|
||||
if (list.Any())
|
||||
{
|
||||
foreach (var dto in list)
|
||||
{
|
||||
listDrawings.Add(new DtoDrawing() { DrawingFileID = dto.ID, DrawingFileName = dto.Text });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -289,14 +347,24 @@ namespace SWS.Electrical.ViewModels
|
||||
if (item.NodeType == "1")
|
||||
{
|
||||
listDrawings.Add(new DtoDrawing() { DrawingFileID = item.ID, DrawingFileName = item.Text });
|
||||
ec_drawing_file dwgFile = JsonConvert.DeserializeObject<ec_drawing_file>(model.NodeExtData.ToString());
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (item.Text == "封面、目录、设计说明" || item.Text == "材料表")
|
||||
{ continue; }
|
||||
var list = GetChildNodes(item);
|
||||
if (list.Any())
|
||||
{
|
||||
foreach (var dto in list)
|
||||
{
|
||||
listDrawings.Add(new DtoDrawing() { DrawingFileID = dto.ID, DrawingFileName = dto.Text });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
AddMsg($"布置图列表加载完成!");
|
||||
|
||||
}
|
||||
var settingModel = await _ServiceProjectSettings.GetEntity("布置图图例显示位号名称");
|
||||
if (settingModel == null)
|
||||
@ -304,16 +372,48 @@ namespace SWS.Electrical.ViewModels
|
||||
listLibraryTagName.Add("位号");//默认
|
||||
}
|
||||
else { listLibraryTagName = settingModel.SettingValue.Split(',').ToList(); }
|
||||
|
||||
//区域下拉框对应值列表
|
||||
var listDetail = await _ServiceDataItem.GetDetails("Area");
|
||||
if (listDetail != null && listDetail.Any())
|
||||
{
|
||||
foreach (var item in listDetail)
|
||||
{ listArea.Add(new KeyValueModel() { Key=item.DataItemName, Value=item.DataItemName }); }
|
||||
}
|
||||
//甲板号下拉框对应值列表
|
||||
listDetail = await _ServiceDataItem.GetDetails("甲板号");
|
||||
if (listDetail != null && listDetail.Any())
|
||||
{
|
||||
foreach (var item in listDetail)
|
||||
{ listDeck.Add(new KeyValueModel() { Key = item.DataItemName, Value = item.DataItemName }); }
|
||||
}
|
||||
//所属系统下拉框对应值列表
|
||||
listDetail = await _ServiceDataItem.GetDetails("Be_DrawingSystem");
|
||||
if (listDetail != null && listDetail.Any())
|
||||
{
|
||||
foreach (var item in listDetail)
|
||||
{ listSystem.Add(new KeyValueModel() { Key = item.DataItemName, Value = item.DataItemName }); }
|
||||
}
|
||||
selectRange = listRange[0];
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("DialogOpened异常:" + ex.Message);
|
||||
}
|
||||
//selectRange = listRange[2];
|
||||
//inputValue = "声力电话";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 下拉值列表绑定
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
private void RangeChange(KeyValueModel model)
|
||||
{
|
||||
inputValue = "";
|
||||
if (model.Value == "甲板号")
|
||||
{ listValue = new ObservableCollection<KeyValueModel>(listDeck); }
|
||||
else if (model.Value == "区域")
|
||||
{ listValue = new ObservableCollection<KeyValueModel>(listArea); }
|
||||
else if (model.Value == "所属系统")
|
||||
{ listValue = new ObservableCollection<KeyValueModel>(listSystem); }
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取基点信息
|
||||
/// </summary>
|
||||
|
@ -178,13 +178,22 @@
|
||||
FontSize="16"
|
||||
ItemsSource="{Binding listOperator}"
|
||||
SelectedItem="{Binding selectOperator, Mode=TwoWay}" />
|
||||
|
||||
<TextBox
|
||||
<ComboBox
|
||||
Grid.Column="1"
|
||||
Width="200"
|
||||
Height="25"
|
||||
Margin="5,0,0,0"
|
||||
DisplayMemberPath="Key"
|
||||
FontSize="16"
|
||||
IsEditable="True"
|
||||
ItemsSource="{Binding listValue}"
|
||||
Text="{Binding inputValue, Mode=TwoWay}" />
|
||||
<!--<TextBox
|
||||
Width="200"
|
||||
Height="25"
|
||||
Margin="5,0,0,0"
|
||||
FontSize="16"
|
||||
Text="{Binding inputValue}" />
|
||||
Text="{Binding inputValue}" />-->
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel
|
||||
|
@ -1,4 +1,4 @@
|
||||
#pragma checksum "..\..\..\Views\DialogAutoArrangeLayout.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "8006F31A06196293D0E58F4239B97FC4F768BCF414C1B4C2472A1C22D26CF0B1"
|
||||
#pragma checksum "..\..\..\Views\DialogAutoArrangeLayout.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "ABECE6D950BC12BD1A8DC30FBB96A86A4798DF4A77E402D6CDDD9CF497D2FC76"
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码由工具生成。
|
||||
@ -85,7 +85,7 @@ namespace SWS.Electrical.Views {
|
||||
#line hidden
|
||||
|
||||
|
||||
#line 211 "..\..\..\Views\DialogAutoArrangeLayout.xaml"
|
||||
#line 219 "..\..\..\Views\DialogAutoArrangeLayout.xaml"
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
|
||||
internal System.Windows.Controls.DataGrid dgTag;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#pragma checksum "..\..\..\Views\DialogAutoArrangeLayout.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "8006F31A06196293D0E58F4239B97FC4F768BCF414C1B4C2472A1C22D26CF0B1"
|
||||
#pragma checksum "..\..\..\Views\DialogAutoArrangeLayout.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "55992553F782D436B236E9D0626B49AE48376927B5906F253898CDC4189B1D22"
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码由工具生成。
|
||||
@ -85,7 +85,7 @@ namespace SWS.Electrical.Views {
|
||||
#line hidden
|
||||
|
||||
|
||||
#line 211 "..\..\..\Views\DialogAutoArrangeLayout.xaml"
|
||||
#line 220 "..\..\..\Views\DialogAutoArrangeLayout.xaml"
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
|
||||
internal System.Windows.Controls.DataGrid dgTag;
|
||||
|
||||
|
10
newFront/c#前端/SWS.Electrical/配置说明.docx
Normal file
10
newFront/c#前端/SWS.Electrical/配置说明.docx
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
|
||||
第1步:把文件拷贝到D盘文件夹[SWS.Electrical]里面
|
||||
第2步:在坤恒CAD的安装目录里,找到文件:on_start.lsp ,用记事本打开
|
||||
|
||||
|
||||
第3步:把下面一行命令,添加到最下面
|
||||
(command "netload" "D:\\SWS.Electrical\\SWS.Electrical.dll")
|
||||
|
||||
PS:存放文件夹路径可以自己定
|
@ -2,6 +2,7 @@
|
||||
using SWS.Commons;
|
||||
using System;
|
||||
using System.IO;
|
||||
using static System.Collections.Specialized.BitVector32;
|
||||
|
||||
namespace SWS.Service
|
||||
{
|
||||
@ -16,13 +17,12 @@ namespace SWS.Service
|
||||
void SetDefaultConfigValue()
|
||||
{
|
||||
if (!File.Exists(path))
|
||||
{//默认值
|
||||
{
|
||||
//默认值
|
||||
var data = parser.Parser.Parse("");
|
||||
data["Profile"]["strIPAddress"] = "1.117.161.11";
|
||||
data["Profile"]["nPort"] = "8080";
|
||||
string userProfilePath = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
|
||||
|
||||
|
||||
data["Profile"]["strLocalWorkDir"] = $"{userProfilePath}\\AppData\\Roaming\\BricsCAD Electrical";
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(path));
|
||||
parser.WriteFile(path, data);
|
||||
@ -40,15 +40,19 @@ namespace SWS.Service
|
||||
string address;
|
||||
int port;
|
||||
string locDrawingPath;
|
||||
Read(out address, out port,out locDrawingPath);
|
||||
Read(out address, out port, out locDrawingPath);
|
||||
_httpService.Init(address, port);
|
||||
}
|
||||
public void Read(out string address, out int port, out string directory)
|
||||
{
|
||||
var data = parser.ReadFile(path);
|
||||
address = data["Profile"]["strIPAddress"];
|
||||
port = int.Parse(data["Profile"]["nPort"]);
|
||||
directory = data["Profile"]["strLocalWorkDir"];
|
||||
//var data = parser.ReadFile(path);
|
||||
//address = data["Profile"]["strIPAddress"];
|
||||
//port = int.Parse(data["Profile"]["nPort"]);
|
||||
//directory = data["Profile"]["strLocalWorkDir"];
|
||||
|
||||
address = IniHelper.ReadValueFromIniFile("Profile", "strIPAddress");
|
||||
port = int.Parse(IniHelper.ReadValueFromIniFile("Profile", "nPort"));
|
||||
directory = IniHelper.ReadValueFromIniFile("Profile", "strLocalWorkDir");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -58,8 +62,11 @@ namespace SWS.Service
|
||||
/// <returns></returns>
|
||||
public string Read(string keyName)
|
||||
{
|
||||
var data = parser.ReadFile(path);
|
||||
return data["Profile"][keyName];
|
||||
//var data = parser.ReadFile(path);
|
||||
//return data["Profile"][keyName];
|
||||
|
||||
var data = IniHelper.ReadValueFromIniFile("Profile", keyName);
|
||||
return data;
|
||||
}
|
||||
/// <summary>
|
||||
/// 查询某个
|
||||
@ -67,12 +74,15 @@ namespace SWS.Service
|
||||
/// <param name="session">节点</param>
|
||||
/// <param name="keyName">key名称</param>
|
||||
/// <returns></returns>
|
||||
public string Read(string session,string keyName)
|
||||
public string Read(string session, string keyName)
|
||||
{
|
||||
try
|
||||
{
|
||||
var data = parser.ReadFile(path);
|
||||
return data[session][keyName];
|
||||
//var data = parser.ReadFile(path);
|
||||
//return data[session][keyName];
|
||||
|
||||
var data = IniHelper.ReadValueFromIniFile(session, keyName);
|
||||
return data;
|
||||
}
|
||||
catch
|
||||
{
|
||||
@ -86,9 +96,10 @@ namespace SWS.Service
|
||||
/// <param name="value"></param>
|
||||
public void Save(string keyName, string value)
|
||||
{
|
||||
var data = parser.ReadFile(path);
|
||||
data["Profile"][keyName] = value;
|
||||
parser.WriteFile(path, data);
|
||||
//var data = parser.ReadFile(path);
|
||||
//data["Profile"][keyName] = value;
|
||||
//parser.WriteFile(path, data);
|
||||
IniHelper.WriteValueFromIniFile("Profile", keyName, value);
|
||||
}
|
||||
/// <summary>
|
||||
/// 保存某个值
|
||||
@ -98,9 +109,11 @@ namespace SWS.Service
|
||||
/// <param name="value">值</param>
|
||||
public void Save(string session, string keyName, string value)
|
||||
{
|
||||
var data = parser.ReadFile(path);
|
||||
data[session][keyName] = value;
|
||||
parser.WriteFile(path, data);
|
||||
//var data = parser.ReadFile(path);
|
||||
//data[session][keyName] = value;
|
||||
//parser.WriteFile(path, data);
|
||||
|
||||
IniHelper.WriteValueFromIniFile(session, keyName, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:SWS.CustomControl;assembly=SWS.CustomControl"
|
||||
xmlns:po="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
|
||||
xmlns:CustomControl="clr-namespace:SWS.CustomControl;assembly=SWS.CustomControl"
|
||||
xmlns:cvt="clr-namespace:SWS.Commons.Helper.Converter;assembly=SWS.Commons"
|
||||
xmlns:local="clr-namespace:SWS.CustomControl;assembly=SWS.CustomControl"
|
||||
xmlns:po="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
|
||||
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
||||
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
|
||||
<!-- 系统颜色 -->
|
||||
|
@ -9,8 +9,6 @@
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using SWS.Commons.Helper.Converter;
|
||||
using SWS.CustomControl;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Windows;
|
||||
@ -31,28 +29,6 @@ using System.Windows.Media.TextFormatting;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using System.Windows.Shell;
|
||||
using Telerik.Windows.Controls;
|
||||
using Telerik.Windows.Controls.Animation;
|
||||
using Telerik.Windows.Controls.Behaviors;
|
||||
using Telerik.Windows.Controls.Carousel;
|
||||
using Telerik.Windows.Controls.ComboBox;
|
||||
using Telerik.Windows.Controls.Data.PropertyGrid;
|
||||
using Telerik.Windows.Controls.DragDrop;
|
||||
using Telerik.Windows.Controls.GridView;
|
||||
using Telerik.Windows.Controls.LayoutControl;
|
||||
using Telerik.Windows.Controls.Legend;
|
||||
using Telerik.Windows.Controls.MultiColumnComboBox;
|
||||
using Telerik.Windows.Controls.Primitives;
|
||||
using Telerik.Windows.Controls.RadialMenu;
|
||||
using Telerik.Windows.Controls.TransitionEffects;
|
||||
using Telerik.Windows.Controls.TreeListView;
|
||||
using Telerik.Windows.Controls.TreeView;
|
||||
using Telerik.Windows.Controls.Wizard;
|
||||
using Telerik.Windows.Data;
|
||||
using Telerik.Windows.DragDrop;
|
||||
using Telerik.Windows.DragDrop.Behaviors;
|
||||
using Telerik.Windows.Input.Touch;
|
||||
using Telerik.Windows.Shapes;
|
||||
|
||||
|
||||
namespace SWS.WPF.Views {
|
||||
|
@ -9,8 +9,6 @@
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using SWS.Commons.Helper.Converter;
|
||||
using SWS.CustomControl;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Windows;
|
||||
@ -31,28 +29,6 @@ using System.Windows.Media.TextFormatting;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using System.Windows.Shell;
|
||||
using Telerik.Windows.Controls;
|
||||
using Telerik.Windows.Controls.Animation;
|
||||
using Telerik.Windows.Controls.Behaviors;
|
||||
using Telerik.Windows.Controls.Carousel;
|
||||
using Telerik.Windows.Controls.ComboBox;
|
||||
using Telerik.Windows.Controls.Data.PropertyGrid;
|
||||
using Telerik.Windows.Controls.DragDrop;
|
||||
using Telerik.Windows.Controls.GridView;
|
||||
using Telerik.Windows.Controls.LayoutControl;
|
||||
using Telerik.Windows.Controls.Legend;
|
||||
using Telerik.Windows.Controls.MultiColumnComboBox;
|
||||
using Telerik.Windows.Controls.Primitives;
|
||||
using Telerik.Windows.Controls.RadialMenu;
|
||||
using Telerik.Windows.Controls.TransitionEffects;
|
||||
using Telerik.Windows.Controls.TreeListView;
|
||||
using Telerik.Windows.Controls.TreeView;
|
||||
using Telerik.Windows.Controls.Wizard;
|
||||
using Telerik.Windows.Data;
|
||||
using Telerik.Windows.DragDrop;
|
||||
using Telerik.Windows.DragDrop.Behaviors;
|
||||
using Telerik.Windows.Input.Touch;
|
||||
using Telerik.Windows.Shapes;
|
||||
|
||||
|
||||
namespace SWS.WPF.Views {
|
||||
|
Loading…
x
Reference in New Issue
Block a user