204 lines
7.6 KiB
C#
204 lines
7.6 KiB
C#
using System;
|
|
using System.ComponentModel;
|
|
using System.Drawing;
|
|
using System.IO;
|
|
using System.Windows.Forms;
|
|
using AGVSystem.Cls;
|
|
using AGVSystem.Properties;
|
|
|
|
namespace AGVSystem
|
|
{
|
|
// Token: 0x0200001D RID: 29
|
|
public partial class SysSet : Form
|
|
{
|
|
// Token: 0x060001B5 RID: 437 RVA: 0x00048506 File Offset: 0x00046706
|
|
public SysSet()
|
|
{
|
|
this.InitializeComponent();
|
|
}
|
|
|
|
// Token: 0x060001B6 RID: 438 RVA: 0x00048520 File Offset: 0x00046720
|
|
private void button4_Click(object sender, EventArgs e)
|
|
{
|
|
bool flag = Param.UserName_temp == "";
|
|
if (flag)
|
|
{
|
|
MessageBox.Show("请登录管理员权限!", "AGV调度管理系统", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
|
|
}
|
|
else
|
|
{
|
|
ClsDBConn_sql clsDBConn_sql = new ClsDBConn_sql();
|
|
Param.map1_path = this.txt_path1.Text;
|
|
Param.map2_path = this.txt_path2.Text;
|
|
Param.map3_path = this.txt_path3.Text;
|
|
Param.map1_status = this.checkBox1.Checked;
|
|
Param.map2_status = this.checkBox2.Checked;
|
|
Param.map3_status = this.checkBox3.Checked;
|
|
Param.Load_Path_His = this.chk_load_path_his.Checked;
|
|
clsDBConn_sql.Command("UPDATE [SysParam] SET [Col_Value] ='" + Param.map1_status.ToString() + "' WHERE [Col_Name] ='map1_status'");
|
|
clsDBConn_sql.Command("UPDATE [SysParam] SET [Col_Value] ='" + Param.map2_status.ToString() + "' WHERE [Col_Name] ='map2_status'");
|
|
clsDBConn_sql.Command("UPDATE [SysParam] SET [Col_Value] ='" + Param.map3_status.ToString() + "' WHERE [Col_Name] ='map3_status'");
|
|
clsDBConn_sql.Command("UPDATE [SysParam] SET [Col_Value] ='" + this.numericUpDown2.Value.ToString() + "' WHERE [Col_Name] ='Card1_Interval'");
|
|
clsDBConn_sql.Command("UPDATE [SysParam] SET [Col_Value] ='" + this.numericUpDown3.Value.ToString() + "' WHERE [Col_Name] ='Card2_Interval'");
|
|
clsDBConn_sql.Command("UPDATE [SysParam] SET [Col_Value] ='" + this.numericUpDown4.Value.ToString() + "' WHERE [Col_Name] ='Card3_Interval'");
|
|
Settings.Default.Save();
|
|
base.Close();
|
|
}
|
|
}
|
|
|
|
// Token: 0x060001B7 RID: 439 RVA: 0x000486C0 File Offset: 0x000468C0
|
|
private void SysSet_Load(object sender, EventArgs e)
|
|
{
|
|
this.checkBox1.Checked = Param.map1_status;
|
|
this.checkBox2.Checked = Param.map2_status;
|
|
this.checkBox3.Checked = Param.map3_status;
|
|
this.chk_auto_control.Checked = Param.Auto_Control;
|
|
this.chk_load_path_his.Checked = Param.Load_Path_His;
|
|
this.chk_location_auto_display.Checked = Param.Agv_Location_Auto_Display;
|
|
this.textBox4.Text = Param.Pro_id;
|
|
this.textBox5.Text = Param.Pro_factory;
|
|
this.textBox6.Text = Param.Pro_remark;
|
|
this.numericUpDown1.Value = Param.Day_Count;
|
|
this.numericUpDown2.Value = Param.Card1_Interval;
|
|
this.numericUpDown3.Value = Param.Card2_Interval;
|
|
this.numericUpDown4.Value = Param.Card3_Interval;
|
|
bool flag = this.numericUpDown2.Value > 0m;
|
|
if (flag)
|
|
{
|
|
this.cK_IO1.Checked = true;
|
|
}
|
|
bool flag2 = this.numericUpDown3.Value > 0m;
|
|
if (flag2)
|
|
{
|
|
this.cK_IO2.Checked = true;
|
|
}
|
|
bool flag3 = this.numericUpDown4.Value > 0m;
|
|
if (flag3)
|
|
{
|
|
this.cK_IO3.Checked = true;
|
|
}
|
|
}
|
|
|
|
// Token: 0x060001B8 RID: 440 RVA: 0x00048834 File Offset: 0x00046A34
|
|
private void button1_Click(object sender, EventArgs e)
|
|
{
|
|
bool flag = Param.UserName_temp == "";
|
|
if (flag)
|
|
{
|
|
MessageBox.Show("请登录管理员权限!", "AGV调度管理系统", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
|
|
}
|
|
else
|
|
{
|
|
OpenFileDialog openFileDialog = new OpenFileDialog();
|
|
openFileDialog.Filter = "图片文件png|*.png|图片文件jpg|*.jpg|所有文件(*.*)|*.*";
|
|
bool flag2 = openFileDialog.ShowDialog() == DialogResult.OK;
|
|
if (flag2)
|
|
{
|
|
this.txt_path1.Text = openFileDialog.FileName;
|
|
try
|
|
{
|
|
File.Copy(openFileDialog.FileName, Application.StartupPath + "\\map\\" + Param.Pro_id + "_1", true);
|
|
}
|
|
catch (IOException ex)
|
|
{
|
|
bool flag3 = ex.GetType().Name == "IOException";
|
|
if (flag3)
|
|
{
|
|
MessageBox.Show("您可能已打开AGV调度监控页面,请重启软件后再设置!", "参数设置", MessageBoxButtons.OK, MessageBoxIcon.Hand);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x060001B9 RID: 441 RVA: 0x00048910 File Offset: 0x00046B10
|
|
private void button2_Click(object sender, EventArgs e)
|
|
{
|
|
bool flag = Param.UserName_temp == "";
|
|
if (flag)
|
|
{
|
|
MessageBox.Show("请登录管理员权限!", "AGV调度管理系统", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
|
|
}
|
|
else
|
|
{
|
|
OpenFileDialog openFileDialog = new OpenFileDialog();
|
|
openFileDialog.Filter = "图片文件png|*.png|图片文件jpg|*.jpg|所有文件(*.*)|*.*";
|
|
bool flag2 = openFileDialog.ShowDialog() == DialogResult.OK;
|
|
if (flag2)
|
|
{
|
|
this.txt_path2.Text = openFileDialog.FileName;
|
|
try
|
|
{
|
|
File.Copy(openFileDialog.FileName, Application.StartupPath + "\\map\\" + Param.Pro_id + "_2", true);
|
|
}
|
|
catch (IOException ex)
|
|
{
|
|
bool flag3 = ex.GetType().Name == "IOException";
|
|
if (flag3)
|
|
{
|
|
MessageBox.Show("您可能已打开AGV调度监控页面,请重启软件后再设置!", "参数设置", MessageBoxButtons.OK, MessageBoxIcon.Hand);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x060001BA RID: 442 RVA: 0x000489EC File Offset: 0x00046BEC
|
|
private void button3_Click(object sender, EventArgs e)
|
|
{
|
|
bool flag = Param.UserName_temp == "";
|
|
if (flag)
|
|
{
|
|
MessageBox.Show("请登录管理员权限!", "AGV调度管理系统", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
|
|
}
|
|
else
|
|
{
|
|
OpenFileDialog openFileDialog = new OpenFileDialog();
|
|
openFileDialog.Filter = "图片文件png|*.png|图片文件jpg|*.jpg|所有文件(*.*)|*.*";
|
|
bool flag2 = openFileDialog.ShowDialog() == DialogResult.OK;
|
|
if (flag2)
|
|
{
|
|
this.txt_path3.Text = openFileDialog.FileName;
|
|
try
|
|
{
|
|
File.Copy(openFileDialog.FileName, Application.StartupPath + "\\map\\" + Param.Pro_id + "_3", true);
|
|
}
|
|
catch (IOException ex)
|
|
{
|
|
bool flag3 = ex.GetType().Name == "IOException";
|
|
if (flag3)
|
|
{
|
|
MessageBox.Show("您可能已打开AGV调度监控页面,请重启软件后再设置!", "参数设置", MessageBoxButtons.OK, MessageBoxIcon.Hand);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x060001BB RID: 443 RVA: 0x00048AC8 File Offset: 0x00046CC8
|
|
private void button5_Click(object sender, EventArgs e)
|
|
{
|
|
bool flag = Param.UserName_temp == "";
|
|
if (flag)
|
|
{
|
|
MessageBox.Show("请登录管理员权限!", "AGV调度管理系统", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
|
|
}
|
|
else
|
|
{
|
|
Param.Day_Count = (int)this.numericUpDown1.Value;
|
|
Param.Xj_Time1 = this.dateTimePicker1.Value.TimeOfDay.ToString();
|
|
Param.Xj_Time2 = this.dateTimePicker2.Value.TimeOfDay.ToString();
|
|
ClsDBConn_sql clsDBConn_sql = new ClsDBConn_sql();
|
|
clsDBConn_sql.Command("UPDATE [SysParam] SET [Col_Value] ='" + this.chk_load_path_his.Checked.ToString() + "' WHERE [Col_Name] ='Load_Path_His'");
|
|
clsDBConn_sql.Command("UPDATE [SysParam] SET [Col_Value] ='" + this.chk_auto_control.Checked.ToString() + "' WHERE [Col_Name] ='Auto_Control'");
|
|
clsDBConn_sql.Command("UPDATE [SysParam] SET [Col_Value] ='" + Param.Day_Count.ToString() + "' WHERE [Col_Name] ='Day_Count'");
|
|
clsDBConn_sql.Command("UPDATE [SysParam] SET [Col_Value] ='" + this.chk_location_auto_display.Checked.ToString() + "' WHERE [Col_Name] ='AgvLoc_Dynamic_Display'");
|
|
clsDBConn_sql.Command("UPDATE [SysParam] SET [Col_Value] ='" + Param.Xj_Time1.ToString() + "' WHERE [Col_Name] ='Xj_Time1'");
|
|
clsDBConn_sql.Command("UPDATE [SysParam] SET [Col_Value] ='" + Param.Xj_Time2.ToString() + "' WHERE [Col_Name] ='Xj_Time2'");
|
|
Settings.Default.Save();
|
|
base.Close();
|
|
}
|
|
}
|
|
}
|
|
}
|