From dfbbba055e2519d4650eba1e3f7178bbd3c3f5c1 Mon Sep 17 00:00:00 2001 From: kamil Date: Thu, 9 Apr 2026 20:16:18 +0300 Subject: [PATCH] Add nmake build and capture run example --- Makefile | 20 ++++++++++++++++++++ main.cpp | 12 +++++++++++- run exmple.txt | 2 +- 3 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..7fe0642 --- /dev/null +++ b/Makefile @@ -0,0 +1,20 @@ +TARGET = main.exe +BUILDDIR = build +SOURCES = main.cpp capture_file_writer.cpp tty_protocol_writer.cpp +OBJS = $(BUILDDIR)\main.obj $(BUILDDIR)\capture_file_writer.obj $(BUILDDIR)\tty_protocol_writer.obj +CXXFLAGS = /nologo /std:c++17 /EHsc /O2 /I. + +all: $(TARGET) + +$(TARGET): $(SOURCES) + if not exist $(BUILDDIR) mkdir $(BUILDDIR) + cl $(CXXFLAGS) /Fo$(BUILDDIR)\ /Fd$(BUILDDIR)\ /Fe$(TARGET) $(SOURCES) + +rebuild: clean all + +clean: + -del /Q $(TARGET) 2>nul + -if exist $(BUILDDIR) rmdir /S /Q $(BUILDDIR) + +run-help: $(TARGET) + $(TARGET) help diff --git a/main.cpp b/main.cpp index e6f0747..1a449bc 100644 --- a/main.cpp +++ b/main.cpp @@ -1251,7 +1251,17 @@ int run(const Config& cfg) { << " ADC range: +/-" << range_to_volts(cfg.range) << " V\n" << " max frames per packet per channel: " << target_frames << "\n"; - CaptureFileWriter writer(cfg.csv_path, cfg.svg_path, cfg.live_html_path, cfg.live_json_path); + CaptureFileWriter writer(cfg.csv_path, + cfg.svg_path, + cfg.live_html_path, + cfg.live_json_path, + cfg.full_res_live, + cfg.live_history_packets, + cfg.di1_group_average); + std::unique_ptr tty_writer; + if (cfg.tty_path) { + tty_writer = std::make_unique(*cfg.tty_path); + } writer.initialize_live_plot(); writer.initialize_csv(cfg.channel_count, cfg.di1_mode == Di1Mode::Trace); std::cout << " live plot html: " << writer.live_html_path() << "\n" diff --git a/run exmple.txt b/run exmple.txt index 2de8060..d2d5199 100644 --- a/run exmple.txt +++ b/run exmple.txt @@ -1 +1 @@ -vclock:internal internal_ref_hz:2000000 start:di_syn2_rise stop:di_syn2_fall sample_clock_hz:max range:0.2 di1:trace di1_group_avg full_res_live live_history_packets:8 duration_ms:100 packet_limit:0 csv:capture.csv svg:capture.svg \ No newline at end of file +.\main.exe clock:internal internal_ref_hz:2000000 start:di_syn2_rise stop:di_syn2_fall sample_clock_hz:max range:0.2 di1:trace di1_group_avg full_res_live live_history_packets:8 duration_ms:100 packet_limit:0 csv:capture.csv svg:capture.svg