示例#1
0
 /// <summary>
 /// 是否开启历史轨迹实时绘制
 /// </summary>
 public void SetHistoryLineDrawing(HistoryMode mode, bool isDrawing, bool isAddLine = false)
 {
     //Log.Info("SetHistoryLineDrawing", string.Format(""));
     foreach (LocationHistoryPath_M h in Items)
     {
         if (isAddLine)
         {
             h.historyPathDrawing.AddLine();
         }
         if (isDrawing)
         {
             if (mode == HistoryMode.Drawing)
             {
                 h.historyPathDrawing.Drawing();
                 //if (isAddLine)
                 //{
                 //    h.historyPathDrawing.AddLine();
                 //}
             }
         }
         else
         {
             h.historyPathDrawing.PauseDraw();
         }
     }
 }
示例#2
0
        private void ExecuteSQL(HistoryMode hMode)
        {
            DoInfoNotifications = true;
            if (cbClearListBeforeExcecute.Checked)
            {
                _cmdDone = 0;
                rtfMELDUNG.Clear();
                rtfERRORS.Clear();
            }
            var ri = RunSQL(hMode);

            _cmd = ri.lastSQL;
            if (ri.lastCommandType == SQLCommandType.select)
            {
                if (_dbReg.Version >= eDBVersion.FB3_32)
                {
                    RefreshPLAN();
                }
            }
            if (ri.commandDone)
            {
                MemoryusagePerStatement();
            }
            EditMode(cbEditMode.Checked);
            tabRESULT.Text  = $@"Results ({dgvResults.Rows.Count})";
            tabHistory.Text = $@"History ({clbHISTORY.Items.Count})";
        }
示例#3
0
 private void VerifyHistoryModeAtTheTimeWasSaveParameter(HistoryMode historyItemHistoryModeAtTheTime)
 {
     if (historyItemHistoryModeAtTheTime != HistoryMode.SaveParameterInstance)
     {
         throw new InvalidOperationException("Can't GoBack / GoForward without parameter because at the navigation time, " +
                                             "the history mode was 'DiscardParameterInstance'. You can use the other overload and specify parameter and viewbag, even if null");
     }
 }
示例#4
0
 private void AddToFailedHistory(HistoryMode toHistory, string[] cmds)
 {
     if (toHistory != HistoryMode.AddToHistory)
     {
         return;
     }
     foreach (string cmd in cmds)
     {
         AddToFailedHistory(toHistory, cmd);
     }
 }
示例#5
0
        private void ExecSqlThread(HistoryMode toHistory)
        {
            ThreadStart ts = new ThreadStart(ExecSql);
            Thread      th = new Thread(ts);

            th.Start();
            while (th.ThreadState == ThreadState.Stopped)
            {
                Thread.Sleep(100);
            }
        }
示例#6
0
        private void ExecSqlTh(HistoryMode toHistory, string[] cmds)
        {
            dataSet1.Clear();
            dgvResults.AutoGenerateColumns = true;
            string term          = GetTerm(cmds);
            string connectionstr = ConnectionStrings.Instance().MakeConnectionString(_dbReg);
            var    ri            = _sqLcommand.ExecuteCommandsAddToDataset(dataSet1, cmds, true);

            dataSet1 = ri.dataSet;
            AddToHistory(toHistory, cmds);
            bindingSource1.DataMember = "Table";
        }
示例#7
0
        private SQLCommandsReturnInfoClass RunSQL(HistoryMode hMode)
        {
            UserStart();
            _obcmd.Clear();
            _obcmd.AddRange(txtSQL.Lines);
            var ri = ExecSql(hMode);

            if (dgvResults.RowCount > 1)
            {
                tcSQLCONTROL.SelectedTab = tabRESULT;
            }
            UserBreak();
            return(ri);
        }
示例#8
0
 private void AddToFailedHistory(HistoryMode toHistory, string cmd)
 {
     if (toHistory != HistoryMode.AddToHistory)
     {
         return;
     }
     if (!clbFAILED_HISTORY.Items.Contains(cmd))
     {
         if (_lastSort == eSort.DESC)
         {
             clbFAILED_HISTORY.Items.Insert(0, cmd);
         }
         else
         {
             clbFAILED_HISTORY.Items.Add(cmd);
         }
     }
     lastCommand = cmd;
 }
示例#9
0
        public async Task <IList <HistoryItem> > GetHistory(HistoryMode historyMode, bool forceRefresh = false)
        {
            var watches = await _showService.GetWatchedShows(forceRefresh);

            switch (historyMode)
            {
            case HistoryMode.LastWeek:
                return(GetLastWeekHistory(watches));

            case HistoryMode.LastMonth:
                return(GetLastMonthHistory(watches));

            case HistoryMode.LastYear:
                return(GetLastYearHistory(watches));

            default:
                return(GetLastWeekHistory(watches));
            }
        }
示例#10
0
        private SQLCommandsReturnInfoClass ExecSql(HistoryMode toHistory)
        {
            dataSet1.Clear();
            dgvResults.AutoGenerateColumns = true;
            if (txtSQL.Text.Length <= 0)
            {
                return(new SQLCommandsReturnInfoClass());
            }

            _sqLcommand.SetEncoding(cbEncoding.Text);
            var ri = _sqLcommand.ExecuteCommandWithGlobalConnection(txtSQL.Lines);

            lblUsedMs.Text = ri.costs.ToString();
            dataSet1       = ri.dataSet;

            if (dataSet1?.Tables.Count > 0)
            {
                bindingSource1.DataSource = dataSet1;
                bindingSource1.DataMember = "Table";
            }
            else if (ri.lastCommandType == SQLCommandType.select)
            {
                NotifiesClass.Instance().AddToERROR("SQLViewForm->ExecSql->No datas selected");
                _localNotifies?.AddToERROR("SQLViewForm->ExecSql->No datas selected");
            }

            if (ri.commandDone)
            {
                AddToHistory(toHistory, ri.lastSQL);
            }
            else
            {
                AddToFailedHistory(toHistory, ri.lastSQL);
            }
            return(ri);
        }
 /// <summary>
 /// 切换轨迹模式
 /// </summary>
 public void SwithMode(HistoryMode modeT)
 {
     mode = modeT;
 }
示例#12
0
 public History(HistoryMode mode, Duration?interval = null, Duration?offset = null)
 {
     Mode     = mode;
     Interval = interval;
     Offset   = offset;
 }
示例#13
0
 void History()
 {
     _history = (cbHistory.Checked) ?  HistoryMode.AddToHistory : HistoryMode.NoHistory;
 }