fix get_unit with correct marker name, generalize example.py
This commit is contained in:
parent
6b3aac87fe
commit
53377ec75b
@ -529,8 +529,9 @@ public:
|
|||||||
std::string get_unit()
|
std::string get_unit()
|
||||||
{
|
{
|
||||||
// assert ( segments_.size() > 0 );
|
// 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");
|
return valid_ ? segments_["punit marker"][7] : std::string("None");
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,34 @@
|
|||||||
|
|
||||||
import raw_eater
|
import raw_eater
|
||||||
|
|
||||||
eatraw = raw_eater.raweater(b"sample/Rangerover_Evoque_F-RR534_2019-05-07/ABS_A_Port1.raw")
|
rawlist = [ "sample/Rangerover_Evoque_F-RR534_2019-05-07/ABS_A_Port1.raw",
|
||||||
# eatraw = raw_eater.raweater(b"/home/mario/Downloads/FAMOS_Datenformat_ab61.pdf")
|
"./pyt/example.py",
|
||||||
|
"sample/Rangerover_Evoque_F-RR534_2019-05-07/LateralAcceleration_HS.raw" ]
|
||||||
|
|
||||||
print(str(eatraw.validity()))
|
print("")
|
||||||
|
|
||||||
print(eatraw.channel_name())
|
for rf in rawlist :
|
||||||
print(eatraw.unit())
|
|
||||||
|
|
||||||
print(eatraw.get_time())
|
print("converting " + str(rf) + "...\n")
|
||||||
print(eatraw.get_channel())
|
|
||||||
|
|
||||||
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