private void btnRead_Click(object sender, System.Windows.RoutedEventArgs e) { List<Plan> lp = t.ListPlan; foreach(Plan p in lp) { Console.WriteLine(p.usMonthFlag); } }
private void splLog_Loaded(object sender, System.Windows.RoutedEventArgs e) { //<SnippetListViewView> myListView = new ListView(); //<SnippetGridViewColumn> //<SnippetGridViewAllowsColumnReorder> myGridView = new GridView(); myGridView.AllowsColumnReorder = true; myGridView.ColumnHeaderToolTip = "日志信息"; //</SnippetGridViewAllowsColumnReorder> //<SnippetGridViewColumnProperties> GridViewColumn gvc1 = new GridViewColumn(); gvc1.DisplayMemberBinding = new Binding("ucEventId"); gvc1.Header = "日志编号"; gvc1.Width = 30; //</SnippetGridViewColumnProperties> myGridView.Columns.Add(gvc1); GridViewColumn gvc2 = new GridViewColumn(); gvc2.DisplayMemberBinding = new Binding("sEventType"); gvc2.Header = "日志类型"; gvc2.Width = 100; myGridView.Columns.Add(gvc2); //<SnippetAddToColumns> GridViewColumn gvc3 = new GridViewColumn(); gvc3.DisplayMemberBinding = new Binding("ulEventTime"); gvc3.Header = "日期时间"; gvc3.Width = 120; myGridView.Columns.Add(gvc3); GridViewColumn gvc4 = new GridViewColumn(); gvc4.DisplayMemberBinding = new Binding("sEventDesc"); gvc4.Header = "日志内容"; gvc4.Width = 700; myGridView.Columns.Add(gvc4); //</SnippetAddToColumns> //</SnippetGridViewColumn> //ItemsSource is ObservableCollection of EmployeeInfo objects //myListView.ItemsSource = new myTscs(); //Thread thread = new Thread(); myListView.View = myGridView; myListView.Height = 550; // myListView. splLog.Children.Add(myListView); TscData td = (TscData)Application.Current.Properties[Define.TSC_DATA]; if (td == null) { MessageBox.Show("请选择一台信号机后,打开此界面!"); } else { myListView.ItemsSource = td.ListEventLog; } }
private void Allday_Unchecked(object sender, System.Windows.RoutedEventArgs e) { Monday.IsChecked = false; Thursday.IsChecked = false; Tuesday.IsChecked = false; Wednesday.IsChecked = false; Friday.IsChecked = false; Saturday.IsChecked = false; Sunday.IsChecked = false; }
private void UserControl_Loaded(object sender, System.Windows.RoutedEventArgs e) { TscData t = Utils.Utils.GetTscDataByApplicationCurrentProperties(); if (t == null) { MessageBox.Show("请选择一台信号机,以便进行配置!"); return; } ObservableCollection<CntDownDev> occdd = new ObservableCollection<CntDownDev>(t.ListCntDownDev); dgdVariableSign.ItemsSource = occdd; }
private void Button_Click(object sender, System.Windows.RoutedEventArgs e) { OpenFileDialog dialog = new OpenFileDialog(); dialog.Filter = "Tsc Program(*.aiton)|*.aiton"; dialog.Multiselect = false; //TextBox tb = sender as TextBox; if (dialog.ShowDialog() == true) { tbxFileName.Text = dialog.FileName; } }
private void Button_Click_1(object sender, System.Windows.RoutedEventArgs e) { t = Utils.Utils.GetTscDataByApplicationCurrentProperties(); Udp.sendUdpNoReciveData(t.Node.sIpAddress, t.Node.iPort, Define.UPDATE_TSC_START); Thread.Sleep(500); int result = FtpHelper.UploadFtp(tbxFileName.Text, t.Node.sIpAddress, Define.FTP_NAME, Define.FTP_PASSWD); Thread.Sleep(500); if(result == 0) { Udp.sendUdpNoReciveData(t.Node.sIpAddress, t.Node.iPort, Define.UPDATE_TSC_FINISH); MessageBox.Show("升级成功!"); } else if (result == -2) { //升级失败后,不要发送完成指令 //Udp.sendUdpNoReciveData(t.Node.sIpAddress, t.Node.iPort, Define.UPDATE_TSC_FINISH); MessageBox.Show("上传失败"); } }
/// <summary> /// 双击,创建新的stage /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ScrollViewer_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e) { //MessageBox.Show("addd stage"); if (lsi[0] != stage1) { lsi.Reverse(); } foreach(StageItem si in lsi) { if (si.Visibility == Visibility.Hidden) { si.Visibility = Visibility.Visible; createStageByInitArllowRed(si); break; } } }
private void ScrollViewer_MouseRightButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { // MessageBox.Show("del stage"); TscData t = Utils.Utils.GetTscDataByApplicationCurrentProperties(); if (lsi[0] == stage1) { lsi.Reverse(); } foreach(StageItem si in lsi) { if (si.Visibility == Visibility.Visible) { si.Visibility = Visibility.Hidden; clearStageByDeleteStage(t,si); bigMapInitArllowRed(); break; } } }
private void sldScheduleId_ValueChanged(object sender, System.Windows.RoutedPropertyChangedEventArgs<double> e) { t = Utils.Utils.GetTscDataByApplicationCurrentProperties(); scheduleDataGrid.ItemsSource = initSchedule2DataGrid(t.ListSchedule); }
private void Allday_IsEnabledChanged(object sender, System.Windows.DependencyPropertyChangedEventArgs e) { }
private void UserControl_Loaded(object sender, System.Windows.RoutedEventArgs e) { try { td = (TscData)Application.Current.Properties[Define.TSC_DATA]; initScheduleId(); if (td == null) { return; } List<Plan> lp = td.ListPlan; foreach(Plan p in lp) { //如果没有数据不会进入 if (p.ucId>=21 && p.ucId <=30) { ///Summer.IsChecked = true; lbxPlanId.Items.Add(p.ucId); //initWeekdayDisplay(p.ucWeekFlag); } } cbxScheduleId.SelectedItem = (byte)1; } catch(Exception ex) { //MessageBox.Show(ex.ToString()); //ApexBroker.GetShell().ShowPopup(new FailePopup()); } }
private void collision6_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { currentCollision = collision6; BigMap4SmallMap(currentCollision); }
private void southOther_MouseRightButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { if (currentCollision == null) { MessageBox.Show("请选择一个冲突相位,以便进行设置!"); return; } List<PhaseToDirec> lptd = t.ListPhaseToDirec; List<tscui.Models.Collision> lc = t.ListCollision; foreach (PhaseToDirec ptd in lptd) { if (ptd.ucId == Define.SOUTH_OTHER) { //ptd.ucPhase; byte collisionId = Convert.ToByte(currentCollision.lblId.Content); foreach (tscui.Models.Collision c in lc) { if (collisionId == c.ucPhaseId) { collisionFlagResetPhaseBit(c, ptd); Console.WriteLine(c.ucCollisionFlag); } } } } currentCollision.southOther.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/nolight.png", UriKind.Relative)); southOther.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/nolight.png", UriKind.Relative)); }
private void westStraight_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { }
private void stage16_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { currentStage = stage16; smallMap4Form(currentStage); BigMap4SmallMap(currentStage); //MessageBox.Show("stage1"); }
private void northOther_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { }
private void UserControl_Loaded(object sender, System.Windows.RoutedEventArgs e) { t = Utils.Utils.GetTscDataByApplicationCurrentProperties(); if(t == null) { return; } ThreadPool.QueueUserWorkItem(DispatcherInitSchedule); }
private void UserControl_Unloaded(object sender, System.Windows.RoutedEventArgs e) { try { ThreadPool.QueueUserWorkItem(SaveSchedule); } catch (Exception ex) { MessageBox.Show("Schedule: " + ex.ToString()); } }
private void Button_Click(object sender, System.Windows.RoutedEventArgs e) { TscDataUtils.SetSchedule(t.ListSchedule); }
private void stage1_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { currentStage = stage1; BigMap4SmallMap(currentStage); smallMap4Form(currentStage); }
private void southPedestrain2_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { if (currentStage != null) { currentStage.southPedestrain2.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight1.png", UriKind.Relative)); southPedestrain2.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/greenlight1.png", UriKind.Relative)); TscData t = Utils.Utils.GetTscDataByApplicationCurrentProperties(); List<PhaseToDirec> lptd = t.ListPhaseToDirec; List<Pattern> lp = t.ListPattern; List<StagePattern> lsp = t.ListStagePattern; foreach (PhaseToDirec ptd in lptd) { if (ptd.ucId == Define.SOUTH_PEDESTRAIN_TWO) { if (ptd.ucPhase != null || ptd.ucPhase != 0) { setPatternAndStagePattern(lp, lsp, currentStage, ptd); } // phaseId = ptd.ucPhase; } } } else { MessageBox.Show("请选择一个阶段,便可以进行配置!"); } }
private void northPedestrain1_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { }
private void westRight_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { if (currentCollision != null) { List<PhaseToDirec> lptd = t.ListPhaseToDirec; List<tscui.Models.Collision> lc = t.ListCollision; foreach (PhaseToDirec ptd in lptd) { if (ptd.ucId == Define.WEST_RIGHT) { //ptd.ucPhase; byte collisionId = Convert.ToByte(currentCollision.lblId.Content); foreach (tscui.Models.Collision c in lc) { if (collisionId == c.ucPhaseId) { collisionFlagSetPhaseBit(c, ptd); //(c.ucCollisionFlag >> ptd.ucPhase) & 0x01; Console.WriteLine(c.ucCollisionFlag); } } } } currentCollision.westRight.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/redlight1.png", UriKind.Relative)); westRight.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/redlight1.png", UriKind.Relative)); } else { MessageBox.Show("请选择一个阶段,便可以进行配置!"); } }
private void eastLeft_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { }
private void UserControl_Loaded(object sender, System.Windows.RoutedEventArgs e) { td = (TscData)Application.Current.Properties[Define.TSC_DATA]; if (td == null) { return; } else { ipAddress.Text = td.Node.sIpAddress; } }
private void StackPanel_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { ///MessageBox.Show("addd stage"); }
private void lbxPlanId_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { List<Plan> lp = td.ListPlan; Plan p1 = new Plan(); foreach(Plan p in lp) { for (int i = 21; i <= 30;i++ ) { if (!(p.ucId == i) && !lbxPlanId.Items.Contains(Convert.ToByte(i))) { p1.ucId = Convert.ToByte(i); p1.ucScheduleId = 1; p1.usMonthFlag = 0; p1.ucWeekFlag = 0; p1.ulDayFlag = 0; break; } } break; } if (p1.ucId <= 30 && p1.ucId >=21) { lbxPlanId.Items.Add(p1.ucId); lp.Add(p1); } }
private void ScrollViewer_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { // MessageBox.Show("addd stage"); }
private void southLeft_MouseRightButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { if (currentStage == null) { MessageBox.Show("请选择一个阶段,以便取消相位放行!"); return; } currentStage.southLeft.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/redlight.png", UriKind.Relative)); southLeft.Source = new BitmapImage(new Uri("/tscui;component/Resources/Images/redlight.png", UriKind.Relative)); TscData t = Utils.Utils.GetTscDataByApplicationCurrentProperties(); List<StagePattern> lsp = t.ListStagePattern; List<PhaseToDirec> lptd = t.ListPhaseToDirec; foreach (StagePattern sp in lsp) { if (sp.ucStagePatternId == sldStagePatternId.Value) { if (Convert.ToByte(currentStage.lblNumber.Content) == sp.ucStageNo) { uint ap = sp.usAllowPhase; foreach(PhaseToDirec ptd in lptd ) { if (ptd.ucId == Define.SOUTH_LEFT) { sp.usAllowPhase = returnUnAllowPhase(ptd,ap); } } } } } }
private void tbkScheduleId_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { TscData t = Utils.Utils.GetTscDataByApplicationCurrentProperties(); List<Schedule> ls = t.ListSchedule; }