Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer
This commit is contained in:
commit
c8ed3818d0
17 files changed
+70
-14
No files matched your search
Generated
+18
@@ -195,6 +195,15 @@ namespace DyeingComputer.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 Connection lost 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string Connectionlost {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Connectionlost", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Container 的本地化字符串。
|
/// 查找类似 Container 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -546,6 +555,15 @@ namespace DyeingComputer.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string Port {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Port", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 PrepareMedications 的本地化字符串。
|
/// 查找类似 PrepareMedications 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -402,4 +402,10 @@
|
|||||||
<data name="Notimplementation" xml:space="preserve">
|
<data name="Notimplementation" xml:space="preserve">
|
||||||
<value>Not Implementation</value>
|
<value>Not Implementation</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Connectionlost" xml:space="preserve">
|
||||||
|
<value>Connection lost</value>
|
||||||
|
</data>
|
||||||
|
<data name="Port" xml:space="preserve">
|
||||||
|
<value>Port</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -402,4 +402,10 @@
|
|||||||
<data name="process_not" xml:space="preserve">
|
<data name="process_not" xml:space="preserve">
|
||||||
<value>The process does not exist</value>
|
<value>The process does not exist</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Connectionlost" xml:space="preserve">
|
||||||
|
<value>Connection lost</value>
|
||||||
|
</data>
|
||||||
|
<data name="Port" xml:space="preserve">
|
||||||
|
<value>Port</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -402,4 +402,10 @@
|
|||||||
<data name="Implementation" xml:space="preserve">
|
<data name="Implementation" xml:space="preserve">
|
||||||
<value>执行</value>
|
<value>执行</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Connectionlost" xml:space="preserve">
|
||||||
|
<value>连接丢失</value>
|
||||||
|
</data>
|
||||||
|
<data name="Port" xml:space="preserve">
|
||||||
|
<value>端口号</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -402,4 +402,10 @@
|
|||||||
<data name="Implementation" xml:space="preserve">
|
<data name="Implementation" xml:space="preserve">
|
||||||
<value>執行</value>
|
<value>執行</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Connectionlost" xml:space="preserve">
|
||||||
|
<value>網路斷開</value>
|
||||||
|
</data>
|
||||||
|
<data name="Port" xml:space="preserve">
|
||||||
|
<value>連接埠</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace formula_manage.UserClass
|
namespace DyeingComputer.UserClass
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// CRC校验
|
/// CRC校验
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
|
|
||||||
namespace formula_manage.UserClass
|
namespace DyeingComputer.UserClass
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 实时更新datagrid
|
/// 实时更新datagrid
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ using System.Collections.ObjectModel;
|
|||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
namespace formula_manage.UserClass
|
namespace DyeingComputer.UserClass
|
||||||
{
|
{
|
||||||
internal class DataTableToObservableCollection //数据表到可观察集合
|
internal class DataTableToObservableCollection //数据表到可观察集合
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Management;
|
using System.Management;
|
||||||
|
|
||||||
namespace formula_manage.UserClass
|
namespace DyeingComputer.UserClass
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取硬件SN
|
/// 获取硬件SN
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace formula_manage.UserClass
|
namespace DyeingComputer.UserClass
|
||||||
{
|
{
|
||||||
internal class IniFile
|
internal class IniFile
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ using System.Windows.Controls;
|
|||||||
using System.Windows.Documents;
|
using System.Windows.Documents;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
|
|
||||||
namespace formula_manage.UserClass
|
namespace DyeingComputer.UserClass
|
||||||
{
|
{
|
||||||
public static class LogDataRead
|
public static class LogDataRead
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace formula_manage.UserClass
|
namespace DyeingComputer.UserClass
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// MD5加密
|
/// MD5加密
|
||||||
|
|||||||
@@ -4,9 +4,11 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="clr-namespace:DyeingComputer.View"
|
xmlns:local="clr-namespace:DyeingComputer.View"
|
||||||
|
xmlns:lang="clr-namespace:DyeingComputer.Properties"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="630" d:DesignWidth="1280" VerticalAlignment="Top">
|
d:DesignHeight="630" d:DesignWidth="1280" VerticalAlignment="Top">
|
||||||
<Grid>
|
<Grid>
|
||||||
<DataGrid HorizontalAlignment="Left" Height="179" Margin="204,136,0,0" VerticalAlignment="Top" Width="343" d:ItemsSource="{d:SampleData ItemCount=5}"/>
|
<ComboBox HorizontalAlignment="Left" Height="30" Margin="190,10,0,0" x:Name="comboBoxCOM" VerticalAlignment="Top" Width="200" SelectionChanged="comboBoxCOM_SelectionChanged" FontSize="20"/>
|
||||||
|
<TextBlock HorizontalAlignment="Left" Height="30" Margin="90,10,0,0" TextWrapping="Wrap" Text="{x:Static lang:Resources.Port}" VerticalAlignment="Top" Width="80" FontSize="25"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@@ -23,6 +23,16 @@ namespace DyeingComputer.View
|
|||||||
public EngineerSetView()
|
public EngineerSetView()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
// 获取所有可用串口端口,并添加到comboBoxCOM
|
||||||
|
string[] ports = System.IO.Ports.SerialPort.GetPortNames();
|
||||||
|
comboBoxCOM.ItemsSource = ports;
|
||||||
|
}
|
||||||
|
//调用配置文件
|
||||||
|
private UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(Convert.ToString(System.AppDomain.CurrentDomain.BaseDirectory) + "DyeingComputer.ini");
|
||||||
|
|
||||||
|
private void comboBoxCOM_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
Configini.IniWritevalue("SYS","COM",comboBoxCOM.SelectedValue.ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
using DyeingComputer.UserClass;
|
using DyeingComputer.UserClass;
|
||||||
using DyeingComputer.Windows;
|
using DyeingComputer.Windows;
|
||||||
using formula_manage.UserClass;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using DyeingComputer.UserClass;
|
using DyeingComputer.UserClass;
|
||||||
using DyeingComputer.Windows;
|
using DyeingComputer.Windows;
|
||||||
using formula_manage.UserClass;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
|
|||||||
@@ -113,13 +113,14 @@ namespace DyeingComputer.ViewModel
|
|||||||
disTimer.Start();//计时开始
|
disTimer.Start();//计时开始
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static object Name_err;
|
||||||
public static object WorkNumder;
|
public static object WorkNumder;
|
||||||
void Tick_Event_1S(object sender, EventArgs e)//Tick_Event周期执行事件
|
void Tick_Event_1S(object sender, EventArgs e)//Tick_Event周期执行事件
|
||||||
{
|
{
|
||||||
Sys_Time = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");
|
Sys_Time = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");
|
||||||
Work_Temp = "130" + " ℃";
|
Work_Temp = "130" + " ℃";
|
||||||
Work_Numder = WorkNumder.ToString();
|
Work_Numder = WorkNumder.ToString();
|
||||||
Status_Str = "qweqeqwqqfwfqef";
|
// Status_Str = "qweqeqwqqfwfqef";
|
||||||
|
|
||||||
if (LINK_OK) Modbus_link();
|
if (LINK_OK) Modbus_link();
|
||||||
IO_data();
|
IO_data();
|
||||||
@@ -127,7 +128,7 @@ namespace DyeingComputer.ViewModel
|
|||||||
void Tick_Event_5S(object sender, EventArgs e)//Tick_Event周期执行事件
|
void Tick_Event_5S(object sender, EventArgs e)//Tick_Event周期执行事件
|
||||||
{
|
{
|
||||||
if (!LINK_OK) Modbus_link();
|
if (!LINK_OK) Modbus_link();
|
||||||
|
if (Name_err != null) Status_Str = Name_err.ToString();
|
||||||
}
|
}
|
||||||
void DisTimer_100MS(object sender, EventArgs e)//Tick_Event周期执行事件
|
void DisTimer_100MS(object sender, EventArgs e)//Tick_Event周期执行事件
|
||||||
{
|
{
|
||||||
@@ -145,7 +146,7 @@ namespace DyeingComputer.ViewModel
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
port.PortName = "COM5";
|
port.PortName = "COM5";
|
||||||
port.BaudRate = 9600;//配置
|
port.BaudRate = 115200;//配置
|
||||||
port.DataBits = 8;
|
port.DataBits = 8;
|
||||||
port.Parity = Parity.None;
|
port.Parity = Parity.None;
|
||||||
port.StopBits = StopBits.One;
|
port.StopBits = StopBits.One;
|
||||||
@@ -178,7 +179,10 @@ namespace DyeingComputer.ViewModel
|
|||||||
{
|
{
|
||||||
master.WriteMultipleRegisters(slaveId, startAddress, registers);
|
master.WriteMultipleRegisters(slaveId, startAddress, registers);
|
||||||
}
|
}
|
||||||
catch (Exception ex) { }
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Name_err = "PLC"+Properties.Resources.Connectionlost;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user