예제 #1
0
    //リクエスト
    public void StartCom(RUNMODE runmode, Action cb = null) //スタート
    {
        m_runmode = runmode;

        //if (m_seq.IsEmpty())  //シーケンスに次のリクエストがない状態
        //{
        //    if (m_start_done) //既に実行済みにつき、すぐに終了
        //    {
        //        if (cb != null) cb();
        //        return;
        //    }
        //}
        var last_statename = m_seq.LastStateNameInQueue();

        if (last_statename != null && last_statename.StartsWith("start")) //多重要求禁止
        {
            if (cb != null)
            {
                cb();
            }
            return;
        }
        m_seq.Command("start0", S_START);
        if (cb != null)
        {
            var cb2 = cb; //キャプチャ
            m_seq.Command("start1",
                          f => {
                cb2();
                m_seq.Done();
            });
        }
    }
예제 #2
0
    public void StartNetComm(RUNMODE mode, Action cb = null)
    {
#if UNITY_EDITOR || UNITY_STANDALONE_WIN
        slagremote_unity_manager.Create(this);
        slagremote_unity_manager.V.StartCom(mode, cb);
#else
        if (cb != null)
        {
            cb();
        }
#endif
    }
예제 #3
0
        internal static bool IsValid(RUNMODE mode, cmd.COMMAND command)
        {
            if (list != null && list.ContainsKey(command))
            {
                var item = list[command];
                switch (mode)
                {
                case RUNMODE.NORMAL:   return(item.bNormal);

                case RUNMODE.RunLimit: return(item.bRunLimit);
                }
            }
            return(true);
        }
예제 #4
0
 public Form1()
 {
     CurrentMode = RUNMODE.NOTSET;
     InitializeComponent();
     ModeLabel.Text = "Set mode to begin.";
     PauseSource.Tick += new EventHandler(CheckDisplayBuffer);
     PauseSource.Interval = 1000;
     Application.ApplicationExit += Form1_Dtor;
     AppDomain.CurrentDomain.ProcessExit += Form1_Dtor;
 }
예제 #5
0
 private void uploadToolStripMenuItem_Click( object sender, EventArgs e)
 {
     CurrentMode = RUNMODE.UPLOAD;
     ModeLabel.Text = "Processing for Upload";
     PickFile dlg = new PickFile(ref FileToUse);
     dlg.ShowDialog();
     if (dlg.DialogResult == DialogResult.OK) {
         FileToUse = dlg.ReturnFile;
         Selection = (Runtype)dlg.Selection;
         dlg.Close();
         if (UploadToDo(FileToUse)) RTB.AppendText("Complete... now in wait mode.");
         else RTB.AppendText("Canceled... now in wait mode.");
     }
 }
예제 #6
0
 private void printReportToolStripMenuItem_Click( object sender, EventArgs e)
 {
     CurrentMode = RUNMODE.PRINT;
     ModeLabel.Text = "Processing for Print";
     PickFile dlg = new PickFile(ref FileToUse);
     dlg.ShowDialog();
     if (dlg.DialogResult == DialogResult.OK) {
         FileToUse = dlg.ReturnFile;
         ParseElanFile(FileToUse, FileData, Samples);
         dlg.Close();
         PrintReport(Samples);
         RTB.AppendText("Complete... now in wait mode.");
     }
     else RTB.AppendText("Canceled... now in wait mode.");
     //Samples.Clear();
     //FileData.Clear();
 }
예제 #7
0
 private void monitorRunToolStripMenuItem_Click( object sender, EventArgs e)
 {
     CurrentMode = RUNMODE.RERUN;
     ModeLabel.Text = "Processing for Monitoring";
     PickFile dlg = new PickFile(ref FileToUse);
     dlg.ShowDialog();
     if (dlg.DialogResult == DialogResult.OK) {
         PauseSource.Start();
         FileToUse = dlg.ReturnFile;
         string[] Splitme = FileToUse.Split("\\".ToCharArray());
         int Len = Splitme.Length;
         SourceLastTimes = new FileInfo( FileToUse);
         dlg.Close();
         this.Refresh();
         firstrun = true;
         Pathtouse = Directory.GetCurrentDirectory() + "\\" + Splitme[Len-1];
         SourceFileInfo = new FileInfo( FileToUse);
         if ( firstrun) {
             Monitor = new Thread(new ThreadStart( ProccessTick));
             Monitor.IsBackground = true;
             Monitor.Start();
             Stop_btn.Enabled = true;
             Stop_btn.Visible = true;
         }
         this.Refresh();
     }
 }
예제 #8
0
 public netcomm(RUNMODE mode = RUNMODE.NORMAL)
 {
     cmd.m_runMode = mode;
 }