Skip to content
Snippets Groups Projects
Commit 71ea0e1d authored by Udo Eisenbarth's avatar Udo Eisenbarth :speech_balloon:
Browse files

Add OPPOSSUM_FILE_VERSION to build system

parent 8668ffc4
No related branches found
No related tags found
1 merge request!23Resolve "OPOSSUM model file: Add version information"
[env]
OPM_FILE_VERSION = "0"
......@@ -9,7 +9,6 @@ license = "GPL-3.0-or-later"
keywords = ["laser", "optics", "physics", "simulation"]
categories = [ "science", "simulation"]
publish = false
build = "build.rs"
[dependencies]
......
......@@ -257,6 +257,9 @@ impl OpticScenery {
serde_json::Value::Object(report)
}
pub fn save_to_file(&self, path: &Path) -> OpmResult<()> {
// testing only:
let file_version=env!("OPM_FILE_VERSION");
println!("file version: {:?}", file_version);
let serialized = serde_json::to_string_pretty(&self).map_err(|e| {
OpossumError::OpticScenery(format!("deserialization of OpticScenery failed: {}", e))
})?;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment