Browse Source

添加图片资源,修改插入逻辑错误,修改主功能循环跳转逻辑错误

master
sc 3 months ago
parent
commit
ad765afbbd
  1. 6
      ConvertMoels/StatenToImageConvert.cs
  2. 22
      DyeingComputer.csproj
  3. BIN
      Lmage/00.png
  4. BIN
      Lmage/ID007.png
  5. BIN
      Lmage/ID008.png
  6. BIN
      Lmage/ID013.png
  7. BIN
      Lmage/ID015.png
  8. BIN
      Lmage/ID017.png
  9. BIN
      Lmage/ID020.png
  10. BIN
      Lmage/ID022.png
  11. BIN
      Lmage/ID031 (2).png
  12. BIN
      Lmage/ID031 (3).png
  13. BIN
      Lmage/ID031.png
  14. BIN
      Lmage/ID0311 (2).png
  15. BIN
      Lmage/ID0311.png
  16. BIN
      Lmage/ID035.png
  17. BIN
      Lmage/ID036.png
  18. BIN
      Lmage/ID040.png
  19. BIN
      Lmage/ID041.png
  20. BIN
      Lmage/ID049.png
  21. BIN
      Lmage/ID054.png
  22. BIN
      Lmage/ID055.png
  23. BIN
      Lmage/ID056.png
  24. BIN
      Lmage/ID066.png
  25. BIN
      Lmage/ID067.png
  26. BIN
      Lmage/ID090.png
  27. BIN
      Lmage/ID091.png
  28. BIN
      Lmage/ID093.png
  29. BIN
      Lmage/ID094.png
  30. BIN
      Lmage/去除图片线条.png
  31. 10
      UserClass/SQLDATA.cs
  32. 20
      View/TechnologicalProcessView.xaml
  33. 69
      View/TechnologicalProcessView.xaml.cs
  34. 10
      ViewModel/MainWindowViewModel.cs
  35. 10
      Windows/ViewStep.xaml.cs

6
ConvertMoels/StatenToImageConvert.cs

@ -59,14 +59,16 @@ namespace DyeingComputer.ConvertMoels
return new BitmapImage(new Uri("/Lmage/ID064.png", UriKind.Relative));//
case "065":
return new BitmapImage(new Uri("/Lmage/ID065.png", UriKind.Relative));//
case "066":
return new BitmapImage(new Uri("/Lmage/ID066.png", UriKind.Relative));//
case "067":
return new BitmapImage(new Uri("/Lmage/ID067.png", UriKind.Relative));//
case "068":
return new BitmapImage(new Uri("/Lmage/ID068.png", UriKind.Relative));//
case "090":
return new BitmapImage(new Uri("/Lmage/ID090.png", UriKind.Relative));//
case "091":
return new BitmapImage(new Uri("/Lmage/ID091.png", UriKind.Relative));//
case "093":
return new BitmapImage(new Uri("/Lmage/ID093.png", UriKind.Relative));//
case "094":
return new BitmapImage(new Uri("/Lmage/ID094.png", UriKind.Relative));//
default:

22
DyeingComputer.csproj

@ -428,6 +428,28 @@
<Content Include="Fonts\font-awesome-4.7.0\css\font-awesome.css" />
<Content Include="Fonts\font-awesome-4.7.0\css\font-awesome.min.css" />
<Content Include="Fonts\font-awesome-4.7.0\fonts\fontawesome-webfont.svg" />
<Resource Include="Lmage\ID093.png" />
<Resource Include="Lmage\ID094.png" />
<Resource Include="Lmage\ID090.png" />
<Resource Include="Lmage\ID091.png" />
<Resource Include="Lmage\ID066.png" />
<Resource Include="Lmage\ID067.png" />
<Resource Include="Lmage\ID022.png" />
<Resource Include="Lmage\ID017.png" />
<Resource Include="Lmage\ID013.png" />
<Resource Include="Lmage\ID015.png" />
<Resource Include="Lmage\ID020.png" />
<Resource Include="Lmage\ID007.png" />
<Resource Include="Lmage\ID008.png" />
<Resource Include="Lmage\ID049.png" />
<Resource Include="Lmage\ID031.png" />
<Resource Include="Lmage\ID035.png" />
<Resource Include="Lmage\ID036.png" />
<Resource Include="Lmage\ID040.png" />
<Resource Include="Lmage\ID041.png" />
<Resource Include="Lmage\ID055.png" />
<Resource Include="Lmage\ID056.png" />
<Resource Include="Lmage\ID054.png" />
<Resource Include="Lmage\ID064.png" />
<Resource Include="Lmage\ID065.png" />
<Resource Include="Lmage\ID039.png" />

BIN
Lmage/00.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
Lmage/ID007.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
Lmage/ID008.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
Lmage/ID013.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
Lmage/ID015.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

BIN
Lmage/ID017.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

BIN
Lmage/ID020.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
Lmage/ID022.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

BIN
Lmage/ID031 (2).png

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

BIN
Lmage/ID031 (3).png

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

BIN
Lmage/ID031.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

BIN
Lmage/ID0311 (2).png

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

BIN
Lmage/ID0311.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

BIN
Lmage/ID035.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
Lmage/ID036.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
Lmage/ID040.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

BIN
Lmage/ID041.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

BIN
Lmage/ID049.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
Lmage/ID054.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

BIN
Lmage/ID055.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

BIN
Lmage/ID056.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

BIN
Lmage/ID066.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

BIN
Lmage/ID067.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
Lmage/ID090.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
Lmage/ID091.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
Lmage/ID093.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
Lmage/ID094.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
Lmage/去除图片线条.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

10
UserClass/SQLDATA.cs

@ -81,19 +81,19 @@ namespace DyeingComputer.UserClass
SQLiteHelpers.Open(); //打开数据库
int r = 0;
string sql_script = "select * from WorkorderSteps where ProgramID = '" + workName + "'";
if (TechnologicalProcessView.sql != null) TechnologicalProcessView.sql.Clear(); //清空缓存
TechnologicalProcessView.sql = SQLiteHelpers.ExecuteDataSet(sql_script, null); //读取表写入缓存
// if (TechnologicalProcessView.sql != null) TechnologicalProcessView.sql.Clear(); //清空缓存
MainWindowViewModel.dt_TP = SQLiteHelpers.ExecuteDataSet(sql_script, null).Tables[0]; //读取表写入缓存
MainWindowViewModel.ProgramName = SQLiteHelpers.ExecuteScalar("select ProgramName from Workorder where ProgramID = '" + workName + "'", null).ToString();
SQLiteHelpers.Delete("RUN", null, null); //删除run信息
DataTable data_t = new DataTable();
data_t = TechnologicalProcessView.sql.Tables[0].Clone();
data_t = MainWindowViewModel.dt_TP.Clone();
data_t.Columns.Add("DYELOT", typeof(string)); //添加列
int a = TechnologicalProcessView.sql.Tables[0].Rows.Count;
int a = MainWindowViewModel.dt_TP.Rows.Count;
for (int i = 0; i < a; i++)
{
data_t.Clear();//清空
DataRow dt = TechnologicalProcessView.sql.Tables[0].Rows[i];//行转
DataRow dt = MainWindowViewModel.dt_TP.Rows[i];//行转
DataRow dr = data_t.NewRow();
dr.ItemArray = dt.ItemArray;
dr.BeginEdit(); //添加订单号

20
View/TechnologicalProcessView.xaml

@ -87,26 +87,6 @@
<DataGridTextColumn Binding="{Binding Parameter3}" Width="0" MinWidth="0" MaxWidth="0"/>
<DataGridTextColumn Binding="{Binding Parameter4}" Width="0" MinWidth="0" MaxWidth="0"/>
<DataGridTextColumn Binding="{Binding Parameter5}" Width="0" MinWidth="0" MaxWidth="0"/>
<DataGridTextColumn Binding="{Binding Parameter6}" Width="0" MinWidth="0" MaxWidth="0"/>
<DataGridTextColumn Binding="{Binding Parameter7}" Width="0" MinWidth="0" MaxWidth="0"/>
<DataGridTextColumn Binding="{Binding Parameter8}" Width="0" MinWidth="0" MaxWidth="0"/>
<DataGridTextColumn Binding="{Binding Parameter9}" Width="0" MinWidth="0" MaxWidth="0"/>
<DataGridTextColumn Binding="{Binding Parameter10}" Width="0" MinWidth="0" MaxWidth="0"/>
<DataGridTextColumn Binding="{Binding Parameter1_S1}" Width="0" MinWidth="0" MaxWidth="0"/>
<DataGridTextColumn Binding="{Binding Parameter2_S1}" Width="0" MinWidth="0" MaxWidth="0"/>
<DataGridTextColumn Binding="{Binding Parameter3_S1}" Width="0" MinWidth="0" MaxWidth="0"/>
<DataGridTextColumn Binding="{Binding Parameter4_S1}" Width="0" MinWidth="0" MaxWidth="0"/>
<DataGridTextColumn Binding="{Binding Parameter5_S1}" Width="0" MinWidth="0" MaxWidth="0"/>
<DataGridTextColumn Binding="{Binding Parameter1_S2}" Width="0" MinWidth="0" MaxWidth="0"/>
<DataGridTextColumn Binding="{Binding Parameter2_S2}" Width="0" MinWidth="0" MaxWidth="0"/>
<DataGridTextColumn Binding="{Binding Parameter3_S2}" Width="0" MinWidth="0" MaxWidth="0"/>
<DataGridTextColumn Binding="{Binding Parameter4_S2}" Width="0" MinWidth="0" MaxWidth="0"/>
<DataGridTextColumn Binding="{Binding Parameter5_S2}" Width="0" MinWidth="0" MaxWidth="0"/>
<DataGridTextColumn Binding="{Binding Parameter1_S3}" Width="0" MinWidth="0" MaxWidth="0"/>
<DataGridTextColumn Binding="{Binding Parameter2_S3}" Width="0" MinWidth="0" MaxWidth="0"/>
<DataGridTextColumn Binding="{Binding Parameter3_S3}" Width="0" MinWidth="0" MaxWidth="0"/>
<DataGridTextColumn Binding="{Binding Parameter4_S3}" Width="0" MinWidth="0" MaxWidth="0"/>
<DataGridTextColumn Binding="{Binding Parameter5_S3}" Width="0" MinWidth="0" MaxWidth="0"/>
<DataGridTemplateColumn Header="{x:Static lang:Resources.Directives}" Width="100" IsReadOnly="True">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>

69
View/TechnologicalProcessView.xaml.cs

@ -268,13 +268,12 @@ namespace DyeingComputer.View
public static object workName;
public static SQLiteHelper SQLiteHelpers = null; //定义数据库
public static readonly string DBAddress = Environment.CurrentDirectory + "\\DataBase\\800COMPUTER.db"; //数据库路径
public static DataSet sql; //内存数据缓存
//public static DataSet sql; //内存数据缓存
string Numder = null;
string ID = null;
string P1 = "0", P2 = "0", P3 = "0", P4 = "0", P5 = "0";
object P1_S1, P2_S1, P3_S1, P4_S1, P5_S1, P1_S2, P2_S2, P3_S2, P4_S2, P5_S2, P1_S3, P2_S3, P3_S3, P4_S3, P5_S3;
private void TechnologicalProcess_Import()
/* private void TechnologicalProcess_Import()
{
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
SQLiteHelpers.Open(); //打开数据库
@ -304,7 +303,7 @@ namespace DyeingComputer.View
r = SQLiteHelpers.InsertData("RUN", SQLiteHelpers.DataTableToDictionary(data_t));//行插入
}
SQLiteHelpers.Close(); //关闭连接
}
}*/
private void TechnologicalProcess_sql()
{
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
@ -343,7 +342,7 @@ namespace DyeingComputer.View
ID = null;
if (e.PNAME != "")
{
DataRow dr = sql.Tables[0].Rows[n - 1];
DataRow dr = MainWindowViewModel.dt_TP.Rows[n - 1];
dr.BeginEdit();
dr["StepID"] = e.StepID;
dr["StepName"] = e.StepNAME;
@ -355,7 +354,7 @@ namespace DyeingComputer.View
dr["Parameter5"] = e.P5;
dr.EndEdit();
MainWindowViewModel.dt_TP = sql.Tables[0];
// MainWindowViewModel.dt_TP = sql.Tables[0];
GridSTEP.SelectedIndex = -1;
}
else
@ -436,13 +435,39 @@ namespace DyeingComputer.View
SQLiteHelpers.Close();
if (ID != null) { d = Convert.ToInt16(ID); } else { return; }
DataRow dr = MainWindowViewModel.dt_TP.NewRow();//添加表数据
DataRow dr = MainWindowViewModel.dt_TP.NewRow();//添加表数据
//
dr["WorkOrder"] = MainWindowViewModel.WorkNumder;
dr["ProgramID"] = ProgramID;
dr["Program"] = ProgramNAME;
dr["Program"] = ProgramNAME;
dr["Parameter1"] = 0;
dr["Parameter2"] = 0;
dr["Parameter3"] = 0;
dr["Parameter4"] = 0;
dr["Parameter5"] = 0;
dr["Parameter6"] = 0;
dr["Parameter7"] = 0;
dr["Parameter8"] = 0;
dr["Parameter9"] = 0;
dr["Parameter10"] = 0;
dr["Parameter1_S1"] = 0;
dr["Parameter2_S1"] = 0;
dr["Parameter3_S1"] = 0;
dr["Parameter4_S1"] = 0;
dr["Parameter5_S1"] = 0;
dr["Parameter1_S2"] = 0;
dr["Parameter2_S2"] = 0;
dr["Parameter3_S2"] = 0;
dr["Parameter4_S2"] = 0;
dr["Parameter5_S2"] = 0;
dr["Parameter1_S3"] = 0;
dr["Parameter2_S3"] = 0;
dr["Parameter3_S3"] = 0;
dr["Parameter4_S3"] = 0;
dr["Parameter5_S3"] = 0;
MainWindowViewModel.dt_TP.Rows.InsertAt(dr, d - 1);
// ID = null;
Dat();
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "UserActions", "Insert", "STEP = "+ID);
if (ID == null) return;// ID = MainWindowViewModel.dt_TP.Rows.Count.ToString();
ViewStep viewstop = new ViewStep(null, MainWindowViewModel.dt_TP.Select("STEP = " + ID).First());
@ -458,7 +483,7 @@ namespace DyeingComputer.View
ID = null;
if (e.PNAME != "")
{
DataRow dr = sql.Tables[0].Rows[n - 1];
DataRow dr = MainWindowViewModel.dt_TP.Rows[n - 1];
dr.BeginEdit();
dr["StepID"] = e.StepID;
dr["StepName"] = e.StepNAME;
@ -470,7 +495,7 @@ namespace DyeingComputer.View
dr["Parameter5"] = e.P5;
dr.EndEdit();
MainWindowViewModel.dt_TP = sql.Tables[0];
// MainWindowViewModel.dt_TP = sql.Tables[0];
GridSTEP.SelectedIndex = -1;
}
else
@ -504,7 +529,7 @@ namespace DyeingComputer.View
private void ProgramgroupView_Jump_Click(object sender, RoutedEventArgs e)
{
int n = Convert.ToInt16(ID);
DataRow dr = sql.Tables[0].Rows[n - 1];
DataRow dr = MainWindowViewModel.dt_TP.Rows[n - 1];
dr.BeginEdit();
dr["RUN"] = 2;
dr.EndEdit();
@ -528,23 +553,7 @@ namespace DyeingComputer.View
P2 = (GridSTEP.Columns[7].GetCellContent(GridSTEP.Items[rownum]) as TextBlock).Text;//定位第7列,
P3 = (GridSTEP.Columns[8].GetCellContent(GridSTEP.Items[rownum]) as TextBlock).Text;//定位第8列,
P4 = (GridSTEP.Columns[9].GetCellContent(GridSTEP.Items[rownum]) as TextBlock).Text;//定位第9列,
P5 = (GridSTEP.Columns[10].GetCellContent(GridSTEP.Items[rownum]) as TextBlock).Text;//定位第10列,
P1_S1 = (GridSTEP.Columns[16].GetCellContent(GridSTEP.Items[rownum]) as TextBlock).Text;
P2_S1 = (GridSTEP.Columns[17].GetCellContent(GridSTEP.Items[rownum]) as TextBlock).Text;//
P3_S1 = (GridSTEP.Columns[18].GetCellContent(GridSTEP.Items[rownum]) as TextBlock).Text;//
P4_S1 = (GridSTEP.Columns[19].GetCellContent(GridSTEP.Items[rownum]) as TextBlock).Text;//
P5_S1 = (GridSTEP.Columns[20].GetCellContent(GridSTEP.Items[rownum]) as TextBlock).Text;//
P1_S2 = (GridSTEP.Columns[21].GetCellContent(GridSTEP.Items[rownum]) as TextBlock).Text;
P2_S2 = (GridSTEP.Columns[22].GetCellContent(GridSTEP.Items[rownum]) as TextBlock).Text;//
P3_S2 = (GridSTEP.Columns[23].GetCellContent(GridSTEP.Items[rownum]) as TextBlock).Text;//
P4_S2 = (GridSTEP.Columns[24].GetCellContent(GridSTEP.Items[rownum]) as TextBlock).Text;//
P5_S2 = (GridSTEP.Columns[25].GetCellContent(GridSTEP.Items[rownum]) as TextBlock).Text;//
P1_S3 = (GridSTEP.Columns[26].GetCellContent(GridSTEP.Items[rownum]) as TextBlock).Text;//
P2_S3 = (GridSTEP.Columns[27].GetCellContent(GridSTEP.Items[rownum]) as TextBlock).Text;//,
P3_S3 = (GridSTEP.Columns[28].GetCellContent(GridSTEP.Items[rownum]) as TextBlock).Text;//,
P4_S3 = (GridSTEP.Columns[29].GetCellContent(GridSTEP.Items[rownum]) as TextBlock).Text;//
P5_S3 = (GridSTEP.Columns[30].GetCellContent(GridSTEP.Items[rownum]) as TextBlock).Text;
P5 = (GridSTEP.Columns[10].GetCellContent(GridSTEP.Items[rownum]) as TextBlock).Text;//定位第10列,
}
}

10
ViewModel/MainWindowViewModel.cs

@ -880,7 +880,7 @@ namespace DyeingComputer.ViewModel
updata_RUN.Clear();
updata_RUN.Add("RUN", 1);
SQLiteHelpers.Update("RUN", updata_RUN, "Step ='"+ RUN_STEPID + "'", null);//更新
dt_TP = SQLiteHelpers.ExecuteDataSet("select * from RUN WHERE Mode = 0", null).Tables[0];
dt_TP = SQLiteHelpers.ExecuteDataSet("select * from RUN", null).Tables[0];
SQLiteHelpers.Close();//关闭数据库
}
@ -1186,14 +1186,16 @@ namespace DyeingComputer.ViewModel
}
}
}
if (errTabler.Rows.Count == 0) Status_Str = Resources.Washing + "(" + Properties.Resources.WaterLevel + ")";
}
else { STEP_finish = true; }
break;//批次水位水洗
case "015":
if (errTabler.Rows.Count == 0) Status_Str = Resources.Washing + "(" + Resources.Overflow + ")";
break;//溢流水洗
case "017":
if (errTabler.Rows.Count == 0) Status_Str = Resources.Washing + "(" + Properties.Resources.Cooling + ")";
break;//降温水洗
case "020":
if (STEP_P1.ToString() == "1")
@ -1752,7 +1754,7 @@ namespace DyeingComputer.ViewModel
{
if (STEP_finish)
{
RUN_STEPID++;
RUN_STEPID = dt_TP.Select("RUN ='1'").First().Field<int>("Step") +1;
DataRow[] arrRows = dt_TP.Select("STEP ='" + RUN_STEPID + "'");
string T_ID = arrRows[0]["StepID"].ToString();
double T_P1 = Convert.ToDouble(arrRows[0]["Parameter1"].ToString());
@ -2293,7 +2295,7 @@ namespace DyeingComputer.ViewModel
dt_m = SQLiteHelpers.ExecuteDataSet("select * from IOName where type='M' order by ID", null).Tables[0];
dt_ParameterSet = SQLiteHelpers.ExecuteDataSet("select * from Parameters order by ParameterID asc", null).Tables[0];
dt_SysSet = SQLiteHelpers.ExecuteDataSet("select * from System order by ParameterID asc", null).Tables[0];
dt_TP = SQLiteHelpers.ExecuteDataSet("select * from RUN WHERE Mode = 0", null).Tables[0];
dt_TP = SQLiteHelpers.ExecuteDataSet("select * from RUN", null).Tables[0];
SQLiteHelpers.Close();
dt_d.RowChanged += new DataRowChangeEventHandler(ROW_changed_D);//添加行改变触发事件

10
Windows/ViewStep.xaml.cs

@ -42,11 +42,11 @@ namespace DyeingComputer.Windows
boxNAME.Focus();
boxNAME.Text = Numder;
P1.Text = DAT.Field<string>("Parameter1");
P2.Text = DAT.Field<string>("Parameter2");
P3.Text = DAT.Field<string>("Parameter3");
P4.Text = DAT.Field<string>("Parameter4");
P5.Text = DAT.Field<string>("Parameter5");
P1.Text = DAT.Field<double>("Parameter1").ToString();
P2.Text = DAT.Field<double>("Parameter2").ToString();
P3.Text = DAT.Field<double>("Parameter3").ToString();
P4.Text = DAT.Field<double>("Parameter4").ToString();
P5.Text = DAT.Field<double>("Parameter5").ToString();
/* P1.Visibility = Visibility.Collapsed;
P1N.Visibility = Visibility.Collapsed;
P2.Visibility = Visibility.Collapsed;

Loading…
Cancel
Save