Properly implemented Protocol Search support for the sample analyzer.

Also used recently added #define flag to disable or enable the protocol search code, based on the SDK version. Ideally this will allow the same code to compile for the legacy SDK or the latest SDK.
This commit is contained in:
Marcus10110 2017-05-12 10:57:02 -07:00
parent 1f647bee70
commit f0ed04d728
3 changed files with 15 additions and 9 deletions

View file

@ -3,7 +3,7 @@
#include <AnalyzerChannelData.h> #include <AnalyzerChannelData.h>
SimpleSerialAnalyzer::SimpleSerialAnalyzer() SimpleSerialAnalyzer::SimpleSerialAnalyzer()
: Analyzer(), : Analyzer2(),
mSettings( new SimpleSerialAnalyzerSettings() ), mSettings( new SimpleSerialAnalyzerSettings() ),
mSimulationInitilized( false ) mSimulationInitilized( false )
{ {
@ -15,12 +15,15 @@ SimpleSerialAnalyzer::~SimpleSerialAnalyzer()
KillThread(); KillThread();
} }
void SimpleSerialAnalyzer::WorkerThread() void SimpleSerialAnalyzer::SetupResults()
{ {
mResults.reset( new SimpleSerialAnalyzerResults( this, mSettings.get() ) ); mResults.reset( new SimpleSerialAnalyzerResults( this, mSettings.get() ) );
SetAnalyzerResults( mResults.get() ); SetAnalyzerResults( mResults.get() );
mResults->AddChannelBubblesWillAppearOn( mSettings->mInputChannel ); mResults->AddChannelBubblesWillAppearOn( mSettings->mInputChannel );
}
void SimpleSerialAnalyzer::WorkerThread()
{
mSampleRateHz = GetSampleRate(); mSampleRateHz = GetSampleRate();
mSerial = GetAnalyzerChannelData( mSettings->mInputChannel ); mSerial = GetAnalyzerChannelData( mSettings->mInputChannel );

View file

@ -6,11 +6,13 @@
#include "SimpleSerialSimulationDataGenerator.h" #include "SimpleSerialSimulationDataGenerator.h"
class SimpleSerialAnalyzerSettings; class SimpleSerialAnalyzerSettings;
class ANALYZER_EXPORT SimpleSerialAnalyzer : public Analyzer class ANALYZER_EXPORT SimpleSerialAnalyzer : public Analyzer2
{ {
public: public:
SimpleSerialAnalyzer(); SimpleSerialAnalyzer();
virtual ~SimpleSerialAnalyzer(); virtual ~SimpleSerialAnalyzer();
virtual void SetupResults();
virtual void WorkerThread(); virtual void WorkerThread();
virtual U32 GenerateSimulationData( U64 newest_sample_requested, U32 sample_rate, SimulationChannelDescriptor** simulation_channels ); virtual U32 GenerateSimulationData( U64 newest_sample_requested, U32 sample_rate, SimulationChannelDescriptor** simulation_channels );

View file

@ -60,22 +60,23 @@ void SimpleSerialAnalyzerResults::GenerateExportFile( const char* file, DisplayB
void SimpleSerialAnalyzerResults::GenerateFrameTabularText( U64 frame_index, DisplayBase display_base ) void SimpleSerialAnalyzerResults::GenerateFrameTabularText( U64 frame_index, DisplayBase display_base )
{ {
#ifdef SUPPORTS_PROTOCOL_SEARCH
Frame frame = GetFrame( frame_index ); Frame frame = GetFrame( frame_index );
ClearResultStrings(); ClearTabularText();
char number_str[128]; char number_str[128];
AnalyzerHelpers::GetNumberString( frame.mData1, display_base, 8, number_str, 128 ); AnalyzerHelpers::GetNumberString( frame.mData1, display_base, 8, number_str, 128 );
AddResultString( number_str ); AddTabularText( number_str );
#endif
} }
void SimpleSerialAnalyzerResults::GeneratePacketTabularText( U64 packet_id, DisplayBase display_base ) void SimpleSerialAnalyzerResults::GeneratePacketTabularText( U64 packet_id, DisplayBase display_base )
{ {
ClearResultStrings(); //not supported
AddResultString( "not supported" );
} }
void SimpleSerialAnalyzerResults::GenerateTransactionTabularText( U64 transaction_id, DisplayBase display_base ) void SimpleSerialAnalyzerResults::GenerateTransactionTabularText( U64 transaction_id, DisplayBase display_base )
{ {
ClearResultStrings(); //not supported
AddResultString( "not supported" );
} }