Ho to use siril-cli.exe from out of c#

Hello to all,

I am busy making a FWHM monitoring device and would like to run siril-cli.exe
directly from out of c#.
At the moment I start a batchfile passing the parameters to siril but would like to
know if this can be done directly under c#.

The batchfile looks like this:


echo OFF
FOR /F "tokens=2 " %%g IN (‘siril --version’) do (SET version=%%g)
set ext=fits
set Folder=“E:\CAPTURAS NINA\FWHM”

(
echo requires %version%
echo setext %ext%
echo cd %Folder%
echo load FWHM
echo findstar
echo close
) | “C:\Program Files\SiriL\bin\siril-cli.exe” -s - 2>&1 | findstr FWHM


The last findstr FWHM only produces the line with the result.

Any help is highly apreciated!
Thanks,

–Mert

Hello, there are three ways to use siril from an external program:

  1. create a script, call siril, read the output, that’s what sirilic is doing
  2. start siril, send commands to the pipe and read responses with the other pipe, that’s what pysiril is doing
  3. make a wrapper for the siril library in your language. A simple way would be to fill the command structure and call the commands functions, but they don’t return anything except success or error. To get more data you’d need to rewrite some functions that do what you want, and that takes a lot of time and requires a lot of knowledge about what’s happening. Reading the existing command functions could help.

If you need periodic or continuous siril access, choice 2 is the easiest, choice 3 is the best but hardest.

Thanks for your feedback Vincent, I apreciate that much!
I think I will stay with the solution I use right now, which is
the command file that creates an output file in a folder.
Then the driver reads this file and extracts the FWHM value
and asigns that to the correct variable in my driver.
It works but I was thinking on streamlining all a bit more.

Best regards,

–Mert