当前位置: 首页>>代码示例>>C#>>正文


C# Models.TscData类代码示例

本文整理汇总了C#中tscui.Models.TscData的典型用法代码示例。如果您正苦于以下问题:C# TscData类的具体用法?C# TscData怎么用?C# TscData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


TscData类属于tscui.Models命名空间,在下文中一共展示了TscData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: UserControl_Loaded

        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                t = Utils.Utils.GetTscDataByApplicationCurrentProperties();
                if (t == null)
                {
                    return;
                }
                //t.ListPlan;
                List<Schedule> ls = t.ListSchedule;
                List<int> li = new List<int>();
                foreach (Schedule s in ls)
                {
                    if (!li.Contains(s.ucId) && s.ucId != 0)
                        li.Add(s.ucId);
                }

                cbxScheduleId.ItemsSource = li;
                List<Plan> lp = t.ListPlan;
                foreach (Plan p in lp)
                {
                    if (p.ucId >= 1 && p.ucId <= 20)
                    {
                        sldPlanId.Value = p.ucId;
                        cbxScheduleId.SelectedItem = Convert.ToInt32(p.ucScheduleId);
                        ushort month = p.usMonthFlag;
                        uint day = p.ulDayFlag;
                        DateTime datetime = DateTime.Now;
                        //for (int i = 1; i <= 12; i++)
                        //{
                        //    if (((month >> i) & 0x01) == 0x01)
                        //    {
                        //        for (int j = 1; j <= 31; j++)
                        //        {
                        //            if (((day >> j) & 0x01) == 0x01)
                        //            {
                        //                try
                        //                {
                        //                    calendar.SelectedDates.Add(new DateTime(datetime.Year, i, j));
                        //                }
                        //                catch (Exception ex)
                        //                {
                        //                    continue;
                        //                }

                        //            }
                        //        }
                        //    }
                        //}
                        //break;
                    }
                }
            }
            catch(Exception ex )
            {

            }
            
        }
开发者ID:renhualu,项目名称:tsccui32,代码行数:60,代码来源:CalendarView.xaml.cs

示例2: InitSchedule

        private void InitSchedule()
        {
            t = Utils.Utils.GetTscDataByApplicationCurrentProperties();
            if (t == null)
            {
                return;
            }
            List<Schedule> ls = t.ListSchedule;
            //scheduleDataGrid.ItemsSource = ls;
            initSldScheduleId(ls);      //
            // t = Utils.Utils.GetTscDataByApplicationCurrentProperties();
            List<ScheduleCtrl> lsc = new List<ScheduleCtrl>();
            lsc.Add(new ScheduleCtrl() { name = "自主控制", value = (byte)0 });
            lsc.Add(new ScheduleCtrl() { name = "关灯", value = (byte)1 });
            lsc.Add(new ScheduleCtrl() { name = "闪光", value = 2 });
            lsc.Add(new ScheduleCtrl() { name = "全红", value = 3 });
            lsc.Add(new ScheduleCtrl() { name = "感应", value = 6 });
            lsc.Add(new ScheduleCtrl() { name = "单点优化", value = 8 });
            lsc.Add(new ScheduleCtrl() { name = "主从线控", value = 11 });
            lsc.Add(new ScheduleCtrl() { name = "系统优化", value = 12 });
            lsc.Add(new ScheduleCtrl() { name = "干预控制", value = 13 });
            cbxucCtrl.ItemsSource = lsc;

            List<Pattern> lp = t.ListPattern;
            ucTimePatternId.ItemsSource = lp;

            List<ScheduleAuxOut> lsao = new List<ScheduleAuxOut>();
            lsao.Add(new ScheduleAuxOut() { name = "辉度控制", value = 8 });
            lsao.Add(new ScheduleAuxOut() { name = "无功能", value = 0 });

            List<ScheduleSpecialOut> lsso = new List<ScheduleSpecialOut>();
            lsso.Add(new ScheduleSpecialOut() { name = "无特殊功能", value = 0 });
            
        }
开发者ID:renhualu,项目名称:tsccui32,代码行数:34,代码来源:ScheduleView.xaml.cs

示例3: InitTscData

 public void InitTscData(TscInfo ti)
 {
     TscData td = new TscData();
     Node node = new Node(ti.Ip, ti.Name, ti.Version, ti.Port);
     td.Node = node;
     Application.Current.Properties[Define.TSC_DATA] = td;
     try
     {
         td.ListSchedule = TscDataUtils.GetSchedule();
         td.ListPlan = TscDataUtils.GetPlan();
         td.ListModule = TscDataUtils.GetModule();
         td.ListPhase = TscDataUtils.GetPhase();
         try
         {
             td.ListCollision = TscDataUtils.GetCollision();
             td.Node.sProtocol = "GBT_V32";
         }
         catch(Exception ex)
         {
             td.ListCollision = TscDataUtils.GetCollision16();
             td.Node.sProtocol = "GBT_V16";
         }
         
         td.ListDetector = TscDataUtils.GetDetector();
         td.ListChannel = TscDataUtils.GetChannel();
         td.ListEventLog = TscDataUtils.GetEventLog();
         td.ListPattern = TscDataUtils.GetPattern();
         try
         {
             td.ListStagePattern = TscDataUtils.GetStagePattern();
         }
         catch(Exception ex)
         {
             td.ListStagePattern = TscDataUtils.GetStagePattern16();
         }
         
         td.ListOverlapPhase = TscDataUtils.GetOverlapPhase();
         
         td.ListPhaseToDirec = TscDataUtils.GetPhaseToDirec();
         td.ListLampCheck = TscDataUtils.GetLampCheck();
         currentTI = null;
         
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.ToString());
         MessageBox.Show("信号机为16相位,协议无法匹配!");
     }
     
 }
开发者ID:renhualu,项目名称:tsccui32,代码行数:50,代码来源:ApexView.xaml.cs

示例4: Button_Click_1

        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("上传失败");
            }
        }
开发者ID:renhualu,项目名称:tsccui32,代码行数:20,代码来源:UpdateView.xaml.cs

示例5: SetCorrectPhaseToOverlapPhase

 private void SetCorrectPhaseToOverlapPhase(CheckComboBox ccb,int opUcId)
 {
     t = Utils.Utils.GetTscDataByApplicationCurrentProperties();
     foreach (OverlapPhase op in t.ListOverlapPhase)
     {
         if (op.ucId == opUcId)
         {
             List<byte> lb = new List<byte>();
             foreach (Object o in ccb.SelectedItems)
             {
                 Phase po = (Phase)o;
                 lb.Add(po.ucId);//po.ucId
             }
             op.ucCorrectPhase = lb.ToArray<byte>();
         }
     }
 }
开发者ID:renhualu,项目名称:tsccui32,代码行数:17,代码来源:ExamplePopup.xaml.cs

示例6: tbxMinGreenTime_TextChanged

 private void tbxMinGreenTime_TextChanged(object sender, TextChangedEventArgs e)
 {
     TextBox tb = sender as TextBox;
     t = Utils.Utils.GetTscDataByApplicationCurrentProperties();
     List<Phase> lp = t.ListPhase;
     foreach (Phase p in lp)
     {
         if (p.ucId == currentPhaseId)
         {
             p.ucPedestrianClear = Convert.ToByte(tb.Text);
         }
     }
 }
开发者ID:renhualu,项目名称:tsccui32,代码行数:13,代码来源:ExamplePopup.xaml.cs

示例7: cbxPhaseOption_SelectionChanged

 private void cbxPhaseOption_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     t = Utils.Utils.GetTscDataByApplicationCurrentProperties();
     List<Phase> lp = t.ListPhase;
     ComboBox cb = sender as ComboBox;
     PhaseOption po = (PhaseOption)cb.SelectedValue;
     foreach (Phase p in lp)
     {
         if (p.ucId == currentPhaseId)
         {
             p.ucType = Convert.ToByte(po.ucOption);
         }
     }
 }
开发者ID:renhualu,项目名称:tsccui32,代码行数:14,代码来源:ExamplePopup.xaml.cs

示例8: SetDetector

 /// <summary>
 /// 设置检测器,在哪个位置都有不同的定义 
 /// 1、路口最外面的是 战略
 /// 2、路口外到内 第二个是感应
 /// 3、路口外到内 第三个是战术
 /// 4、路口 外到内第四个是请求
 /// </summary>
 /// <param name="i"></param>
 /// <param name="direc"></param>
 /// <param name="type"></param>
 public void SetDetector(int i ,byte direc,int type)
 {
     tscui.Models.Detector d = new Models.Detector();
     t = Utils.Utils.GetTscDataByApplicationCurrentProperties();
     bool newDetector = true;
     List<Models.Detector> ld = t.ListDetector;
     foreach (Models.Detector det in ld)
     {
         if (det.ucDetectorId == i)
         {
             det.ucDetectorId = Convert.ToByte(i);
             //det.ucDetFlag = GetDetFlag(type,direc);
             det.ucDirect = GetDirecByte(direc);
             //det.ucOptionFlag = GetOptionByCheckbox();
             det.ucPhaseId = GetPhaseIdByDirec(direc);
             // det.ucSaturationOccupy = d.ucSaturationOccupy;
             //det.ucValidTime = Convert.ToByte(tbkVaildTime.Text);
             //det.usSaturationFlow = d.usSaturationFlow;
             newDetector = false;
             break;
         }
     }
     if (newDetector == true)
     {
         d.ucDetectorId = Convert.ToByte(i);
         d.ucPhaseId = GetPhaseIdByDirec(direc);
         d.ucDetFlag = GetDetFlag(type,direc);
         d.ucDirect = GetDirecByte(direc);
         d.ucValidTime = Convert.ToByte(tbkVaildTime.Text);
         d.ucOptionFlag = GetOptionByCheckbox();
         d.usSaturationFlow = 0;
         d.ucSaturationOccupy = 0;
         newDetector = true;
        
         ld.Add(d);
     }
 }
开发者ID:renhualu,项目名称:tsccui32,代码行数:47,代码来源:DetectorView.xaml.cs

示例9: p4_Checked

 private void p4_Checked(object sender, RoutedEventArgs e)
 {
     t = Utils.Utils.GetTscDataByApplicationCurrentProperties();
     List<Phase> lp = t.ListPhase;
     displayPhase(4, lp);
     currentPhaseId = 4;
     Utils.Utils.SetPhaseOverlapPhaseType(Define.SELECTED_PHASE_OVERLAP_TYPE_PHASE);
 }
开发者ID:renhualu,项目名称:tsccui32,代码行数:8,代码来源:ExamplePopup.xaml.cs

示例10: UserControl_Loaded

 private void UserControl_Loaded(object sender, RoutedEventArgs e)
 {
     t = Utils.Utils.GetTscDataByApplicationCurrentProperties();
     if(t == null)
     {
         return;
     }
     ThreadPool.QueueUserWorkItem(DispatcherInitAllDetector);
     //Thread tDispatcherInitAllDetector = new Thread(DispatcherInitAllDetector);
     //tDispatcherInitAllDetector.IsBackground = true;
     //tDispatcherInitAllDetector.Start();
    // Console.WriteLine(111);
 }
开发者ID:renhualu,项目名称:tsccui32,代码行数:13,代码来源:DetectorView.xaml.cs

示例11: UserControl_Loaded

 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;
     }
     
 }
开发者ID:renhualu,项目名称:tsccui32,代码行数:13,代码来源:LightCheckView.xaml.cs

示例12: clearStageByDeleteStage

 private void clearStageByDeleteStage(TscData t,StageItem si)
 {
     List<StagePattern> lsp = t.ListStagePattern;
     foreach(StagePattern sp in lsp)
     {
         if(sldStagePatternId.Value == sp.ucStagePatternId)
         {
             if (sp.ucStageNo == Convert.ToByte(si.lblNumber.Content))
             {
                 sp.ucStageNo = 0;
                 sp.ucGreenTime = 0;
                 sp.ucOption = 0;
                 sp.ucRedTime = 0;
                 sp.ucYellowTime = 0;
                 sp.usAllowPhase = 0;
             }
         }
         
     }
 }
开发者ID:renhualu,项目名称:tsccui32,代码行数:20,代码来源:StageView.xaml.cs

示例13: UserControl_Loaded

 private void UserControl_Loaded(object sender, RoutedEventArgs e)
 {
     
     initCollisionItemList();     /// 这个必需放在最前面,以便将初始化collision的数组。后面的几个方法都用到了此数组
     hiddenCollision();
     //将当前collision 设置为第一个collisionItem
     currentCollision = collision1;
     t = Utils.Utils.GetTscDataByApplicationCurrentProperties();
     if(t == null)
     {
         return;
     }
     Thread tCollisionId = new Thread(DispatcherInitCollisionId);
     tCollisionId.IsBackground = true;
     tCollisionId.Start();
     //initCollisionId();
     Thread tDispatcherInitDirecBigAndSmall = new Thread(DispatcherInitDirecBigAndSmall);
     tDispatcherInitDirecBigAndSmall.IsBackground = true;
     tDispatcherInitDirecBigAndSmall.Start();
     //initDirecBigAndSmall();
     Thread tDispatcherInitDirecPhaseLight = new Thread(DispatcherInitDirecPhaseLight);
     tDispatcherInitDirecPhaseLight.IsBackground = true;
     tDispatcherInitDirecPhaseLight.Start();
     //initDirecPhaseLight();
     Thread tDispatcherInitDirecCollisionPhaseRedLight = new Thread(DispatcherInitDirecCollisionPhaseRedLight);
     tDispatcherInitDirecCollisionPhaseRedLight.IsBackground = true;
     tDispatcherInitDirecCollisionPhaseRedLight.Start();
     //initDirecCollisionPhaseRedLight();
     
     
 }
开发者ID:renhualu,项目名称:tsccui32,代码行数:31,代码来源:CollisionView.xaml.cs

示例14: UserControl_Loaded

 private void UserControl_Loaded(object sender, System.Windows.RoutedEventArgs e)
 {
     t = Utils.Utils.GetTscDataByApplicationCurrentProperties();
     if(t == null)
     {
         return;
     }
     ThreadPool.QueueUserWorkItem(DispatcherInitSchedule);
 }
开发者ID:renhualu,项目名称:tsccui32,代码行数:9,代码来源:ScheduleView.xaml.cs

示例15: sldScheduleId_ValueChanged

 private void sldScheduleId_ValueChanged(object sender, System.Windows.RoutedPropertyChangedEventArgs<double> e)
 {
     t = Utils.Utils.GetTscDataByApplicationCurrentProperties();
     scheduleDataGrid.ItemsSource = initSchedule2DataGrid(t.ListSchedule);
 }
开发者ID:renhualu,项目名称:tsccui32,代码行数:5,代码来源:ScheduleView.xaml.cs


注:本文中的tscui.Models.TscData类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。