Project

General

Profile

Actions

Support Request #6357

closed

ADTF adtf_file example, no type deserializer

Added by hidden about 5 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Customer:
AUDI
Department:
EFS
Requester's Priority:
Normal
Support Level:
3rd Level
Resolution:
Solved Issue
Affected Products:
Platform:
Windows 7 64bit
Topic:
ADTF::Common
FAQ Links:

Description

Support Anfrage:

ich versuche gerade mit ADTF 3.3.1 und dem "adtf_file" example\\fileaccess ein .dat file zu öffnen.
Compilierung des examples über cmake und Visual Studio hat soweit auch funktioniert, .exe wurde erstellt.
Beim Aufruf der .exe mit einem ADTF .dat file als Argument bekomme ich aber folgende Fehlermeldung:

Es fehlt wohl der flexray deserializer. Leider komme ich ab diesem Punkt selbst nicht mehr weiter.
Können sie mich bitte unterstützen?

Lösung:

Es wird dringend empfohlen auf die aktuellen Versionen von ADTF ( ADTF 3.5.0) bzw. in diesen Fall der ADTF File Library 0.4.0 (BETA) zu wechseln.
Das ADTF File Access Example ist in der aktuellen Version in der SDK Doku der ADTF File Library hinterlegt. Siehe Link oben oder hier .
Seit ADTF 3.4.0 ist das DAT Handling endgültig in die ADTF File Library übergegangen.
Siehe hierzu auch die entsprechende Release Information ADTF 3.4.0

Move ADTF DAT Processing and tooling to ADTF File Library (delivered by 3rd Party ifhd)

Inzwischen ist auch die Device Toolbox 3.0.0 verfügbar (Stichwort Flexray), siehe Release Information Device Toolbox 3.0.0

Um das eigentliche Problem zu lösen, muss das Example so erweitert werden, dass weitere adtffileplugins nachladen werden können (darüber kannst man Deserializer bekannt machen). Dazu gibt es auch ein Ticket (CDIFHD-24). Mit der Device kannst man die typen aus ADTF 2.x bekannt machen, man müsste das Example in etwa so erweitern:

// ...

#include <map>

// initalize ADTF File and Plugin Mechanism
static adtf_file::Objects oObjects;
static adtf_file::PluginInitializer oInitializer([]
{
    adtf_file::add_standard_objects();
});

void query_file_info(const std::string& filename)
{
    using namespace adtf_file;

    // load deserializer from adtffileplugin
    adtf_file::load_plugin("<path_to_device_toolbox_3_0_0>/bin/adtf_devtb_2_deserializer.adtffileplugin"); // or debug: adtf_file::load_plugin("<path_to_device_toolbox_3_0_0>/bin/debug/adtf_devtb_2_deserializerd.adtffileplugin");

    // open file -> create reader from former added settings
    adtf_file::Reader reader(filename,
                 adtf_file::getFactories<adtf_file::StreamTypeDeserializers,
                     adtf_file::StreamTypeDeserializer>(),
                 adtf_file::getFactories<adtf_file::SampleDeserializerFactories,
                 adtf_file::SampleDeserializerFactory>(),
                 std::make_shared<adtf_file::sample_factory<adtf_file::DefaultSample>>(),
                 std::make_shared<adtf_file::stream_type_factory<adtf_file::DefaultStreamType>>());

    std::cout << "File: " << filename << std::endl;

    // ...

void access_file_data(const std::string& filename, const std::string& csv_file_path)
{
    using namespace adtf_file;

    // load deserializer from adtffileplugin
    adtf_file::load_plugin("<path_to_device_toolbox_3_0_0>/bin/adtf_devtb_2_deserializer.adtffileplugin"); // or debug: adtf_file::load_plugin("<path_to_device_toolbox_3_0_0>/bin/debug/adtf_devtb_2_deserializerd.adtffileplugin");

    adtf_file::Reader reader(filename,
                 adtf_file::getFactories<adtf_file::StreamTypeDeserializers,
                     adtf_file::StreamTypeDeserializer>(),
                 adtf_file::getFactories<adtf_file::SampleDeserializerFactories,
                 adtf_file::SampleDeserializerFactory>(),
                 std::make_shared<adtf_file::sample_factory<adtf_file::DefaultSample>>(),
                 std::make_shared<adtf_file::stream_type_factory<adtf_file::DefaultStreamType>>());

    StreamsInfo stream_info(reader);

Patch an dieser Stelle nicht vergessen (siehe Device Toolbox Download), sofern die ADTF File Library 0.4.0 (= Basis ab ADTF 3.4.0) verwendet wird (dringend empfohlen)


Files

image001.png (4.45 KB) image001.png hidden, 2019-03-01 14:00
Actions

Also available in: Atom PDF