diff --git a/ISCamRecorder/MainForm.Designer.cs b/ISCamRecorder/MainForm.Designer.cs index e8af59f..f6ff095 100644 --- a/ISCamRecorder/MainForm.Designer.cs +++ b/ISCamRecorder/MainForm.Designer.cs @@ -23,6 +23,7 @@ /// コード エディターで変更しないでください。 /// private void InitializeComponent() { + System.Windows.Forms.DataVisualization.Charting.TextAnnotation textAnnotation1 = new System.Windows.Forms.DataVisualization.Charting.TextAnnotation(); System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series(); System.Windows.Forms.DataVisualization.Charting.Series series2 = new System.Windows.Forms.DataVisualization.Charting.Series(); @@ -226,6 +227,13 @@ this.chart1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); + textAnnotation1.AnchorX = 50D; + textAnnotation1.AnchorY = 80D; + textAnnotation1.Font = new System.Drawing.Font("Microsoft Sans Serif", 20.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + textAnnotation1.Name = "AnnReverseBlood"; + textAnnotation1.ShadowOffset = 4; + textAnnotation1.Text = "逆血未検出"; + this.chart1.Annotations.Add(textAnnotation1); chartArea1.AxisX.IsLabelAutoFit = false; chartArea1.AxisX.LabelStyle.Angle = 90; chartArea1.AxisX.LabelStyle.Format = "0.0"; diff --git a/ISCamRecorder/SensorData.cs b/ISCamRecorder/SensorData.cs index aae9cfa..2cd7c57 100644 --- a/ISCamRecorder/SensorData.cs +++ b/ISCamRecorder/SensorData.cs @@ -8,6 +8,8 @@ using System.Diagnostics; using System.IO; using System.Windows.Forms; +using System.Windows.Forms.DataVisualization.Charting; +using System.Drawing; namespace ISCamRecorder { @@ -17,6 +19,7 @@ internal class SensorData { readonly string SERIAL_PORT_NAME = "USB シリアル"; // デバイス名 + readonly int NUM_SAMPLES_SET_THRES = 20; // 逆血検出閾値を決定するサンプル数(20Hz) SerialPort _Serial = null; // シリアル通信オブジェクト Queue ValuesB = new Queue(); // センサー値 Queue ValuesR = new Queue(); // センサー値 @@ -30,6 +33,7 @@ MainForm _MF = null; // メインフォームインスタンス bool _IsRecoding = false; // 記録中フラグ bool _ClearPlot = false; // プロット消去フラグ + bool _ReverseBlood = false; // 逆血フラグ public float FrameRate { get { return _Fps.FrameRate; } } // FPS値 @@ -137,6 +141,12 @@ // 表示 if (_MF.State != STATE.Exit) { _MF.SensorChart.Invoke((MethodInvoker)delegate { + var an = (TextAnnotation)_MF.SensorChart.Annotations["AnnReverseBlood"]; + an.Visible = _IsRecoding; + if (_IsRecoding) { + an.Text = _ReverseBlood ? "逆血あり" : "逆血なし"; + an.ForeColor = _ReverseBlood ? Color.OrangeRed : Color.Black; + } _MF.SensorChart.Series[0].Points.Clear(); _MF.SensorChart.Series[0].Points.DataBindXY(Times, ValuesB); _MF.SensorChart.Series[1].Points.Clear(); @@ -168,6 +178,7 @@ _CsvWriter.WriteLine($"Date,Time,elapsed,B,R,G,IR,switch"); } } + _ReverseBlood = false; _ClearPlot = true; _IsRecoding = true; } diff --git a/ISCamRecorder/Setting.cs b/ISCamRecorder/Setting.cs index 6ea15b5..53179e6 100644 --- a/ISCamRecorder/Setting.cs +++ b/ISCamRecorder/Setting.cs @@ -37,16 +37,17 @@ SWTrigger = false; SWTriggerFPS = 40F; ButtonAction = ACTION.movie; - RecCameras = new bool[] { true, true, true, true, true }; SnapCameras = new bool[] { true, true, true, true, false }; #if DEBUG SaveDir = @"D:\DataDBG"; - RecodingLimit = 3F; + RecodingLimit = 5F; MovieRate = 1000; + RecCameras = new bool[] { true, false, false, false, false }; #else SaveDir = @"D:\Data"; RecodingLimit = 30F; MovieRate = 5000; + RecCameras = new bool[] { true, true, true, true, true }; #endif if (File.Exists(SUBJECT_LIST_FILE)) { using (StreamReader sr = new StreamReader(SUBJECT_LIST_FILE)) {