|
@@ -77,20 +77,23 @@ func main() {
|
|
|
var printRow_arg printRow_arg
|
|
|
var channelsNumInt int
|
|
|
var channelsNum uint8
|
|
|
+ var adc8Bit bool
|
|
|
|
|
|
getopt.StringVar(&dumpPath, 'i', "dump-path" )
|
|
|
getopt.StringVar(&printRow_arg.outputPath, 'o', "output-path" ).SetOptional()
|
|
|
getopt.BoolVar (&noHeaders, 'n', "no-headers" ).SetOptional()
|
|
|
getopt.IntVar (&channelsNumInt, 'c', "force-channels-num" ).SetOptional()
|
|
|
- channelsNum = uint8(channelsNumInt)
|
|
|
getopt.BoolVar (&printRow_arg.binaryOutput, 'b', "binary-output" ).SetOptional()
|
|
|
getopt.BoolVar (&printRow_arg.insertParseTime, 't', "insert-parse-time" ).SetOptional()
|
|
|
+ getopt.BoolVar (&adc8Bit, '8', "adc-8-bit" ).SetOptional()
|
|
|
|
|
|
getopt.Parse()
|
|
|
if (getopt.NArgs() > 0 || dumpPath == "") {
|
|
|
getopt.Usage()
|
|
|
os.Exit(-2)
|
|
|
}
|
|
|
+ channelsNum = uint8(channelsNumInt)
|
|
|
+
|
|
|
switch (printRow_arg.outputPath) {
|
|
|
/* case "":
|
|
|
now := time.Now()
|
|
@@ -115,9 +118,9 @@ func main() {
|
|
|
// err = binary.Write(printRow_arg.outputFile, binary.LittleEndian, printRow_arg)
|
|
|
//}
|
|
|
|
|
|
- err = voltloggerParser.ParseVoltloggerDump(dumpPath, noHeaders, channelsNum, handleHeader, printRow, &printRow_arg)
|
|
|
+ err = voltloggerParser.ParseVoltloggerDump(dumpPath, noHeaders, channelsNum, adc8Bit, handleHeader, printRow, &printRow_arg)
|
|
|
if (err != nil) {
|
|
|
- fmt.Printf("Cannot parse the dump: %v\n", err.Error())
|
|
|
+ fmt.Printf("Cannot parse the dump: %v (channels == %v)\n", err.Error(), channelsNum)
|
|
|
os.Exit(-1)
|
|
|
}
|
|
|
printRow_arg.outputFile.Close()
|