當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。