/// <inheritdoc />
        public override CProcessorParseResult Parse(string str, CProcessorState state)
        {
            str = str.Trim().Substring("#define ".Length).Trim();
            var spaceIndex = str.IndexOf(" ", StringComparison.CurrentCulture);

            string name;
            string value;

            if (spaceIndex >= 0)
            {
                name  = str.Substring(0, spaceIndex).Trim();
                str   = str.Substring(spaceIndex).Trim();
                value = str.Trim();
                str   = string.Empty;
            }
            else
            {
                name  = str.Trim();
                value = true.ToString();
                str   = string.Empty;
            }

            var define = new CDefine(name, value, state.CurrentTree);

            state.CurrentTree.AddSubTree(define);

            return(new CProcessorParseResult(state.CurrentTree, true, str));
        }
        private void onDelayKeyDownClick(object sender)
        {
            var txtBox = sender as TextBox;

            double dfout   = 0;
            string strTemp = txtBox.Text.Trim();

            if (Double.TryParse(strTemp, out dfout))
            {
                double inputValue = CDefine.checkAvalibleInput(dfout, MinInput, MaxInput);
                int    position   = CDelayControl.decodeDelayvalue(inputValue);
                txtBox.Text = inputValue.ToString();
                int chindex = _parentWin.currentchindex;

                CMatrixData.matrixData.m_ChanelEdit[chindex].delayTime = position;

                if (NetCilent.netCilent.isConnected())
                {
                    CMatrixData.matrixData.sendCMD_ChanelDelay(chindex);
                }
                else
                {
                    updateDelay_fromData(chindex);
                }
            }

            txtBox.IsReadOnly = true;
        }
Beispiel #3
0
    public static void End(string key)
    {
        if (!m_nodes.ContainsKey(key))
        {
            return;
        }

        DateTime endTime  = m_nodes[key].End();
        TimeSpan eclipsed = m_nodes[key].Eclipsed;

#if !SERVER && !TOOL
        bool view = false;
        if (view)
        {
            string message = "";
            if (m_nodes[key].CheckRest)
            {
                double rest = m_nodes[key].RestAverage();
                message = string.Format("[Profiler End] [{1}] T [Total {2} m/s] [{3} m/s] {0}", key, endTime, eclipsed.TotalMilliseconds.ToString("00000.00"), rest.ToString("00000.00"));

                if (rest > 10.0f)
                {
                    Debugger.LogWarning(message);
                }
                else
                {
                    Debugger.Log(message);
                }
            }
            else
            {
                message = string.Format("[Profiler End] [{1}] F [Total {2} m/s] {0}", key, endTime, eclipsed.TotalMilliseconds.ToString("00000.00"));

                if (eclipsed.TotalMilliseconds > 10.0f)
                {
                    Debugger.LogWarning(message);
                }
                else
                {
                    Debugger.Log(message);
                }
            }
        }
#else
        bool view = false;
        if (view)
        {
            CDefine.DebugLog(string.Format("[Profiler] End:{0} at {1}  => TotalTime : {2} m/s", key, endTime, eclipsed.TotalMilliseconds.ToString("#.00")));
        }
#endif
        m_nodes.Remove(key);
    }