网络功能添加错误状态返回

This commit is contained in:
sc committed 2025-01-12 22:24:10 +08:00
commit 409fc84191
2 files changed
+51 -42

No files matched your search

+14 -21
View File
@@ -18,6 +18,7 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Threading;
using System.Xml.Linq;
using static DyeingComputer.UserClass.SqliteHelper;
using static DyeingComputer.Windows.ViewProgram;
@@ -39,9 +40,6 @@ namespace DyeingComputer.View
private void UserControl_Loaded(object sender, RoutedEventArgs e)
{
Workorder_sql();
WpfPlot();
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
SQLiteHelpers.Open(); //打开数据库
string S09 = SQLiteHelpers.ExecuteScalar("select value from system where ParameterID = 'S09'", null).ToString(); //读取
@@ -51,7 +49,19 @@ namespace DyeingComputer.View
if (S09 == "0") WorkOrderView_new.IsEnabled = false;//禁止用户新建
if (S10 == "0") WorkOrderView_del.IsEnabled = false;
if (S11 == "0") WorkOrderView_redy.IsEnabled = false;
DispatcherTimer timer1s = new DispatcherTimer//初始化循环,每1秒调用一次Tick
{
Interval = TimeSpan.FromSeconds(1)//秒
};
timer1s.Tick += Tick_Event_1S;
timer1s.Start();
}
void Tick_Event_1S(object sender, EventArgs e)
{
Workorder_sql();
}
private SQLiteHelper SQLiteHelpers = null; //定义数据库
private readonly string DBAddress = Environment.CurrentDirectory + "\\DataBase\\800COMPUTER.db"; //数据库路径
DataSet sql; //内存数据缓存
@@ -83,24 +93,7 @@ namespace DyeingComputer.View
//System.GC.Collect();
}
public void WpfPlot()
{
DateTime[] xs = Generate.ConsecutiveHours(100);
double[] ys = Generate.RandomWalk(100);
//double q = ploigrid.ActualHeight;
//WpfPlot_Grid.y. SetAxisLimitsY(yMin: 0, yMax: 150);
// WpfPlot_Grid.Height = 500;
// WpfPlot_Grid.Plot.Grid.XAxisStyle.IsVisible = true;
// WpfPlot_Grid.Plot.Grid.YAxisStyle.IsVisible = false;
// WpfPlot_Grid.Plot.YLabel("Temperature (C)");
}
private void WorkOrderView_lock_Click(object sender, RoutedEventArgs e)//锁定按钮
{
if (WorkOrder_Numder == null) return;