Esempio n. 1
0
        private void CalculatePeakPointsFromSecond(CommandInfoArgs args)
        {
            var points = File.Points;

            if ((points?.Count() ?? 0) <= 0)
            {
                return;
            }

            var startSeconds = Parameter.StartSeconds;
            var endSeconds   = Parameter.EndSeconds;

            // 時間の指定が逆のとき、入れ替えて計算
            if (endSeconds < startSeconds)
            {
                var temp = startSeconds;

                startSeconds = endSeconds;
                endSeconds   = temp;
            }

            Result.ForceSetPeakPoint(points, startSeconds, endSeconds);
            Result.UpdatePeakArea(points);

            // グラフを更新
            PeakPlot.InitializeSeries2(points, Result);

            PeakPlot.UpdatePeakPoints(Result);
            PeakPlot.Update();
        }
Esempio n. 2
0
        private void DragOverCsvFile(CommandInfoArgs <DragEventArgs> args)
        {
            var dragArgs = args.EventArgs;
            var effect   = DragDropEffects.None;

            if (dragArgs.Data.GetDataPresent(DataFormats.FileDrop, true))
            {
                var files = (string[])dragArgs.Data.GetData(DataFormats.FileDrop, false);

                if (files.Count() == 1)
                {
                    dragArgs.Effects = DragDropEffects.Copy;
                }
            }

            dragArgs.Effects = effect;
        }
Esempio n. 3
0
        private void DropCsvFile(CommandInfoArgs <DragEventArgs> args)
        {
            var dragArgs = args.EventArgs;

            var files = (string[])dragArgs.Data.GetData(DataFormats.FileDrop, false);

            // 単体のファイル選択
            if (files.Count() == 1)
            {
                var selectedFile = files[0];

                // ファイルであること、拡張子が txt or csv
                if (System.IO.File.Exists(selectedFile) &&
                    (Path.GetExtension(selectedFile).ToLower() == ".txt" || Path.GetExtension(selectedFile).ToLower() == ".csv"))
                {
                    File.Parse(selectedFile, Parameter.SignalSelectionType);
                }
            }
        }
Esempio n. 4
0
        private void CalculatePeakPointsFromFactor(CommandInfoArgs args)
        {
            var points = File.Points;

            if ((points?.Count() ?? 0) <= 0)
            {
                return;
            }

            // ピークを評価
            Result.MeasurePeakPoints(points, Parameter.StartFactor, Parameter.EndFactor, Parameter.FactorMinSeconds);
            Result.UpdatePeakArea(points);

            // グラフを更新
            PeakPlot.InitializeSeries2(points, Result);

            PeakPlot.UpdatePeakPoints(Result);
            PeakPlot.Update();
        }
Esempio n. 5
0
        private void CopyToClipboard(CommandInfoArgs args)
        {
            var text = args.Parameter?.ToString() ?? "";

            Clipboard.SetText(text);
        }
Esempio n. 6
0
 private void CloseWindow(CommandInfoArgs args)
 {
     Parameter.Save();
 }