hoche / splat

SPLAT! is an RF Signal Propagation, Loss, And Terrain analysis tool for the spectrum between 20 MHz and 20 GHz. This is a copy of the code written by John Magliacane, heavily modified to clean up the code and take advantage of multithreading. This incorporates John's antenna height modifications from the as-yet-unreleased SPLAT 1.4.3.
http://www.qsl.net/kd2bd/splat.html
GNU General Public License v2.0
29 stars 6 forks source link

Discussion: Text output templating engine for XML/Javascript/etc files #11

Open hoche opened 4 years ago

hoche commented 4 years ago

Right now there's a bunch of different functions where XML is generated by doing sprintfs. Much is redundant and could be combined together. However, it occurs to me that it might be better to incorporate some sort of template engine for that. I'm not talking about sucking in a full-bore templating engine like Jinja or Jade (wrong language anyway), just creating a simple substitution engine where key tags in the text file get replaced with something out of std::unordered_map.

I'll have to analyze the code some, but I don't think we need much more than that.

If we have complex data it'd get complicated, but even then we could suck in something like https://github.com/pantor/inja.

dBitech commented 4 years ago

I'm not in favor of having splat produce anything that resembles HTML natively. Have it produce other computer readable formats such as JSOM or XML would be far better. Let a separate tool convert the computer-readable output into front end displayable data.

der-stefan commented 4 years ago

Having an optional HTML output would be a great feature and improves native usability. It also could serve as a kind of template for new splat web services - all that I knew are offline now. And why not? Yet another option doesn't make splat unusable. @hoche I had exactly this problem today how to include my existing Leaflet based map output in a clean way. All I did today was reading and understanding splat's code, but still there are open questions (#9 , #10 ). My own toolchain is fine with one PNG and a JSON file that includes the four coordinates of two diagonal corners. It can also include additional meta information, e.g. all parameters that were used. Going to push that these days, but propably not finished for release.

hoche commented 4 years ago

Sorry yeah, I misspoke and meant XML where I said HTML. I'll change the issue title. The general problem is the same though.

hoche commented 4 years ago

@der-stefan When I mentioned HTML I was really thinking of the XML that's generated to make nice KML/KMZ files. For website usage, I'm not sure how much SPLAT! should generate, but I'd be more inclined to have it create JSON files that could be used as a data source for some client-side Javascript processing.