fix get_unit with correct marker name, generalize example.py
This commit is contained in:
parent
6b3aac87fe
commit
53377ec75b
@ -530,7 +530,8 @@ public:
|
||||
{
|
||||
// assert ( segments_.size() > 0 );
|
||||
|
||||
if ( datasec_["punit"].size() > 0 )
|
||||
if ( datasec_["punit marker"].size() > 0
|
||||
&& segments_["punit marker"].size() > 6 )
|
||||
{
|
||||
return valid_ ? segments_["punit marker"][7] : std::string("None");
|
||||
}
|
||||
|
@ -1,15 +1,34 @@
|
||||
|
||||
import raw_eater
|
||||
|
||||
eatraw = raw_eater.raweater(b"sample/Rangerover_Evoque_F-RR534_2019-05-07/ABS_A_Port1.raw")
|
||||
# eatraw = raw_eater.raweater(b"/home/mario/Downloads/FAMOS_Datenformat_ab61.pdf")
|
||||
rawlist = [ "sample/Rangerover_Evoque_F-RR534_2019-05-07/ABS_A_Port1.raw",
|
||||
"./pyt/example.py",
|
||||
"sample/Rangerover_Evoque_F-RR534_2019-05-07/LateralAcceleration_HS.raw" ]
|
||||
|
||||
print(str(eatraw.validity()))
|
||||
print("")
|
||||
|
||||
print(eatraw.channel_name())
|
||||
print(eatraw.unit())
|
||||
for rf in rawlist :
|
||||
|
||||
print(eatraw.get_time())
|
||||
print(eatraw.get_channel())
|
||||
print("converting " + str(rf) + "...\n")
|
||||
|
||||
eatraw.write_table(b"mycsv.csv",ord(' '))
|
||||
eatraw = raw_eater.raweater(rf.encode())
|
||||
|
||||
print(str(eatraw.validity()))
|
||||
|
||||
if eatraw.validity() :
|
||||
|
||||
print(eatraw.channel_name())
|
||||
print(eatraw.unit())
|
||||
|
||||
print(eatraw.get_time())
|
||||
print(eatraw.get_channel())
|
||||
|
||||
outname = rf.split('/')[-1].replace('raw','csv')
|
||||
|
||||
eatraw.write_table(outname.encode(),ord(' '))
|
||||
|
||||
else :
|
||||
|
||||
print("invalid/corrupt .raw file")
|
||||
|
||||
print("\n")
|
||||
|
Loading…
x
Reference in New Issue
Block a user