123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Shapes;
- using AGV_WPF.TrafficDefine;
- namespace AGV_WPF
- {
- /// <summary>
- /// TrafficWindow.xaml 的交互逻辑
- /// </summary>
- public partial class TrafficWindow : Window
- {
- public TrafficWindow()
- {
- InitializeComponent();
-
- }
- private void btnTrafficData_Click(object sender, RoutedEventArgs e)
- {
- List<TrafficArea> list = TrafficManager.Traffic.TrafficAreaList;
- string str = "";
- for (int i = 0; i < list.Count; i++)
- {
- str = string.Format("管制区:{0},是否关键点:{1}\r\n", list[i].TrafficNum, list[i].IsNeedKeyMark);
- for (int j = 0; j < list[i].StationList.Count;j++ )
- {
- str += string.Format("当前点:{0},{1},下一点:{2},{3}\r\n", list[i].StationList[j].CurrentMark.WorkLine, list[i].StationList[j].CurrentMark.MarkNum, list[i].StationList[j].NextMark.WorkLine, list[i].StationList[j].NextMark.MarkNum);
- }
- txtData.AppendText(str);
- }
-
- }
- private void btnAgvData_Click(object sender, RoutedEventArgs e)
- {
- //AgvStatus[] list = AGV_WPF.MainWindow.mainWindow.AgvStatusList;
- //string str = "";
- //for (int i = 0; i < list.Length;i++ )
- //{
- // str += string.Format("AGV{0},管制区:", list[i].AgvNum);
- // for (int j = 0; j < list[i].TrafficNumList.Count;j++ )
- // {
- // str += string.Format("{0},", list[i].TrafficNumList[j]);
- // }
- // str += "\r\n";
- //}
- //txtData.AppendText(str);
- }
- private void btnClear_Click(object sender, RoutedEventArgs e)
- {
- txtData.Text = "";
- }
- private void btnTrafficStatus_Click(object sender, RoutedEventArgs e)
- {
- List<TrafficArea> list = TrafficManager.Traffic.TrafficAreaList;
- string str = "";
- for (int i = 0; i < list.Count; i++)
- {
- str += string.Format("管制区:{0},状态:{1},占领AGV:{2},等待AGV:", list[i].TrafficNum, list[i].Status, list[i].OccupyAgv);
- for (int j = 0; j < list[i].WaitAgvList.Count; j++)
- {
- str += string.Format("{0},", list[i].WaitAgvList[j]);
- }
- str += "\r\n";
- }
- txtData.AppendText(str);
- }
-
- }
- }
|