1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using AGV_WPF.Models;
- using AGV_WPF_Global;
- using AGV_WPF.Tools;
- namespace AGV_WPF
- {
- public partial class AGVSingleControl : Form
- {
- public AGVSingleControl()
- {
- InitializeComponent();
- }
- private void AGVSingleControl_Load(object sender, EventArgs e)
- {
- int AGVNUM_MAX = Convert.ToByte(System.Configuration.ConfigurationManager.AppSettings["AGVNUM_MAX"]);
- for (int i = 1; i <= AGVNUM_MAX; i++)
- {
- comboBox2.Items.Add(i);
- }
- comboBox2.SelectedIndex=0;
- // comboBox1.Items.Add("休眠"); comboBox1.Items.Add("唤醒");
- comboBox1.Items.Add("启动"); comboBox1.Items.Add("停止");
- comboBox1.SelectedIndex = 0;
- }
- private void button1_Click(object sender, EventArgs e)
- {
- string btnHeader = comboBox1.Text;
- int ActionCode = 0;
- if (btnHeader.ToString().Contains("休眠"))
- {
- ActionCode = 0x20;
- GlobalPara.isSingleControl = true;
- GlobalPara.SingleSWAGVNum = int.Parse(comboBox2.Text);
- }
- else if (btnHeader.ToString().Contains("唤醒"))
- {
- ActionCode = 0x30;
- GlobalPara.isSingleControl = true;
- GlobalPara.SingleSWAGVNum = int.Parse(comboBox2.Text);
- }
- else if (btnHeader.ToString().Contains("启动"))
- {
- ActionCode = 0x40;
- }
- else if (btnHeader.ToString().Contains("停止"))
- {
- ActionCode = 0x50;
- }
- DispatcherTool.ControlAllAgv(ActionCode, 0, int.Parse(comboBox2.Text), true);
- }
- }
- }
|