sc 11 months ago
parent
commit
55d5121292
  1. 2
      UserClass/AsyncTcpServer.cs
  2. 2
      UserClass/SQLDATA.cs
  3. 2
      View/TechnologicalProcessView.xaml
  4. 7
      View/TechnologicalProcessView.xaml.cs
  5. 11
      ViewModel/MainWindowViewModel.cs

2
UserClass/AsyncTcpServer.cs

@ -339,6 +339,8 @@ namespace DyeingComputer.UserClass
Chart_new.Add("Machine", MainWindowViewModel.S01);
Chart_new.Add("WorkNumder", MainWindowViewModel.WorkNumder);
Chart_new.Add("Time", MainWindowViewModel.SYSTime);
Chart_new.Add("Process", MainWindowViewModel.ProgramName);
Chart_new.Add("Step", MainWindowViewModel.Process_step);
Chart_new.Add("MST", MainWindowViewModel.TEMP_co);
Chart_new.Add("MTT", MainWindowViewModel.Selet_dtm("1010"));
Chart_new.Add("MTL", MainWindowViewModel.Selet_dtm("1015"));

2
UserClass/SQLDATA.cs

@ -81,7 +81,7 @@ namespace DyeingComputer.UserClass
string sql_script = "select * from WorkorderSteps where ProgramID = '" + workName + "'";
if (TechnologicalProcessView.sql != null) TechnologicalProcessView.sql.Clear(); //清空缓存
TechnologicalProcessView.sql = SQLiteHelpers.ExecuteDataSet(sql_script, null); //读取表写入缓存
TechnologicalProcessView.Program_Name = SQLiteHelpers.ExecuteScalar("select ProgramName from Workorder where ProgramID = '" + workName + "'", null).ToString();
MainWindowViewModel.ProgramName = SQLiteHelpers.ExecuteScalar("select ProgramName from Workorder where ProgramID = '" + workName + "'", null).ToString();
SQLiteHelpers.Delete("RUN", null, null); //删除run信息
DataTable data_t = new DataTable();

2
View/TechnologicalProcessView.xaml

@ -69,7 +69,7 @@
</DataGrid.Columns>
</DataGrid>
<TextBlock x:Name="log" HorizontalAlignment="Left" Margin="0,40,0,0" TextWrapping="Wrap" Width="600" FontSize="25" Background="White" Text="{Binding Sys_log}"/>
<TextBlock x:Name="name" HorizontalAlignment="Left" Margin="600,0,0,0" TextWrapping="Wrap" FontSize="24" Background="#FFD0D0D0" Text="NAME" Height="30" Block.TextAlignment="Center">
<TextBlock x:Name="name" HorizontalAlignment="Left" Margin="600,0,0,0" TextWrapping="Wrap" FontSize="24" Background="#FFD0D0D0" Text="{Binding Program_Name}" Height="30" Block.TextAlignment="Center">
<TextBlock.LayoutTransform>
<!--文字同样旋转90度-->
<RotateTransform Angle="270"/>

7
View/TechnologicalProcessView.xaml.cs

@ -49,7 +49,6 @@ namespace DyeingComputer.View
}
public static object workName;
public static string Program_Name;
public static SQLiteHelper SQLiteHelpers = null; //定义数据库
public static readonly string DBAddress = Environment.CurrentDirectory + "\\DataBase\\800COMPUTER.db"; //数据库路径
public static DataSet sql; //内存数据缓存
@ -61,7 +60,7 @@ namespace DyeingComputer.View
string sql_script = "select * from WorkorderSteps where ProgramID = '" + workName + "'";
if (sql != null) sql.Clear(); //清空缓存
sql = SQLiteHelpers.ExecuteDataSet(sql_script, null); //读取表写入缓存
Program_Name = SQLiteHelpers.ExecuteScalar("select ProgramName from WorkOrder where ProgramID = '" + workName + "'", null).ToString();
MainWindowViewModel.ProgramName = SQLiteHelpers.ExecuteScalar("select ProgramName from WorkOrder where ProgramID = '" + workName + "'", null).ToString();
if (sql != null) dt_TP = sql.Tables[0]; //转换显示计划表
SQLiteHelpers.Delete("RUN", null, null); //删除run信息
@ -92,7 +91,7 @@ namespace DyeingComputer.View
string sql_script = "select * from RUN";
if (sql != null) sql.Clear(); //清空缓存
sql = SQLiteHelpers.ExecuteDataSet(sql_script, null); //读取表写入缓存
Program_Name = SQLiteHelpers.ExecuteScalar("select Program from RUN where Step = '1'", null).ToString();
MainWindowViewModel.ProgramName = SQLiteHelpers.ExecuteScalar("select Program from RUN where Step = '1'", null).ToString();
MainWindowViewModel.WorkNumder = SQLiteHelpers.ExecuteScalar("select DYELOT from RUN where Step = '1'", null).ToString();
SQLiteHelpers.Close(); //关闭连接
@ -319,7 +318,7 @@ namespace DyeingComputer.View
// MainWindowViewModel.TechnologicalProcess_View = MainWindowViewModel.ToObservableCollection<TechnologicalProcess>(sql.Tables[0]);
// Grid.ItemsSource = dt_m.DE sql.Tables[0].DefaultView; //转换显示计划表
name.Text = Program_Name;
// name.Text = Program_Name;
}
}
}

11
ViewModel/MainWindowViewModel.cs

@ -211,13 +211,20 @@ namespace DyeingComputer.ViewModel
get { return sys_log; }
set { sys_log = value; OnPropertyChanged("Sys_log"); }
}
public string program_Name;
public string Program_Name //通知UI控件参数改变
{
get { return program_Name; }
set { program_Name = value; OnPropertyChanged("Program_Name"); }
}
public static int ViewID = 0;//页面id
public static object Name_err = "";
public static object SYSTime;
public static object WorkNumder;
public static object StatusStr;
public static object Process_step;
public static object Process_step = "-----";
public static string ProgramName = "-----";//工艺名
public static Int32 DIDETime; //空闲计时器
bool ERR_JOG;//故障状态
public void CountDown()
@ -251,6 +258,8 @@ namespace DyeingComputer.ViewModel
Work_Temp = Selet_dtm("1010") + " ℃";
Work_Numder = WorkNumder.ToString();
StatusStr = Status_Str;
Program_Name = ProgramName;
if(dt_TP==null) Process_step = dt_TP.Select("Step=" + RUN_STEPID).First().Field<string>("ParameterName");
if (!SETP_runtime) DIDETime++;

Loading…
Cancel
Save