Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer
This commit is contained in:
commit
af14a59c01
9 files changed
+113
-41
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>
|
||||
/// 查找类似 edit 的本地化字符串。
|
||||
/// </summary>
|
||||
@@ -1104,6 +1113,15 @@ namespace DyeingComputer.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 WorkingStatus 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string WorkingStatus {
|
||||
get {
|
||||
return ResourceManager.GetString("WorkingStatus", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Worklist 的本地化字符串。
|
||||
/// </summary>
|
||||
|
||||
@@ -474,4 +474,10 @@
|
||||
<data name="LnsufficientPower" xml:space="preserve">
|
||||
<value>Lnsufficient Power</value>
|
||||
</data>
|
||||
<data name="WorkingStatus" xml:space="preserve">
|
||||
<value>Working Status</value>
|
||||
</data>
|
||||
<data name="Dyelot" xml:space="preserve">
|
||||
<value>Dyelot</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -474,4 +474,10 @@
|
||||
<data name="LnsufficientPower" xml:space="preserve">
|
||||
<value>LnsufficientPower</value>
|
||||
</data>
|
||||
<data name="WorkingStatus" xml:space="preserve">
|
||||
<value>WorkingStatus</value>
|
||||
</data>
|
||||
<data name="Dyelot" xml:space="preserve">
|
||||
<value>Dyelot</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -474,4 +474,10 @@
|
||||
<data name="LnsufficientPower" xml:space="preserve">
|
||||
<value>功率不足</value>
|
||||
</data>
|
||||
<data name="WorkingStatus" xml:space="preserve">
|
||||
<value>工作状态</value>
|
||||
</data>
|
||||
<data name="Dyelot" xml:space="preserve">
|
||||
<value>领料单</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -474,4 +474,10 @@
|
||||
<data name="LnsufficientPower" xml:space="preserve">
|
||||
<value>功率不足</value>
|
||||
</data>
|
||||
<data name="WorkingStatus" xml:space="preserve">
|
||||
<value>工作狀態</value>
|
||||
</data>
|
||||
<data name="Dyelot" xml:space="preserve">
|
||||
<value>領料單</value>
|
||||
</data>
|
||||
</root>
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</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"
|
||||
HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9" GridLinesVisibility="All" BorderBrush="#CCCCCC"
|
||||
BorderThickness="1,1,1,1" ColumnHeaderHeight="40" HorizontalContentAlignment="Right" AllowDrop="False"
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9" GridLinesVisibility="All" BorderBrush="{x:Null}"
|
||||
BorderThickness="1,1,1,1" ColumnHeaderHeight="40" HorizontalContentAlignment="Right" Grid.ColumnSpan="2" AllowDrop="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">
|
||||
<DataGrid.RowStyle >
|
||||
<Style TargetType="{x:Type DataGridRow}">
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace DyeingComputer.View
|
||||
public TechnologicalProcessView()
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = new MainWindowViewModel();
|
||||
//Grid.DataContext = new MainWindowViewModel();
|
||||
FocusManager.SetFocusedElement(Grid, Grid);
|
||||
if (workName != null)
|
||||
{
|
||||
|
||||
@@ -73,6 +73,7 @@ namespace DyeingComputer.ViewModel
|
||||
|
||||
private static int MT05;//主缸排水延时
|
||||
private static int MT06;//主缸排水延时
|
||||
private int MT12;
|
||||
private static double MT16;//流量计数系数
|
||||
private int MT18;//主缸管数
|
||||
private static double MT33;//主缸温度偏差
|
||||
@@ -103,6 +104,7 @@ namespace DyeingComputer.ViewModel
|
||||
|
||||
MT05 = Convert.ToInt16(Selet_con("MT05"));//主缸排水延时
|
||||
MT06 = Convert.ToInt16(Selet_con("MT06"));//动力排水延时
|
||||
MT12 = Convert.ToInt16(Selet_con("MT12"));//
|
||||
MT16 = Convert.ToDouble(Selet_con("MT16"));//流量计数系数
|
||||
MT18 = Convert.ToInt16(Selet_con("MT18"));//
|
||||
MT33 = Convert.ToDouble(Selet_con("MT33"));//温度偏差参数
|
||||
@@ -220,25 +222,25 @@ namespace DyeingComputer.ViewModel
|
||||
Work_Temp = Selet_dtm("1010") + " ℃";
|
||||
Work_Numder = WorkNumder.ToString();
|
||||
|
||||
// if (LINK_OK) Modbus_link();
|
||||
if (!SETP_runtime) DIDETime++;
|
||||
|
||||
STEP_RUN();
|
||||
IO_view();
|
||||
LOG_view();
|
||||
|
||||
if (!string.IsNullOrEmpty(Name_err.ToString())) Status_Str = Name_err.ToString();
|
||||
}
|
||||
void Tick_Event_5S(object sender, EventArgs e)//Tick_Event周期执行事件5S
|
||||
{
|
||||
Name_err = "";
|
||||
if (!LINK_OK) Modbus_link();
|
||||
|
||||
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();
|
||||
IO_view();
|
||||
if (LINK_OK) IO_data();
|
||||
if (!string.IsNullOrEmpty(Name_err.ToString()) && (!ERR_JOG)) //有故障信息,无故障保持
|
||||
{
|
||||
@@ -415,6 +417,7 @@ namespace DyeingComputer.ViewModel
|
||||
}
|
||||
|
||||
TimeSpan ts = new TimeSpan(1);//1秒间隔
|
||||
private int temp_time10s = 10;
|
||||
void STEP_RUN()
|
||||
{
|
||||
if (WORK_RUN == 2)
|
||||
@@ -504,6 +507,33 @@ namespace DyeingComputer.ViewModel
|
||||
}
|
||||
updata_dtm("1004", TO);
|
||||
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温度控制
|
||||
case "007":
|
||||
if (STEP_P1.ToString() == "1")
|
||||
@@ -948,7 +978,6 @@ namespace DyeingComputer.ViewModel
|
||||
DO = master.ReadCoils(slaveId, 01000, DO_L); //读取线圈
|
||||
RW = master.ReadHoldingRegisters(slaveId, 06000, RW_L); //读取寄存器
|
||||
LINK_OK = true;
|
||||
Name_err = "";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -958,7 +987,6 @@ namespace DyeingComputer.ViewModel
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void LOG_view()//细节页面
|
||||
{
|
||||
Sys_log = Resources.Target + Resources.Temperature + " : " + string.Format(" {0:###.#}", TEMP_tar) + "°C";//显示目标温度
|
||||
@@ -1025,11 +1053,25 @@ namespace DyeingComputer.ViewModel
|
||||
{ }
|
||||
|
||||
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 (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]";
|
||||
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]";
|
||||
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_a = new DataTable("AIO");
|
||||
public static DataTable dt_m = new DataTable("M");
|
||||
@@ -1075,13 +1117,20 @@ namespace DyeingComputer.ViewModel
|
||||
try
|
||||
{
|
||||
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);
|
||||
}
|
||||
catch (Exception ex) { Name_err = "IO_SYSData_D" + "(" + ex.Message + ")"; }
|
||||
try
|
||||
{
|
||||
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寄存器
|
||||
{
|
||||
try
|
||||
@@ -1097,7 +1146,7 @@ namespace DyeingComputer.ViewModel
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogGing.LogGingDATA(ex.ToString());
|
||||
LogGing.LogGingDATA("SDTM:"+ex.ToString());
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -1116,7 +1165,7 @@ namespace DyeingComputer.ViewModel
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogGing.LogGingDATA(ex.ToString());
|
||||
LogGing.LogGingDATA("SDTD:" + ex.ToString());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1135,7 +1184,7 @@ namespace DyeingComputer.ViewModel
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogGing.LogGingDATA(ex.ToString());
|
||||
LogGing.LogGingDATA("SDTA:" + ex.ToString());
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -1164,7 +1213,7 @@ namespace DyeingComputer.ViewModel
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogGing.LogGingDATA(ex.ToString());
|
||||
LogGing.LogGingDATA("UDTM:" + ex.ToString());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1174,17 +1223,6 @@ namespace DyeingComputer.ViewModel
|
||||
{
|
||||
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);
|
||||
drEmployee.BeginEdit();
|
||||
drEmployee["DIO"] = Value;
|
||||
@@ -1195,7 +1233,7 @@ namespace DyeingComputer.ViewModel
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogGing.LogGingDATA(ex.ToString());
|
||||
LogGing.LogGingDATA("UDTD:" + ex.ToString());
|
||||
}
|
||||
}
|
||||
public static void updata_dta(string key, int Value)//更新A寄存器
|
||||
@@ -1204,15 +1242,6 @@ namespace DyeingComputer.ViewModel
|
||||
{
|
||||
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);
|
||||
drEmployee.BeginEdit();
|
||||
drEmployee["AIO"] = Value;
|
||||
@@ -1223,7 +1252,7 @@ namespace DyeingComputer.ViewModel
|
||||
}
|
||||
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 String ID { get; set; }
|
||||
public string Info { get; set; }
|
||||
public string type { get; set; }
|
||||
}
|
||||
public ObservableCollection<T> ToObservableCollection<T>(DataTable dt) where T : class, new()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user