Hi, I am struggling with a problem how to create configuration files for this kind of application:
LabWorker
- libs for communicating with other hardware over the multiple protocols
- tasks for running defined steps manually (debug, fast obtained result)
- main worker takes the keyword list from configuration file, process one by one item and shows results
- in the future web interface for steps configuration and observing results
- configuration temporarily hard coded in config/#{env}.exs
Configuration looks like that:
config :tasklist,
steps: [
{:dev1, getData: %{:channel => 11, :name => “x”}},
{:dev2 :getData},
{:dev3, setParam: %{:steps => 10, :min => 0, :max => 10}}, // here is a problem
{:dev1, :getPower},
{:dev5, :getData}
]
config :dev1,
conn: :rest,
endpoint: …
config :dev2,
conn: :scpi,
ip: …
This config style starting to be very messy while I need some complex task list. Examples:
Steps:
dev1, get power for channel 1
dev2, get data
dev3, set param power to x
dev1, get power for channel 1
dev2, get data
– so far so good… I need ordered keywords list to preserve steps order
but what I wanted this 100x bigger and only one device has variable input, something like this:
while power < 10 do
dev1, get power for channel 1
dev2, get data
dev3, set param #{power} to x
power += 0.1
end
I need to configure min and max value together with step size at least and this is just in case that I have one configurable device…
It seems to me that would be faster to write some config file generator for that instead of trying to parse too complex config file, but I am afraid of final size of such keyword list…