[Rock-dev] converting log files
Sylvain Joyeux
sylvain.joyeux at dfki.de
Mon Jan 17 15:36:13 CET 2011
On 01/17/2011 10:25 AM, Alexander Duda wrote:
> Hi all,
>
> For a student project we need to convert a bunch of log files. Therefore
> I thought it is a good time to start the log file converter we have in
> mind for a while.
>
> What do you guys think about the following?
>
> ###############################################
> time_from = Time.gm(2010,"dec",1,20,15,1)
> time_from2 = Time.gm(2010,"dec",13,20,15,1)
> registry = "reg.tbl"
> registry2 = "reg2.tbl"
>
> Pocosim.Converter("/base/Time",time_from,registry) do |
> old_sample,new_sample|
> new_sample = Time.at(old_sample.microsconds)
> end
>
> Pocosim.Converter("/base/Time",time_from2,registry2) do |
> deep_copy(old_sample,new_sample)
> end
>
> Pocosim.Converter("/base/samples/frame/Frame",time_from,registry) do |
> old_sample,new_sample|
> new_sample.data2 = old_sample.data
> exclude_list = [old_sample.data]
> deep_copy(old_sample,new_sample,exclude_list)
> end
> ###############################################
>
> This would mean that for each conversion a tbl file must be stored. The
> benefit out of this would be that you only have to provide scripts to
> convert from the last version to the current one. The rest is handled
> automatically.
>
> convert file.log -to "2010,dec,1,20,15,1"
> convert file.log -to now
> Alex
>
I like the general idea. We could easily transform such an API into a
full blown tool (i.e. where convertion scripts get registered into some
kind of a registry of their own). There's something I don't quite get,
though ...
What is the registry you give to the converter for ?
--
Sylvain
More information about the Rock-dev
mailing list