Files
FG2608061/反编译CODE/华晓AGV管理系统/Agv_Status.cs
T

148 lines
5.3 KiB
C#

using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using AGVSystem.Cls;
using AGVSystem.Properties;
namespace AGVSystem
{
// Token: 0x02000006 RID: 6
public partial class Agv_Status : Form
{
// Token: 0x06000064 RID: 100 RVA: 0x0000C3AB File Offset: 0x0000A5AB
public Agv_Status()
{
this.InitializeComponent();
}
// Token: 0x06000065 RID: 101 RVA: 0x0000C3D4 File Offset: 0x0000A5D4
private void agv_init(int agv_qty)
{
int num = 0;
bool flag = this.panel3.Width >= this.panel3.Height;
if (flag)
{
num = this.panel3.Height / (int)Convert.ToInt16(Math.Sqrt((double)agv_qty));
}
else
{
num = this.panel3.Width / (int)Convert.ToInt16(Math.Sqrt((double)agv_qty));
}
bool flag2 = num > 512;
if (flag2)
{
num = 512;
}
bool flag3 = num < 21;
if (flag3)
{
num = 21;
}
int num2 = 0;
byte b = 1;
while ((short)b <= Convert.ToInt16(this.panel3.Height / num))
{
byte b2 = 1;
while ((short)b2 <= Convert.ToInt16(this.panel3.Width / num))
{
num2++;
Button button = new Button();
button.Click += this.btn_info_Click;
button.Parent = this.panel3;
button.Text = num2.ToString();
button.Name = "btn" + num2.ToString();
button.Location = new Point(5 + (int)(b2 - 1) * num, 5 + (int)(b - 1) * num);
button.Height = num - 5;
button.Width = num - 5;
bool flag4 = num2 > (int)Param.AGV_Qty;
if (flag4)
{
button.Enabled = false;
}
else
{
try
{
int num3 = num2;
button.BackgroundImageLayout = ImageLayout.Zoom;
button.TextAlign = ContentAlignment.TopLeft;
button.BackgroundImage = ((Func.AgvInfo[num3 - 1].Type == 6) ? Resources._6 : Resources._8);
button.Tag = Func.AgvInfo[num3 - 1].AssemblyName + "-" + Func.AgvInfo[num3 - 1].Internal_ID.ToString() + "号设备";
this.lab_color[num2 - 1] = new Label();
this.lab_color[num2 - 1].Location = new Point(button.Location.X + button.Width - 15, button.Location.Y + button.Height - 15);
this.lab_color[num2 - 1].Width = 10;
this.lab_color[num2 - 1].Height = 10;
this.lab_color[num2 - 1].BackColor = Color.Silver;
this.lab_color[num2 - 1].Parent = this.panel3;
button.SendToBack();
}
catch
{
}
}
b2 += 1;
}
b += 1;
}
}
// Token: 0x06000066 RID: 102 RVA: 0x0000C6B8 File Offset: 0x0000A8B8
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
bool flag = Param.UserName_temp == "";
if (flag)
{
MessageBox.Show("请登录管理员权限!", "AGV调度管理系统", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
}
}
// Token: 0x06000067 RID: 103 RVA: 0x0000C6F0 File Offset: 0x0000A8F0
private void Agv_Status_Load(object sender, EventArgs e)
{
bool flag = Param.AGV_Qty > 0;
if (flag)
{
this.agv_init((int)Param.AGV_Qty);
}
}
// Token: 0x06000068 RID: 104 RVA: 0x0000C718 File Offset: 0x0000A918
private void btn_info_Click(object sender, EventArgs e)
{
Button button = (Button)sender;
this.label13.Text = button.Text;
this.comboBox4.SelectedIndex = (int)Func.AgvInfo[(int)(Convert.ToInt16(button.Text) - 1)].Run_Status;
this.num_landmark.Value = Convert.ToDecimal(Func.AgvInfo[(int)(Convert.ToInt16(button.Text) - 1)].Location_Display);
this.num_speed.Value = Convert.ToDecimal(Func.AgvInfo[(int)(Convert.ToInt16(button.Text) - 1)].Run_Speed);
this.label9.Text = Func.AgvInfo[(int)(Convert.ToInt16(button.Text) - 1)].Voltage.ToString();
this.cmb_bank.SelectedIndex = (int)Func.AgvInfo[(int)(Convert.ToInt16(button.Text) - 1)].Bank_Model;
this.comboBox2.SelectedIndex = (int)Func.AgvInfo[(int)(Convert.ToInt16(button.Text) - 1)].Go_Direction;
this.comboBox5.SelectedIndex = (int)Func.AgvInfo[(int)(Convert.ToInt16(button.Text) - 1)].Run_Direction;
this.num_task.Value = Convert.ToDecimal(Func.AgvInfo[(int)(Convert.ToInt16(button.Text) - 1)].Task_ID);
this.label12.Text = ((button.Tag != null) ? button.Tag.ToString() : "");
this.label14.Text = Func.AgvInfo[(int)(Convert.ToInt16(button.Text) - 1)].Warn_info;
this.button2.BackColor = (Func.AgvInfo[(int)(Convert.ToInt16(this.label13.Text) - 1)].Enable ? Color.Blue : Color.Yellow);
this.button2.Text = (Func.AgvInfo[(int)(Convert.ToInt16(this.label13.Text) - 1)].Enable ? "在线" : "离线");
}
// Token: 0x06000069 RID: 105 RVA: 0x0000C92C File Offset: 0x0000AB2C
private void button2_Click(object sender, EventArgs e)
{
bool flag = Convert.ToInt16(this.label13.Text) < 1;
if (!flag)
{
Func.AgvInfo[(int)(Convert.ToInt16(this.label13.Text) - 1)].Enable = !Func.AgvInfo[(int)(Convert.ToInt16(this.label13.Text) - 1)].Enable;
string text = "UPDATE [dbo].[AgvInfo]\r\n SET Status = '{1}'\r\n WHERE id = '{0}'";
text = string.Format(text, Convert.ToInt16(this.label13.Text), Func.AgvInfo[(int)(Convert.ToInt16(this.label13.Text) - 1)].Enable ? 1 : 0);
string text2 = new ClsDBConn_sql().Command(text);
this.button2.BackColor = (Func.AgvInfo[(int)(Convert.ToInt16(this.label13.Text) - 1)].Enable ? Color.Blue : Color.Yellow);
this.button2.Text = (Func.AgvInfo[(int)(Convert.ToInt16(this.label13.Text) - 1)].Enable ? "在线" : "离线");
}
}
// Token: 0x040000B1 RID: 177
public Label[] lab_color = new Label[(int)Param.AGV_Qty];
}
}