Add nmake build and capture run example

This commit is contained in:
kamil
2026-04-09 20:16:18 +03:00
parent 9a0d87007d
commit dfbbba055e
3 changed files with 32 additions and 2 deletions

20
Makefile Normal file
View File

@ -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

View File

@ -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<TtyProtocolWriter> tty_writer;
if (cfg.tty_path) {
tty_writer = std::make_unique<TtyProtocolWriter>(*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"

View File

@ -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
.\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