Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer
This commit is contained in:
commit
af14a59c01
9 files changed
+120
-48
No files matched your search
Generated
+18
@@ -321,6 +321,15 @@ namespace DyeingComputer.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 Dyelot 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string Dyelot {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Dyelot", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 edit 的本地化字符串。
|
/// 查找类似 edit 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -1104,6 +1113,15 @@ namespace DyeingComputer.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 WorkingStatus 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string WorkingStatus {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("WorkingStatus", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Worklist 的本地化字符串。
|
/// 查找类似 Worklist 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -474,4 +474,10 @@
|
|||||||
<data name="LnsufficientPower" xml:space="preserve">
|
<data name="LnsufficientPower" xml:space="preserve">
|
||||||
<value>Lnsufficient Power</value>
|
<value>Lnsufficient Power</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="WorkingStatus" xml:space="preserve">
|
||||||
|
<value>Working Status</value>
|
||||||
|
</data>
|
||||||
|
<data name="Dyelot" xml:space="preserve">
|
||||||
|
<value>Dyelot</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -474,4 +474,10 @@
|
|||||||
<data name="LnsufficientPower" xml:space="preserve">
|
<data name="LnsufficientPower" xml:space="preserve">
|
||||||
<value>LnsufficientPower</value>
|
<value>LnsufficientPower</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="WorkingStatus" xml:space="preserve">
|
||||||
|
<value>WorkingStatus</value>
|
||||||
|
</data>
|
||||||
|
<data name="Dyelot" xml:space="preserve">
|
||||||
|
<value>Dyelot</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -474,4 +474,10 @@
|
|||||||
<data name="LnsufficientPower" xml:space="preserve">
|
<data name="LnsufficientPower" xml:space="preserve">
|
||||||
<value>功率不足</value>
|
<value>功率不足</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="WorkingStatus" xml:space="preserve">
|
||||||
|
<value>工作状态</value>
|
||||||
|
</data>
|
||||||
|
<data name="Dyelot" xml:space="preserve">
|
||||||
|
<value>领料单</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -474,4 +474,10 @@
|
|||||||
<data name="LnsufficientPower" xml:space="preserve">
|
<data name="LnsufficientPower" xml:space="preserve">
|
||||||
<value>功率不足</value>
|
<value>功率不足</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="WorkingStatus" xml:space="preserve">
|
||||||
|
<value>工作狀態</value>
|
||||||
|
</data>
|
||||||
|
<data name="Dyelot" xml:space="preserve">
|
||||||
|
<value>領料單</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
+1
-1
@@ -19,7 +19,7 @@
|
|||||||
<ColumnDefinition/>
|
<ColumnDefinition/>
|
||||||
<ColumnDefinition/>
|
<ColumnDefinition/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<DataGrid x:Name="Grid_D" AlternationCount="2" IsReadOnly="True" SelectionChanged="Grid_D_SelectionChanged" d:ItemsSource="{d:SampleData ItemCount=256}"
|
<DataGrid x:Name="Grid_D" AlternationCount="2" IsReadOnly="True" SelectionChanged="Grid_D_SelectionChanged" d:ItemsSource="{d:SampleData ItemCount=512}"
|
||||||
Margin="0,0,0,0" ItemsSource="{Binding Path=SYSData_D,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" AutoGenerateColumns="False" MinColumnWidth="30"
|
Margin="0,0,0,0" ItemsSource="{Binding Path=SYSData_D,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" AutoGenerateColumns="False" MinColumnWidth="30"
|
||||||
HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9" GridLinesVisibility="All" BorderBrush="#CCCCCC"
|
HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9" GridLinesVisibility="All" BorderBrush="#CCCCCC"
|
||||||
BorderThickness="1,1,1,1" ColumnHeaderHeight="40" HorizontalContentAlignment="Right" AllowDrop="False"
|
BorderThickness="1,1,1,1" ColumnHeaderHeight="40" HorizontalContentAlignment="Right" AllowDrop="False"
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9" GridLinesVisibility="All" BorderBrush="{x:Null}"
|
HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9" GridLinesVisibility="All" BorderBrush="{x:Null}"
|
||||||
BorderThickness="1,1,1,1" ColumnHeaderHeight="40" HorizontalContentAlignment="Right" Grid.ColumnSpan="2" AllowDrop="False"
|
BorderThickness="1,1,1,1" ColumnHeaderHeight="40" HorizontalContentAlignment="Right" Grid.ColumnSpan="2" AllowDrop="False"
|
||||||
CanUserReorderColumns="False" CanUserSortColumns="False" CanUserResizeRows="False" CanUserResizeColumns="False"
|
CanUserReorderColumns="False" CanUserSortColumns="False" CanUserResizeRows="False" CanUserResizeColumns="False"
|
||||||
CanUserAddRows="True" CanUserDeleteRows="False" HeadersVisibility ="Column" SelectedIndex="{Binding Sys_workSTEPID}"
|
CanUserAddRows="True" CanUserDeleteRows="False" HeadersVisibility ="Column"
|
||||||
Background="White" SelectionMode="Single" FontSize="15" MinHeight="632" TabIndex="1" Focusable="True">
|
Background="White" SelectionMode="Single" FontSize="15" MinHeight="632" TabIndex="1" Focusable="True">
|
||||||
<DataGrid.RowStyle >
|
<DataGrid.RowStyle >
|
||||||
<Style TargetType="{x:Type DataGridRow}">
|
<Style TargetType="{x:Type DataGridRow}">
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ namespace DyeingComputer.View
|
|||||||
public TechnologicalProcessView()
|
public TechnologicalProcessView()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
DataContext = new MainWindowViewModel();
|
//Grid.DataContext = new MainWindowViewModel();
|
||||||
FocusManager.SetFocusedElement(Grid, Grid);
|
FocusManager.SetFocusedElement(Grid, Grid);
|
||||||
if (workName != null)
|
if (workName != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ namespace DyeingComputer.ViewModel
|
|||||||
|
|
||||||
private static int MT05;//主缸排水延时
|
private static int MT05;//主缸排水延时
|
||||||
private static int MT06;//主缸排水延时
|
private static int MT06;//主缸排水延时
|
||||||
|
private int MT12;
|
||||||
private static double MT16;//流量计数系数
|
private static double MT16;//流量计数系数
|
||||||
private int MT18;//主缸管数
|
private int MT18;//主缸管数
|
||||||
private static double MT33;//主缸温度偏差
|
private static double MT33;//主缸温度偏差
|
||||||
@@ -103,6 +104,7 @@ namespace DyeingComputer.ViewModel
|
|||||||
|
|
||||||
MT05 = Convert.ToInt16(Selet_con("MT05"));//主缸排水延时
|
MT05 = Convert.ToInt16(Selet_con("MT05"));//主缸排水延时
|
||||||
MT06 = Convert.ToInt16(Selet_con("MT06"));//动力排水延时
|
MT06 = Convert.ToInt16(Selet_con("MT06"));//动力排水延时
|
||||||
|
MT12 = Convert.ToInt16(Selet_con("MT12"));//
|
||||||
MT16 = Convert.ToDouble(Selet_con("MT16"));//流量计数系数
|
MT16 = Convert.ToDouble(Selet_con("MT16"));//流量计数系数
|
||||||
MT18 = Convert.ToInt16(Selet_con("MT18"));//
|
MT18 = Convert.ToInt16(Selet_con("MT18"));//
|
||||||
MT33 = Convert.ToDouble(Selet_con("MT33"));//温度偏差参数
|
MT33 = Convert.ToDouble(Selet_con("MT33"));//温度偏差参数
|
||||||
@@ -220,25 +222,25 @@ namespace DyeingComputer.ViewModel
|
|||||||
Work_Temp = Selet_dtm("1010") + " ℃";
|
Work_Temp = Selet_dtm("1010") + " ℃";
|
||||||
Work_Numder = WorkNumder.ToString();
|
Work_Numder = WorkNumder.ToString();
|
||||||
|
|
||||||
// if (LINK_OK) Modbus_link();
|
|
||||||
if (!SETP_runtime) DIDETime++;
|
if (!SETP_runtime) DIDETime++;
|
||||||
|
|
||||||
STEP_RUN();
|
STEP_RUN();
|
||||||
IO_view();
|
|
||||||
LOG_view();
|
LOG_view();
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(Name_err.ToString())) Status_Str = Name_err.ToString();
|
if (!string.IsNullOrEmpty(Name_err.ToString())) Status_Str = Name_err.ToString();
|
||||||
}
|
}
|
||||||
void Tick_Event_5S(object sender, EventArgs e)//Tick_Event周期执行事件5S
|
void Tick_Event_5S(object sender, EventArgs e)//Tick_Event周期执行事件5S
|
||||||
{
|
{
|
||||||
|
Name_err = "";
|
||||||
if (!LINK_OK) Modbus_link();
|
if (!LINK_OK) Modbus_link();
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(Name_err.ToString()) && ((Selet_dtm("1010") < 10) || (Selet_dtm("1010") > 160)))
|
if (string.IsNullOrEmpty(Name_err.ToString()) && ((Selet_dtm("1010") < 10) || (Selet_dtm("1010") > 160)))
|
||||||
{ Status_Str = Resources.Temperature + Resources.Sensor + Resources.Malfunction; } //温度故障提示
|
{ Name_err = Resources.Temperature + Resources.Sensor + Resources.Malfunction; } //温度故障提示
|
||||||
}
|
}
|
||||||
void DisTimer_500MS(object sender, EventArgs e)//Tick_Event周期执行事件100MS
|
void DisTimer_500MS(object sender, EventArgs e)//Tick_Event周期执行事件500MS
|
||||||
{
|
{
|
||||||
if (LINK_OK) Modbus_link();
|
if (LINK_OK) Modbus_link();
|
||||||
|
IO_view();
|
||||||
if (LINK_OK) IO_data();
|
if (LINK_OK) IO_data();
|
||||||
if (!string.IsNullOrEmpty(Name_err.ToString()) && (!ERR_JOG)) //有故障信息,无故障保持
|
if (!string.IsNullOrEmpty(Name_err.ToString()) && (!ERR_JOG)) //有故障信息,无故障保持
|
||||||
{
|
{
|
||||||
@@ -415,6 +417,7 @@ namespace DyeingComputer.ViewModel
|
|||||||
}
|
}
|
||||||
|
|
||||||
TimeSpan ts = new TimeSpan(1);//1秒间隔
|
TimeSpan ts = new TimeSpan(1);//1秒间隔
|
||||||
|
private int temp_time10s = 10;
|
||||||
void STEP_RUN()
|
void STEP_RUN()
|
||||||
{
|
{
|
||||||
if (WORK_RUN == 2)
|
if (WORK_RUN == 2)
|
||||||
@@ -504,6 +507,33 @@ namespace DyeingComputer.ViewModel
|
|||||||
}
|
}
|
||||||
updata_dtm("1004", TO);
|
updata_dtm("1004", TO);
|
||||||
updata_dtm("1005", TEMP_co);
|
updata_dtm("1005", TEMP_co);
|
||||||
|
if (MT12 == 1)//输出类型0开关1模拟
|
||||||
|
{
|
||||||
|
if (THL_mode == 2)
|
||||||
|
{
|
||||||
|
updata_dta("5002", Convert.ToInt16(TO));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
updata_dta("5001", Convert.ToInt16(TO));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (temp_time10s <= 0) { temp_time10s = 10; } else { temp_time10s--; }
|
||||||
|
if (THL_mode == 2)
|
||||||
|
{
|
||||||
|
if ((temp_time10s <= Convert.ToInt16(TO)/100))
|
||||||
|
{ updata_dtd("3010", true); }
|
||||||
|
else { updata_dtd("3010", false); }//降温
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ((temp_time10s <= Convert.ToInt16(TO)/100))
|
||||||
|
{ updata_dtd("3009", true); }
|
||||||
|
else { updata_dtd("3009", false); }//升温
|
||||||
|
}
|
||||||
|
}
|
||||||
break;//功能模块001温度控制
|
break;//功能模块001温度控制
|
||||||
case "007":
|
case "007":
|
||||||
if (STEP_P1.ToString() == "1")
|
if (STEP_P1.ToString() == "1")
|
||||||
@@ -947,8 +977,7 @@ namespace DyeingComputer.ViewModel
|
|||||||
master.WriteMultipleRegisters(slaveId, 07000, DW); //写入寄存器
|
master.WriteMultipleRegisters(slaveId, 07000, DW); //写入寄存器
|
||||||
DO = master.ReadCoils(slaveId, 01000, DO_L); //读取线圈
|
DO = master.ReadCoils(slaveId, 01000, DO_L); //读取线圈
|
||||||
RW = master.ReadHoldingRegisters(slaveId, 06000, RW_L); //读取寄存器
|
RW = master.ReadHoldingRegisters(slaveId, 06000, RW_L); //读取寄存器
|
||||||
LINK_OK = true;
|
LINK_OK = true;
|
||||||
Name_err = "";
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -958,13 +987,12 @@ namespace DyeingComputer.ViewModel
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void LOG_view()//细节页面
|
void LOG_view()//细节页面
|
||||||
{
|
{
|
||||||
Sys_log = Resources.Target + Resources.Temperature + " : " + string.Format(" {0:###.#}", TEMP_tar) + "°C";//显示目标温度
|
Sys_log = Resources.Target + Resources.Temperature + " : " + string.Format(" {0:###.#}", TEMP_tar) + "°C";//显示目标温度
|
||||||
Sys_log = Sys_log + " | " + Resources.MasterCylinder + Resources.Temperature + " : " + string.Format(" {0:###.#}", Convert.ToDouble(Selet_dtm("1010"))) + "°C";//显示实际温度
|
Sys_log = Sys_log + " | " + Resources.MasterCylinder + Resources.Temperature + " : " + string.Format(" {0:###.#}", Convert.ToDouble(Selet_dtm("1010"))) + "°C";//显示实际温度
|
||||||
Sys_log = Sys_log + "\n" + Resources.Compute + Resources.Temperature + " : " + string.Format(" {0:###.#}", Convert.ToDouble(Selet_dtm("1005"))) + "°C";//显示计算温度
|
Sys_log = Sys_log + "\n" + Resources.Compute + Resources.Temperature + " : " + string.Format(" {0:###.#}", Convert.ToDouble(Selet_dtm("1005"))) + "°C";//显示计算温度
|
||||||
Sys_log = Sys_log + " | " + Resources.ProportionalValves + " : " + string.Format("{0:###.#}", Convert.ToDouble(Selet_dtm("1004"))/10) + "%";//显示比例
|
Sys_log = Sys_log + " | " + Resources.ProportionalValves + " : " + string.Format("{0:###.#}", Convert.ToDouble(Selet_dtm("1004")) / 10) + "%";//显示比例
|
||||||
int IO1015 = Convert.ToInt16(Selet_dtm("1015"));
|
int IO1015 = Convert.ToInt16(Selet_dtm("1015"));
|
||||||
if (IO1015 < MT39)
|
if (IO1015 < MT39)
|
||||||
{
|
{
|
||||||
@@ -986,12 +1014,12 @@ namespace DyeingComputer.ViewModel
|
|||||||
{
|
{
|
||||||
Sys_log = Sys_log + "\n" + Resources.PumpSpeed + " : " + string.Format("{0:D3}", Convert.ToInt16(Selet_dtm("1020"))) + "% => [" + Resources.PumpStops + "]";//主泵状态
|
Sys_log = Sys_log + "\n" + Resources.PumpSpeed + " : " + string.Format("{0:D3}", Convert.ToInt16(Selet_dtm("1020"))) + "% => [" + Resources.PumpStops + "]";//主泵状态
|
||||||
}
|
}
|
||||||
Sys_log = Sys_log + "\n" + Resources.MasterCylinder + Resources.Pressure + " : " + string.Format("{0:###.#}", Convert.ToDouble(Selet_dtm("1042")))+ "Bar";
|
Sys_log = Sys_log + "\n" + Resources.MasterCylinder + Resources.Pressure + " : " + string.Format("{0:###.#}", Convert.ToDouble(Selet_dtm("1042"))) + "Bar";
|
||||||
Sys_log = Sys_log + " | " + Resources.Nozzle + Resources.Pressure + " : " + string.Format("{0:###.#}", Convert.ToDouble(Selet_dtm("1043"))) + "Bar";
|
Sys_log = Sys_log + " | " + Resources.Nozzle + Resources.Pressure + " : " + string.Format("{0:###.#}", Convert.ToDouble(Selet_dtm("1043"))) + "Bar";
|
||||||
Sys_log = Sys_log + "\n-------------------------------------------------------";
|
Sys_log = Sys_log + "\n-------------------------------------------------------";
|
||||||
if (S16 == 0)
|
if (S16 == 0)
|
||||||
{
|
{
|
||||||
Sys_log = Sys_log + "\n" + Resources.ClothWheel +"M/min";
|
Sys_log = Sys_log + "\n" + Resources.ClothWheel + "M/min";
|
||||||
Sys_log = Sys_log + "\n" + "1 : " + string.Format("{0:D3}", Convert.ToInt16(Selet_dtm("1022")));
|
Sys_log = Sys_log + "\n" + "1 : " + string.Format("{0:D3}", Convert.ToInt16(Selet_dtm("1022")));
|
||||||
if (MT18 >= 2) Sys_log = Sys_log + " | " + "2 : " + string.Format("{0:D3}", Convert.ToInt16(Selet_dtm("1023")));
|
if (MT18 >= 2) Sys_log = Sys_log + " | " + "2 : " + string.Format("{0:D3}", Convert.ToInt16(Selet_dtm("1023")));
|
||||||
if (MT18 >= 3) Sys_log = Sys_log + " | " + "3 : " + string.Format("{0:D3}", Convert.ToInt16(Selet_dtm("1024")));
|
if (MT18 >= 3) Sys_log = Sys_log + " | " + "3 : " + string.Format("{0:D3}", Convert.ToInt16(Selet_dtm("1024")));
|
||||||
@@ -1016,7 +1044,7 @@ namespace DyeingComputer.ViewModel
|
|||||||
}//溢流/o型
|
}//溢流/o型
|
||||||
else if (S16 == 1) //气流
|
else if (S16 == 1) //气流
|
||||||
{
|
{
|
||||||
Sys_log = Sys_log + "\n" + Resources.DifferentialPressure + " : "+ string.Format("{0:D3}", Convert.ToInt16(Selet_dtm("1021"))) + "%";
|
Sys_log = Sys_log + "\n" + Resources.DifferentialPressure + " : " + string.Format("{0:D3}", Convert.ToInt16(Selet_dtm("1021"))) + "%";
|
||||||
Sys_log = Sys_log + "\n" + Resources.Blower + " : " + string.Format("{0:D3}", Convert.ToInt16(Selet_dtm("1044"))) + "%";
|
Sys_log = Sys_log + "\n" + Resources.Blower + " : " + string.Format("{0:D3}", Convert.ToInt16(Selet_dtm("1044"))) + "%";
|
||||||
Sys_log = Sys_log + "\n" + Resources.GuidingWheel + " : " + string.Format("{0:D3}", Convert.ToInt16(Selet_dtm("1046"))) + "M/min";
|
Sys_log = Sys_log + "\n" + Resources.GuidingWheel + " : " + string.Format("{0:D3}", Convert.ToInt16(Selet_dtm("1046"))) + "M/min";
|
||||||
Sys_log = Sys_log + "\n" + Resources.Nozzle + Resources.Flowmeter + " : " + string.Format("{0:D3}", Convert.ToInt16(Selet_dtm("1045"))) + "L/min";
|
Sys_log = Sys_log + "\n" + Resources.Nozzle + Resources.Flowmeter + " : " + string.Format("{0:D3}", Convert.ToInt16(Selet_dtm("1045"))) + "L/min";
|
||||||
@@ -1025,11 +1053,25 @@ namespace DyeingComputer.ViewModel
|
|||||||
{ }
|
{ }
|
||||||
|
|
||||||
Sys_log = Sys_log + "\n-------------------------------------------------------";
|
Sys_log = Sys_log + "\n-------------------------------------------------------";
|
||||||
if (SM01 == 1) Sys_log = Sys_log + "\n" + Resources.Medicine + Resources.Tank + "1 => [" + Resources.WaterLevel + ":" + string.Format("{0:D4}", Convert.ToInt16(Selet_dtm("1017"))) + "L][" + Resources.Temperature + ":" + string.Format(" {0:###.#}", Convert.ToInt16(Selet_dtm("1012"))) + "°C]";
|
if (SM01 == 1)
|
||||||
if (SM02 == 1) Sys_log = Sys_log + "\n" + Resources.Medicine + Resources.Tank + "2 => [" + Resources.WaterLevel + ":" + string.Format("{0:D4}", Convert.ToInt16(Selet_dtm("1018"))) + "L][" + Resources.Temperature + ":" + string.Format(" {0:###.#}", Convert.ToInt16(Selet_dtm("1013"))) + "°C]";
|
{
|
||||||
if (SM03 == 1) Sys_log = Sys_log + "\n" + Resources.Medicine + Resources.Tank + "3 => [" + Resources.WaterLevel + ":" + string.Format("{0:D4}", Convert.ToInt16(Selet_dtm("1019"))) + "L][" + Resources.Temperature + ":" + string.Format(" {0:###.#}", Convert.ToInt16(Selet_dtm("1014"))) + "°C]";
|
Sys_log = Sys_log + "\n" + Resources.Medicine + Resources.Tank + "1 => [" + Resources.WaterLevel + ":" + string.Format("{0:D4}", Convert.ToInt16(Selet_dtm("1017"))) + "L][" + Resources.Temperature + ":" + string.Format(" {0:###.#}", Convert.ToInt16(Selet_dtm("1012"))) + "°C]";
|
||||||
|
Sys_log = Sys_log + "\n" + Resources.Dyelot + " : " + " => ";
|
||||||
|
Sys_log = Sys_log + "\n" + Resources.WorkingStatus + " : ";
|
||||||
|
}
|
||||||
|
if (SM02 == 1)
|
||||||
|
{
|
||||||
|
Sys_log = Sys_log + "\n" + Resources.Medicine + Resources.Tank + "2 => [" + Resources.WaterLevel + ":" + string.Format("{0:D4}", Convert.ToInt16(Selet_dtm("1018"))) + "L][" + Resources.Temperature + ":" + string.Format(" {0:###.#}", Convert.ToInt16(Selet_dtm("1013"))) + "°C]";
|
||||||
|
Sys_log = Sys_log + "\n" + Resources.Dyelot + " : " + " => ";
|
||||||
|
Sys_log = Sys_log + "\n" + Resources.WorkingStatus + " : ";
|
||||||
|
}
|
||||||
|
if (SM03 == 1)
|
||||||
|
{
|
||||||
|
Sys_log = Sys_log + "\n" + Resources.Medicine + Resources.Tank + "3 => [" + Resources.WaterLevel + ":" + string.Format("{0:D4}", Convert.ToInt16(Selet_dtm("1019"))) + "L][" + Resources.Temperature + ":" + string.Format(" {0:###.#}", Convert.ToInt16(Selet_dtm("1014"))) + "°C]";
|
||||||
|
Sys_log = Sys_log + "\n" + Resources.Dyelot + " : " + " => ";
|
||||||
|
Sys_log = Sys_log + "\n" + Resources.WorkingStatus + " : ";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DataTable dt_d = new DataTable("DIO");
|
public static DataTable dt_d = new DataTable("DIO");
|
||||||
public static DataTable dt_a = new DataTable("AIO");
|
public static DataTable dt_a = new DataTable("AIO");
|
||||||
public static DataTable dt_m = new DataTable("M");
|
public static DataTable dt_m = new DataTable("M");
|
||||||
@@ -1074,14 +1116,21 @@ namespace DyeingComputer.ViewModel
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
SYSData_A = ToObservableCollection<DATA_A>(dt_a);
|
SYSData_A = ToObservableCollection<DATA_A>(dt_a);
|
||||||
|
}
|
||||||
|
catch (Exception ex) { Name_err = "IO_SYSData_A" + "(" + ex.Message + ")"; }
|
||||||
|
try
|
||||||
|
{
|
||||||
SYSData_D = ToObservableCollection<DATA_D>(dt_d);
|
SYSData_D = ToObservableCollection<DATA_D>(dt_d);
|
||||||
|
}
|
||||||
|
catch (Exception ex) { Name_err = "IO_SYSData_D" + "(" + ex.Message + ")"; }
|
||||||
|
try
|
||||||
|
{
|
||||||
SYSData_M = ToObservableCollection<DATA_M>(dt_m);
|
SYSData_M = ToObservableCollection<DATA_M>(dt_m);
|
||||||
}
|
}
|
||||||
catch (Exception ex) { Name_err = "IO" + "(" + ex.Message + ")"; }
|
catch (Exception ex) { Name_err = "IO_SYSData_M" + "(" + ex.Message + ")"; }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static double Selet_dtm(string key)//M寄存器
|
public static double Selet_dtm(string key)//M寄存器
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -1097,7 +1146,7 @@ namespace DyeingComputer.ViewModel
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
LogGing.LogGingDATA(ex.ToString());
|
LogGing.LogGingDATA("SDTM:"+ex.ToString());
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1116,7 +1165,7 @@ namespace DyeingComputer.ViewModel
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
LogGing.LogGingDATA(ex.ToString());
|
LogGing.LogGingDATA("SDTD:" + ex.ToString());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1135,7 +1184,7 @@ namespace DyeingComputer.ViewModel
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
LogGing.LogGingDATA(ex.ToString());
|
LogGing.LogGingDATA("SDTA:" + ex.ToString());
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1164,7 +1213,7 @@ namespace DyeingComputer.ViewModel
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
LogGing.LogGingDATA(ex.ToString());
|
LogGing.LogGingDATA("UDTM:" + ex.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1174,17 +1223,6 @@ namespace DyeingComputer.ViewModel
|
|||||||
{
|
{
|
||||||
lock (dt_d)//锁
|
lock (dt_d)//锁
|
||||||
{
|
{
|
||||||
/* DataRow[] arrRows = dt_d.Rows.Find(key); //dt_d.Select("ID='" + key + "'");
|
|
||||||
int index = dt_d.Rows.IndexOf(arrRows[0]);
|
|
||||||
if (index != -1)
|
|
||||||
{
|
|
||||||
DataRow drEmployee = dt_d.Rows[index];
|
|
||||||
drEmployee.BeginEdit();
|
|
||||||
drEmployee["DIO"] = Value;
|
|
||||||
drEmployee.EndEdit();
|
|
||||||
drEmployee.AcceptChanges();
|
|
||||||
drEmployee.ClearErrors();
|
|
||||||
}*/
|
|
||||||
DataRow drEmployee = dt_d.Rows.Find(key);
|
DataRow drEmployee = dt_d.Rows.Find(key);
|
||||||
drEmployee.BeginEdit();
|
drEmployee.BeginEdit();
|
||||||
drEmployee["DIO"] = Value;
|
drEmployee["DIO"] = Value;
|
||||||
@@ -1195,7 +1233,7 @@ namespace DyeingComputer.ViewModel
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
LogGing.LogGingDATA(ex.ToString());
|
LogGing.LogGingDATA("UDTD:" + ex.ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public static void updata_dta(string key, int Value)//更新A寄存器
|
public static void updata_dta(string key, int Value)//更新A寄存器
|
||||||
@@ -1204,15 +1242,6 @@ namespace DyeingComputer.ViewModel
|
|||||||
{
|
{
|
||||||
lock (dt_a)
|
lock (dt_a)
|
||||||
{
|
{
|
||||||
/* DataRow[] arrRows = dt_a.Select("ID='" + key + "'");
|
|
||||||
int index = dt_a.Rows.IndexOf(arrRows[0]);
|
|
||||||
if (index != -1)
|
|
||||||
{
|
|
||||||
DataRow drEmployee = dt_a.Rows[index];
|
|
||||||
drEmployee.BeginEdit();
|
|
||||||
drEmployee["AIO"] = Value;
|
|
||||||
drEmployee.EndEdit();
|
|
||||||
}*/
|
|
||||||
DataRow drEmployee = dt_a.Rows.Find(key);
|
DataRow drEmployee = dt_a.Rows.Find(key);
|
||||||
drEmployee.BeginEdit();
|
drEmployee.BeginEdit();
|
||||||
drEmployee["AIO"] = Value;
|
drEmployee["AIO"] = Value;
|
||||||
@@ -1223,7 +1252,7 @@ namespace DyeingComputer.ViewModel
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
LogGing.LogGingDATA(ex.ToString());
|
LogGing.LogGingDATA("UDTA:" + ex.ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1280,6 +1309,7 @@ namespace DyeingComputer.ViewModel
|
|||||||
public double Value { get; set; }
|
public double Value { get; set; }
|
||||||
public String ID { get; set; }
|
public String ID { get; set; }
|
||||||
public string Info { get; set; }
|
public string Info { get; set; }
|
||||||
|
public string type { get; set; }
|
||||||
}
|
}
|
||||||
public ObservableCollection<T> ToObservableCollection<T>(DataTable dt) where T : class, new()
|
public ObservableCollection<T> ToObservableCollection<T>(DataTable dt) where T : class, new()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user