From 4da867e42eca6264ca59a6ac999f49aa684385ba Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 17 May 2017 15:13:58 +0200 Subject: Use JSON models instead of XML JSON is easier to (de)serialize and the manual editing possibilities of XML don't matter after the switch to model file autogeneration using attributes and aspects --- bin/dfatool | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'bin') diff --git a/bin/dfatool b/bin/dfatool index a5a53e9..58f59d6 100755 --- a/bin/dfatool +++ b/bin/dfatool @@ -48,7 +48,7 @@ if ( @ARGV < 2 ) { @{ $opt{'param-default'} } = split( qr{,}, join( q{,}, @{ $opt{'param-default'} // [] } ) ); -my ( $command, $xml_file, @data_files ) = @ARGV; +my ( $command, $model_file, @data_files ) = @ARGV; my $driver = Kratos::DFADriver->new( cache => $opt{'no-cache'} ? 0 : 1, @@ -68,11 +68,11 @@ my $driver = Kratos::DFADriver->new( mimosa_offset => $opt{offset} // 130, mimosa_shunt => $opt{shunt} // 330, mimosa_voltage => $opt{voltage} // 3.60, + model_file => $model_file, param_default => $opt{'param-default'} // [], trace_filter => $opt{'trace-filter'} // [], trace_revisit => $opt{'trace-revisit'} // 2, with_lut => $opt{'with-lut'}, - xml_file => $xml_file, ); my %action = ( @@ -196,7 +196,7 @@ my %action = ( }, crossvalidate => sub { printf( "./dfatool crossvalidate %s %s\n", - $xml_file, join( q{ }, @data_files ) ); + $model_file, join( q{ }, @data_files ) ); $driver->crossvalidate_model(@data_files); }, ls => sub { @@ -319,7 +319,7 @@ $SIG{INT} = $SIG{TERM} = sub { }; sub show_usage { - say STDERR "Usage: $0 "; + say STDERR "Usage: $0 "; say STDERR 'Supported actions: ' . join( q{ }, sort keys %action ); exit 1; } @@ -349,10 +349,10 @@ test programs to assess a device's energy usage. =head1 SYNOPSIS -B [I] enable|disable|maketest|rmtest|log|loop I +B [I] enable|disable|maketest|rmtest|log|loop I B [I] analyze|crossvalidate|ls|list|show -I I [I] +I I [I] =head1 VERSION @@ -365,20 +365,20 @@ the last transition in a run =over -=item B I +=item B I -Instruments the driver noted in I for energy accounting and state +Instruments the driver noted in I for energy accounting and state and transition logging. Unconditionally uses static model attributes and only relative energy values. Attributes whose power or energy values are not yet known are set to zero. -=item B I +=item B I Removes accounting and logging instrumentation, thus turning the driver back into an energy-unaware one. By default, each state may be visited up to two times... -=item B I +=item B I Creates a kratos application containing a test program for the driver. By default, -- cgit v1.2.3