From ecfcb85041a5e0385af6276c0edc5568083d7c9e Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 22 Oct 2019 16:49:34 +0800 Subject: [PATCH] add multiple Rust binaries --- Cargo.toml | 8 ++++++++ plot.py | 2 +- config.json => simple-dmi.json | 0 src/{main.rs => simple-dmi.rs} | 2 +- src/wavemeter.rs | 3 +++ 5 files changed, 13 insertions(+), 2 deletions(-) rename config.json => simple-dmi.json (100%) rename src/{main.rs => simple-dmi.rs} (95%) create mode 100644 src/wavemeter.rs diff --git a/Cargo.toml b/Cargo.toml index 453acf7..fef497b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,6 +4,14 @@ version = "0.1.0" authors = ["Sebastien Bourdeauducq "] edition = "2018" +[[bin]] +name = "simple-dmi" +path = "src/simple-dmi.rs" + +[[bin]] +name = "wavemeter" +path = "src/wavemeter.rs" + [dependencies] num-traits = "0.2" serde = "1.0" diff --git a/plot.py b/plot.py index ce3b7e9..bff02ee 100644 --- a/plot.py +++ b/plot.py @@ -9,7 +9,7 @@ async def task(mw): mw.setCentralWidget(widget) mw.show() - process = await asyncio.create_subprocess_shell("cargo run --release", + process = await asyncio.create_subprocess_shell("cargo run --release --bin simple-dmi", stdout=asyncio.subprocess.PIPE) data = [] while True: diff --git a/config.json b/simple-dmi.json similarity index 100% rename from config.json rename to simple-dmi.json diff --git a/src/main.rs b/src/simple-dmi.rs similarity index 95% rename from src/main.rs rename to src/simple-dmi.rs index 16080d4..2558ca2 100644 --- a/src/main.rs +++ b/src/simple-dmi.rs @@ -31,7 +31,7 @@ fn read_config_from_file>(path: P) -> Result