Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any plans for integration into projects like possible with ksv? #81

Open
ams-tschoening opened this issue Jan 28, 2019 · 2 comments
Open

Comments

@ams-tschoening
Copy link

I didn't find an answer in the issues or docs, so am simply asking here: I'm using Kaitai Struct to generate Java-based parsers for some file format and am using Eclispe as IDE. Because of the KSY-files already available, I have a setup combining Ruby and some Eclipse launch config to be able to use ksv to have a look at the files I'm parsing independently of my own software for test and debugging purposes. While ksv works, the WebIDE seems to be better to use because of resizable Windows, scrolling, clicking and such.

I don't think I want to develop my KSY files in WebIDE, though, but stay with my current Eclipse-based project layout in which everything is versioned, I'm able to use some text based preprocessor for my KSY-files etc. WebIDE should be a more flexible viewer only most likely.

So, are there any plans to integrate WebIDE with KSY files managed outside the browser? I didn't find any command line support to tell it where it finds it's files or anything like that.

Thanks!

@koczkatamas
Copy link
Member

koczkatamas commented Jan 28, 2019

Currently the WebIDE does not support such feature.

We have multiple options to implement a feature like this, I see two major options:

Option A) publish local file system to WebIDE, so it can read the latest .ksy, and input binary file from there. This was planned originally: #20. As an additional feature we could detect file changes, so the WebIDE could update the views if you save the file in Eclipse. This can be done somewhat easily.

Option B) Decouple file parsing from visualization. A local app (e.g. a modified ksv) can parse the file and publish it to the WebIDE. It can push all the content in one-step (does not work with big files) or can stream the nodes / input binary on the fly (when you scroll them into view). This solution is much more complicated. Not a new idea either: kaitai-io/kaitai_struct#143

Do I understand you problem correctly and the options suggested above would solve your problem? Or just Option B) would solve it (you modify the generated Ruby / Java / JS code after compilation)?

@ams-tschoening
Copy link
Author

Sounds like option A/#20 is actually what I was looking for. This might even make developing KSY in WebIDE an option for setups like mine. While I do modify the generated Java-Code using source cleanup of Eclipse, that's nothing WebIDE need to care about, I don't do that for the Ruby-source for example. Those are only temporary.

Being able to access the local file system and support for opaque types seems to be the only two things I would need. The following is the command line I'm invoking for ksv:

${env_var:ComSpec} /C start "${env_var:ComSpec}" /K """${env_var:ProgramFiles(x86)}\Ruby23\bin\ruby.exe" "-I${env_var:ProgramFiles(x86)}/kaitai_struct/runtime/ruby/lib" "-r${workspace_loc:/de.am_soft.sm_mtg.format.parser/src/de/am_soft/sm_mtg/format/parser/record/ruby/fmt_rec_oms_pre_proc.rb}" "${env_var:ProgramFiles(x86)}/kaitai_struct/visualizer/bin/ksv" "--opaque-types=true" "${workspace_loc}/../../Svn/Bin/Giftschrank/Smart-Metering/recs_clt.bin" "record\clt\fmt_recs_clt.ksy"""

Don't care about the Windows-specific shell-stuff, in the end it's simply executing ksv with some pre-loaded opaque type, one KSY- and one binary file. If I could forward my dir structure for both to WebIDE, that would be great.

Feel free to merge this with or close it in favour of #20, I would habe posted my use case there if I had found it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants