change - PLC配置文件单独缓存

master
wenjy 2 years ago
parent 3b8073836a
commit eff39b28f9

@ -9,8 +9,7 @@ namespace MaterialTraceability.Entity.Config
{
public sealed class LyAddress
{
private static INIFile iNIFile = new INIFile(System.Environment.CurrentDirectory + "/App.InI");
private static INIFile iNIFile = new INIFile(System.Environment.CurrentDirectory + "/PlcConfig/App.InI");
private static readonly Lazy<LyAddress> lazy = new Lazy<LyAddress>(() => new LyAddress());
public static LyAddress Instance

@ -9,7 +9,7 @@ namespace MaterialTraceability.Entity.Config
{
public sealed class MqAddress
{
private static INIFile iNIFile = new INIFile(System.Environment.CurrentDirectory + "/App.InI");
private static INIFile iNIFile = new INIFile(System.Environment.CurrentDirectory + "/PlcConfig/App.InI");
private static readonly Lazy<MqAddress> lazy = new Lazy<MqAddress>(() => new MqAddress());

@ -10,7 +10,7 @@ namespace MaterialTraceability.Entity.Config
{
public sealed class TbAddress
{
private static INIFile iNIFile = new INIFile(System.Environment.CurrentDirectory + "/App.InI");
private static INIFile iNIFile = new INIFile(System.Environment.CurrentDirectory + "/PlcConfig/App.InI");
private static readonly Lazy<TbAddress> lazy = new Lazy<TbAddress>(() => new TbAddress());

@ -28,6 +28,7 @@ namespace MaterialTraceabilityUI
/// </summary>
private IniFileHelper inifile = new IniFileHelper(System.Environment.CurrentDirectory + "/MesConfig/App.InI");
private IniFileHelper inifile2 = new IniFileHelper(System.Environment.CurrentDirectory + "/App.InI");
private IniFileHelper plcIniFile = new IniFileHelper(System.Environment.CurrentDirectory + "/PlcConfig/App.InI");
private AppConfigDto appConfig = AppConfigDto.Instance;
private string iniSection = "";
@ -130,7 +131,7 @@ namespace MaterialTraceabilityUI
foreach(ParamValueDto item in plcParamValues)
{
inifile2.IniWriteValue(iniSection, item.paramName,item.paramValue);
plcIniFile.IniWriteValue(iniSection, item.paramName,item.paramValue);
}
MessageBox.Show("更新成功,重启生效");
@ -215,13 +216,13 @@ namespace MaterialTraceabilityUI
this.AppConfigParamMesWebServiceTimeOut.Text = inifile2.IniReadValue("SystemConfig", "MesWebServiceTimeOut");
//获取PLC配置
List<string> plcParamValues = inifile2.ReadKeys(iniSection);
List<string> plcParamValues = plcIniFile.ReadKeys(iniSection);
List<ParamValueDto> paramValues = new List<ParamValueDto>();
foreach(string item in plcParamValues)
{
ParamValueDto paramValueDto = new ParamValueDto();
paramValueDto.paramName = item;
paramValueDto.paramValue = inifile2.IniReadValue(iniSection, item);
paramValueDto.paramValue = plcIniFile.IniReadValue(iniSection, item);
paramValues.Add(paramValueDto);
}
this.PlcParamValue.ItemsSource = paramValues;

@ -8,7 +8,9 @@ using MaterialTraceability.SqlSugar.ServiceImpl;
using MaterialTraceabilityUI.Common;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Data;
using System.Drawing;
using System.Linq.Expressions;
@ -50,8 +52,6 @@ namespace MaterialTraceabilityUI
try
{
InitializeComponent();
// AutoUpdater.Start("ftp://172.21.29.56/update.xml",new System.Net.NetworkCredential("admin-60073571", "Bhl06130308$"));
AutoUpdater.Start("file://172.21.19.24/temp每天凌晨2点清理/临时文件/BHL/RFID物料追溯系统-现场更新/溧阳五程序/update.xml");
LogHelperBusiness.LogInfo("版本获取地址file://172.21.19.24/temp每天凌晨2点清理/临时文件/BHL/RFID物料追溯系统-现场更新/溧阳五程序/update.xml");
string info = Assembly.GetExecutingAssembly().GetName().Version.ToString();
@ -386,15 +386,5 @@ namespace MaterialTraceabilityUI
{
AutoUpdater.Start("file://172.21.19.24/temp每天凌晨2点清理/临时文件/BHL/RFID物料追溯系统-现场更新/溧阳五程序/update.xml");
}
/// <summary>
/// 工单设置
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void orderSet_Click(object sender, RoutedEventArgs e)
{
}
}
}

Loading…
Cancel
Save