Example #1
0
        private void Work()
        {
            try {
                while (true)
                {
                    _update();

                    var cmd = m_pipe.Read();
                    if (cmd != null)
                    {
                        cmd = slagtool.numbase.convert_cmd(cmd);
                        record(cmd);
                    }
                    else
                    {
                        Thread.Sleep(33);
                    }
                    if (m_bReqAbort)
                    {
                        break;
                    }
                }
            }
            catch (SystemException e) { Log(e.Message); }

            m_bEnd = true;
        }
Example #2
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            for (var loop = 0; loop < 5000; loop++)
            {
                var s = m_pipe.Read();
                if (s != null && !string.IsNullOrEmpty(s))
                {
                    bool bConverted = false;

                    if (s[0] == '@')
                    {
                        bConverted = true;
                        WriteVar(s);
                    }
                    else if (s.StartsWith("?TEXT?"))
                    {
                        bConverted = true;
                        WritePlayText(s);
                    }
                    else if (s.StartsWith("[FILELIST:"))
                    {
                        bConverted = true;
                        var ns   = s.Substring(10);
                        var toks = ns.Split(',');
                        var list = new List <string>();
                        foreach (var i in toks)
                        {
                            var fn = i.TrimEnd(']');
                            list.Add(fn);
                        }
                        __loadMultiScript(list);
                    }
                    else if (s.StartsWith("[BPLIST:"))
                    {
                        bConverted = true;
                        util_bp.ReadBpListLog(s);
                        util_bp.Refresh();
                    }

                    if (m_bDebug)
                    {
                        WriteLog(s);
                    }
                    else
                    {
                        if (!bConverted)
                        {
                            WriteLog(s);
                        }
                    }
                }
                else
                {
                    break;
                }
            }

            lock (m_log)
            {
                while (m_log.Count > 0)
                {
                    var s = m_log.Dequeue();
                    textBox1_log.AppendText(s + Environment.NewLine);
                }
            }

            //フォーカス
            try {
                if (m_focus != null)
                {
                    util.FocusSrc(this, (int)m_focus);
                    m_focus = null;
                }
            } catch (SystemException ec)
            {
                System.Diagnostics.Debug.WriteLine(ec.Message);
            }
        }