Commit a37247be authored by Anne Heimes's avatar Anne Heimes

für 32 bit + serverLog update + bugfix ReadMessage

parent eac2e0db
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#include <VistaInterProcComm/Connections/VistaConnectionIP.h> #include <VistaInterProcComm/Connections/VistaConnectionIP.h>
#include <VistaBase/VistaExceptionBase.h> #include <VistaBase/VistaExceptionBase.h>
#include <VistaBase/VistaStreamUtils.h> #include <VistaBase/VistaStreamUtils.h>
#include <ITAClock.h> #include <ITAClock.h>
#include <cstring> #include <cstring>
...@@ -124,7 +124,8 @@ bool CITANetAudioMessage::ReadMessage( int timeout) ...@@ -124,7 +124,8 @@ bool CITANetAudioMessage::ReadMessage( int timeout)
if ( nIncomingBytes == -1) if ( nIncomingBytes == -1)
return false; return false;
nIncomingBytes = m_pConnection->WaitForIncomingData( 0 ); if (timeout != 0)
nIncomingBytes = m_pConnection->WaitForIncomingData( 0 );
#if NET_AUDIO_SHOW_TRAFFIC #if NET_AUDIO_SHOW_TRAFFIC
vstr::out() << "CITANetAudioMessage [ Reading ] " << nIncomingBytes << " bytes incoming" << std::endl; vstr::out() << "CITANetAudioMessage [ Reading ] " << nIncomingBytes << " bytes incoming" << std::endl;
#endif #endif
...@@ -135,8 +136,10 @@ bool CITANetAudioMessage::ReadMessage( int timeout) ...@@ -135,8 +136,10 @@ bool CITANetAudioMessage::ReadMessage( int timeout)
#if NET_AUDIO_SHOW_TRAFFIC #if NET_AUDIO_SHOW_TRAFFIC
vstr::out() << "CITANetAudioMessage [ Reading ] Expecting " << nMessagePayloadSize << " bytes message payload" << std::endl; vstr::out() << "CITANetAudioMessage [ Reading ] Expecting " << nMessagePayloadSize << " bytes message payload" << std::endl;
#endif #endif
if (nMessagePayloadSize <= 2 * sizeof(VistaType::sint32))
int i = 34;
// we need at least the two protocol ints // we need at least the two protocol ints
assert( nMessagePayloadSize >= 2 * sizeof( VistaType::sint32 ) ); //assert( nMessagePayloadSize >= 2 * sizeof( VistaType::sint32 ) );
if( nMessagePayloadSize > ( int ) m_vecIncomingBuffer.size() ) if( nMessagePayloadSize > ( int ) m_vecIncomingBuffer.size() )
m_vecIncomingBuffer.resize( nMessagePayloadSize ); m_vecIncomingBuffer.resize( nMessagePayloadSize );
...@@ -165,6 +168,7 @@ bool CITANetAudioMessage::ReadMessage( int timeout) ...@@ -165,6 +168,7 @@ bool CITANetAudioMessage::ReadMessage( int timeout)
#if NET_AUDIO_SHOW_TRAFFIC #if NET_AUDIO_SHOW_TRAFFIC
vstr::out() << "CITANetAudioMessage [ Reading ] Finished receiving " << m_nMessageType << " (id=" << std::setw( 4 ) << m_nMessageId << ")" << std::endl; vstr::out() << "CITANetAudioMessage [ Reading ] Finished receiving " << m_nMessageType << " (id=" << std::setw( 4 ) << m_nMessageId << ")" << std::endl;
#endif #endif
return true;
} }
int CITANetAudioMessage::GetMessageType() const int CITANetAudioMessage::GetMessageType() const
......
#include <ITANetAudioStreamingClient.h> #include <ITANetAudioStreamingClient.h>
#include <ITANetAudioClient.h> #include <ITANetAudioClient.h>
#include <ITANetAudioMessage.h> #include <ITANetAudioMessage.h>
#include <ITANetAudioStream.h> #include <ITANetAudioStream.h>
#include <ITADataLog.h> #include <ITADataLog.h>
#include <ITAClock.h> #include <ITAClock.h>
#include <VistaInterProcComm/Connections/VistaConnectionIP.h> #include <VistaInterProcComm/Connections/VistaConnectionIP.h>
#include <VistaBase/VistaStreamUtils.h> #include <VistaBase/VistaStreamUtils.h>
//! Audio streaming log item //! Audio streaming log item
struct ITAClientLog : public ITALogDataBase struct ITAClientLog : public ITALogDataBase
{ {
inline static std::ostream& outputDesc( std::ostream& os ) inline static std::ostream& outputDesc( std::ostream& os )
{ {
os << "BlockId"; os << "BlockId";
os << "\t" << "WorldTimeStamp"; os << "\t" << "WorldTimeStamp";
os << "\t" << "ProtocolStatus"; os << "\t" << "ProtocolStatus";
os << "\t" << "FreeSamples"; os << "\t" << "FreeSamples";
os << "\t" << "Channel"; os << "\t" << "Channel";
os << std::endl; os << std::endl;
return os; return os;
}; };
inline std::ostream& outputData( std::ostream& os ) const inline std::ostream& outputData( std::ostream& os ) const
{ {
os << uiBlockId; os << uiBlockId;
os << "\t" << std::setprecision( 12 ) << dWorldTimeStamp; os << "\t" << std::setprecision( 12 ) << dWorldTimeStamp;
os << "\t" << iProtocolStatus; os << "\t" << iProtocolStatus;
os << "\t" << iFreeSamples; os << "\t" << iFreeSamples;
os << "\t" << iChannel; os << "\t" << iChannel;
os << std::endl; os << std::endl;
return os; return os;
}; };
unsigned int uiBlockId; //!< Block identifier (audio streaming) unsigned int uiBlockId; //!< Block identifier (audio streaming)
double dWorldTimeStamp; double dWorldTimeStamp;
int iProtocolStatus; //!< ... usw int iProtocolStatus; //!< ... usw
int iFreeSamples; int iFreeSamples;
int iChannel; int iChannel;
}; };
class ITABufferedDataLoggerImplClient : public ITABufferedDataLogger < ITAClientLog > {}; class ITABufferedDataLoggerImplClient : public ITABufferedDataLogger < ITAClientLog > {};
CITANetAudioStreamingClient::CITANetAudioStreamingClient( CITANetAudioStream* pParent ) CITANetAudioStreamingClient::CITANetAudioStreamingClient( CITANetAudioStream* pParent )
: m_oBlockIncrementEvent( VistaThreadEvent::WAITABLE_EVENT ) : m_oBlockIncrementEvent( VistaThreadEvent::WAITABLE_EVENT )
, m_pStream( pParent ) , m_pStream( pParent )
, m_pConnection( NULL ) , m_pConnection( NULL )
, m_bStopIndicated( false ) , m_bStopIndicated( false )
{ {
m_pClient = new CITANetAudioClient(); m_pClient = new CITANetAudioClient();
m_oParams.iChannels = pParent->GetNumberOfChannels(); m_oParams.iChannels = pParent->GetNumberOfChannels();
m_oParams.dSampleRate = pParent->GetSampleRate( ); m_oParams.dSampleRate = pParent->GetSampleRate( );
m_oParams.iBlockSize = pParent->GetBlocklength( ); m_oParams.iBlockSize = pParent->GetBlocklength( );
m_oParams.iRingBufferSize = pParent->GetRingBufferSize( ); m_oParams.iRingBufferSize = pParent->GetRingBufferSize( );
std::string paras = std::string("NetAudioLogClient") + std::string("_BS") + std::to_string(pParent->GetBlocklength()) + std::string("_Ch") + std::to_string(pParent->GetNumberOfChannels()) + std::string(".txt"); std::string paras = std::string("NetAudioLogClient") + std::string("_BS") + std::to_string(pParent->GetBlocklength()) + std::string("_Ch") + std::to_string(pParent->GetNumberOfChannels()) + std::string(".txt");
m_pClientLogger = new ITABufferedDataLoggerImplClient( ); m_pClientLogger = new ITABufferedDataLoggerImplClient( );
m_pClientLogger->setOutputFile(paras); m_pClientLogger->setOutputFile(paras);
iStreamingBlockId = 0; iStreamingBlockId = 0;
m_pMessage = new CITANetAudioMessage( VistaSerializingToolset::SWAPS_MULTIBYTE_VALUES ); m_pMessage = new CITANetAudioMessage( VistaSerializingToolset::SWAPS_MULTIBYTE_VALUES );
} }
CITANetAudioStreamingClient::~CITANetAudioStreamingClient() CITANetAudioStreamingClient::~CITANetAudioStreamingClient()
{ {
//try{ //try{
if (m_pConnection->GetIsOpen()) if (m_pConnection->GetIsOpen())
{ {
m_pMessage->ResetMessage(); m_pMessage->ResetMessage();
m_pMessage->SetConnection(m_pConnection); m_pMessage->SetConnection(m_pConnection);
m_pMessage->SetMessageType(CITANetAudioProtocol::NP_CLIENT_CLOSE); m_pMessage->SetMessageType(CITANetAudioProtocol::NP_CLIENT_CLOSE);
m_pMessage->WriteMessage(); m_pMessage->WriteMessage();
m_pClient->Disconnect(); m_pClient->Disconnect();
} }
delete m_pClientLogger; delete m_pClientLogger;
//} //}
//catch (ITAException e){ //catch (ITAException e){
// std::cout << e << std::endl; // std::cout << e << std::endl;
//} //}
} }
bool CITANetAudioStreamingClient::Connect( const std::string& sAddress, int iPort ) bool CITANetAudioStreamingClient::Connect( const std::string& sAddress, int iPort )
{ {
if( GetIsConnected() ) if( GetIsConnected() )
return false; return false;
if( !m_pClient->Connect( sAddress, iPort ) ) if( !m_pClient->Connect( sAddress, iPort ) )
ITA_EXCEPT1( INVALID_PARAMETER, "Could not connect to " + sAddress ); ITA_EXCEPT1( INVALID_PARAMETER, "Could not connect to " + sAddress );
m_pConnection = m_pClient->GetConnection(); m_pConnection = m_pClient->GetConnection();
m_pMessage->ResetMessage(); m_pMessage->ResetMessage();
m_pMessage->SetConnection( m_pConnection ); m_pMessage->SetConnection( m_pConnection );
// Validate streaming parameters of server and client // Validate streaming parameters of server and client
m_pMessage->SetMessageType( CITANetAudioProtocol::NP_CLIENT_OPEN ); m_pMessage->SetMessageType( CITANetAudioProtocol::NP_CLIENT_OPEN );
m_pMessage->WriteStreamingParameters( m_oParams ); m_pMessage->WriteStreamingParameters( m_oParams );
m_pMessage->WriteMessage( ); m_pMessage->WriteMessage( );
m_pMessage->ResetMessage( ); m_pMessage->ResetMessage( );
while ( !m_pMessage->ReadMessage( 0 ) ); while ( !m_pMessage->ReadMessage( 0 ) );
assert( m_pMessage->GetMessageType( ) == CITANetAudioProtocol::NP_SERVER_OPEN ); assert( m_pMessage->GetMessageType( ) == CITANetAudioProtocol::NP_SERVER_OPEN );
bool bOK = m_pMessage->ReadBool(); bool bOK = m_pMessage->ReadBool();
if( !bOK ) if( !bOK )
ITA_EXCEPT1( INVALID_PARAMETER, "Streaming server declined connection, detected streaming parameter mismatch." ); ITA_EXCEPT1( INVALID_PARAMETER, "Streaming server declined connection, detected streaming parameter mismatch." );
Run(); Run();
return true; return true;
} }
bool CITANetAudioStreamingClient::LoopBody() bool CITANetAudioStreamingClient::LoopBody()
{ {
ITAClientLog oLog; ITAClientLog oLog;
oLog.uiBlockId = ++iStreamingBlockId; oLog.uiBlockId = ++iStreamingBlockId;
if( m_bStopIndicated ) if( m_bStopIndicated )
return true; return true;
// Send message to server that samples can be received // Send message to server that samples can be received
m_pMessage->ResetMessage( ); m_pMessage->ResetMessage( );
// Read answer // Read answer
if ( m_pMessage->ReadMessage( 0 ) ) if ( m_pMessage->ReadMessage( 0 ) )
{ {
int iMsgType = m_pMessage->GetMessageType( ); int iMsgType = m_pMessage->GetMessageType( );
switch ( iMsgType ) switch ( iMsgType )
{ {
case CITANetAudioProtocol::NP_SERVER_SENDING_SAMPLES: case CITANetAudioProtocol::NP_SERVER_SENDING_SAMPLES:
// Receive samples from net message and forward them to the stream ring buffer // Receive samples from net message and forward them to the stream ring buffer
m_pMessage->ReadSampleFrame( &m_sfReceivingBuffer ); m_pMessage->ReadSampleFrame( &m_sfReceivingBuffer );
if ( m_pStream->GetRingBufferFreeSamples( ) >= m_sfReceivingBuffer.GetLength( ) ) if ( m_pStream->GetRingBufferFreeSamples( ) >= m_sfReceivingBuffer.GetLength( ) )
m_pStream->Transmit( m_sfReceivingBuffer, m_sfReceivingBuffer.GetLength( ) ); m_pStream->Transmit( m_sfReceivingBuffer, m_sfReceivingBuffer.GetLength( ) );
//else //else
// Fehler // Fehler
break; break;
case CITANetAudioProtocol::NP_SERVER_GET_RINGBUFFER_FREE_SAMPLES: case CITANetAudioProtocol::NP_SERVER_GET_RINGBUFFER_FREE_SAMPLES:
m_pMessage->SetMessageType( CITANetAudioProtocol::NP_CLIENT_SENDING_RINGBUFFER_FREE_SAMPLES ); m_pMessage->SetMessageType( CITANetAudioProtocol::NP_CLIENT_SENDING_RINGBUFFER_FREE_SAMPLES );
m_pMessage->WriteInt( m_pStream->GetRingBufferFreeSamples( ) ); m_pMessage->WriteInt( m_pStream->GetRingBufferFreeSamples( ) );
m_pMessage->WriteMessage( ); m_pMessage->WriteMessage( );
break; break;
case CITANetAudioProtocol::NP_SERVER_CLOSE: case CITANetAudioProtocol::NP_SERVER_CLOSE:
Disconnect( ); Disconnect( );
break; break;
default: default:
vstr::out( ) << "[ITANetAudioStreamingServer] Unkown protocol type : " << iMsgType << std::endl; vstr::out( ) << "[ITANetAudioStreamingServer] Unkown protocol type : " << iMsgType << std::endl;
break; break;
} }
oLog.iChannel = m_pStream->GetNumberOfChannels( ); oLog.iChannel = m_pStream->GetNumberOfChannels( );
oLog.iProtocolStatus = iMsgType; oLog.iProtocolStatus = iMsgType;
oLog.dWorldTimeStamp = ITAClock::getDefaultClock( )->getTime( ); oLog.dWorldTimeStamp = ITAClock::getDefaultClock( )->getTime( );
m_pClientLogger->log( oLog ); m_pClientLogger->log( oLog );
} }
return false; return false;
} }
void CITANetAudioStreamingClient::TriggerBlockIncrement() void CITANetAudioStreamingClient::TriggerBlockIncrement()
{ {
m_oBlockIncrementEvent.SignalEvent(); m_oBlockIncrementEvent.SignalEvent();
} }
bool CITANetAudioStreamingClient::GetIsConnected() const bool CITANetAudioStreamingClient::GetIsConnected() const
{ {
return m_pClient->GetIsConnected(); return m_pClient->GetIsConnected();
} }
void CITANetAudioStreamingClient::Disconnect() void CITANetAudioStreamingClient::Disconnect()
{ {
m_bStopIndicated = true; m_bStopIndicated = true;
StopGently( true ); StopGently( true );
//delete m_pConnection; //delete m_pConnection;
m_pConnection = NULL; m_pConnection = NULL;
m_bStopIndicated = false; m_bStopIndicated = false;
} }
...@@ -72,10 +72,10 @@ vista_install_all_dlls( bin ) ...@@ -72,10 +72,10 @@ vista_install_all_dlls( bin )
set_property( TARGET ITANetAudioTest PROPERTY FOLDER "ITACoreLibs/Tests/ITADataSources/NetAudio" ) set_property( TARGET ITANetAudioTest PROPERTY FOLDER "ITACoreLibs/Tests/ITADataSources/NetAudio" )
if( NOT DEFINED ITA_NETAUDIO_SERVER_WITH_TESTS ) if( NOT DEFINED ITA_NETAUDIO_SERVER_WITH_TESTS )
set( ITA_NETAUDIO_SERVER_WITH_TESTS "default value" CACHE STRING "localhost 12480 44100 1024 2" ) set( ITA_NETAUDIO_SERVER_WITH_TESTS "default value" CACHE STRING "localhost 12480 44100 32 2" )
endif( ) endif( )
if( NOT DEFINED ITA_NETAUDIO_CLIENT_WITH_TESTS ) if( NOT DEFINED ITA_NETAUDIO_CLIENT_WITH_TESTS )
set( ITA_NETAUDIO_CLIENT_WITH_TESTS "default value" CACHE STRING "localhost 12480 44100 1024 2 1024" ) set( ITA_NETAUDIO_CLIENT_WITH_TESTS "default value" CACHE STRING "localhost 12480 44100 32 2 3200" )
endif( ) endif( )
vista_set_target_msvc_arguments( ITANetAudioStreamingPortaudioClientTest ITA_NETAUDIO_CLIENT_WITH_TESTS ) vista_set_target_msvc_arguments( ITANetAudioStreamingPortaudioClientTest ITA_NETAUDIO_CLIENT_WITH_TESTS )
......
...@@ -18,13 +18,6 @@ int main(int argc, char* argv[]) ...@@ -18,13 +18,6 @@ int main(int argc, char* argv[])
if (argc != 7) if (argc != 7)
{ {
cout << "argc = " << argc << endl;
cout << "sServerName = " << argv[1] << endl;
cout << "iServerPort = " << argv[2] << endl;
cout << "dSampleRate = " << argv[3] << endl;
cout << "iBlockLength = " << argv[4] << endl;
cout << "iChannels = " << argv[5] << endl;
cout << "iBufferSize = " << argv[6] << endl;
fprintf(stderr, "Fehler: Syntax = ServerName ServerPort SampleRate BufferSize Channel RingBufferSize!\n"); fprintf(stderr, "Fehler: Syntax = ServerName ServerPort SampleRate BufferSize Channel RingBufferSize!\n");
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
close all; close all;
clear all; clear all;
ChannelVec = [2]; ChannelVec = [2];
BlockSize = '1024'; BlockSize = '32';
NetAudioLogClient = dir(['NetAudioLogClient_BS' BlockSize '*.txt']); NetAudioLogClient = dir(['NetAudioLogClient_BS' BlockSize '*.txt']);
NetAudioLogClient = {NetAudioLogClient.name}; NetAudioLogClient = {NetAudioLogClient.name};
NetAudioLogClientTab = readtable(NetAudioLogClient{1}, 'FileType', 'text', 'Delimiter', '\t'); NetAudioLogClientTab = readtable(NetAudioLogClient{1}, 'FileType', 'text', 'Delimiter', '\t');
......
%% Einlesen der Logs %% Einlesen der Logs
close all; close all;
clear all; clear all;
NetAudioLogNet = readtable( 'NetAudioLogNet_BS1024_Ch2.txt', 'FileType', 'text', 'Delimiter', '\t'); NetAudioLogNet = readtable( 'NetAudioLogNet_BS32_Ch2.txt', 'FileType', 'text', 'Delimiter', '\t');
NetAudioLogStream = readtable( 'NetAudioLogStream_BS1024_Ch2.txt', 'FileType', 'text', 'Delimiter', '\t') NetAudioLogStream = readtable( 'NetAudioLogStream_BS32_Ch2.txt', 'FileType', 'text', 'Delimiter', '\t')
NetAudioLogClient = readtable( 'NetAudioLogClient_BS1024_Ch2.txt', 'FileType', 'text', 'Delimiter', '\t' ); NetAudioLogClient = readtable( 'NetAudioLogClient_BS32_Ch2.txt', 'FileType', 'text', 'Delimiter', '\t' );
NetAudioLogBaseData = readtable( 'NetAudioLogBaseData_BS1024_Ch2.txt', 'FileType', 'text', 'Delimiter', '\t' ); NetAudioLogBaseData = readtable( 'NetAudioLogBaseData_BS32_Ch2.txt', 'FileType', 'text', 'Delimiter', '\t' );
% Save Base Data % Save Base Data
Channel = NetAudioLogBaseData.Channel(1); Channel = NetAudioLogBaseData.Channel(1);
......
%% Einlesen der Logs %% Einlesen der Logs
close all; close all;
clear all; clear all;
BlockSize = '1024'; BlockSize = '32';
NetAudioLogServer = dir(['NetAudioLogServer_BS' BlockSize '*.txt']); NetAudioLogServer = dir(['NetAudioLogServer_BS' BlockSize '*.txt']);
NetAudioLogServer = {NetAudioLogServer.name}; NetAudioLogServer = {NetAudioLogServer.name};
NetAudioLogServerTab = readtable(NetAudioLogServer{1}, 'FileType', 'text', 'Delimiter', '\t'); NetAudioLogServerTab = readtable(NetAudioLogServer{1}, 'FileType', 'text', 'Delimiter', '\t');
...@@ -18,34 +18,51 @@ for k=2:numel(NetAudioLogServer) ...@@ -18,34 +18,51 @@ for k=2:numel(NetAudioLogServer)
end end
NetAudioLogServerTab.WorldTimeStamp = NetAudioLogServerTab.WorldTimeStamp - minTime; NetAudioLogServerTab.WorldTimeStamp = NetAudioLogServerTab.WorldTimeStamp - minTime;
% NetAudioLogClient = dir(['NetAudioLogClient_BS' BlockSize '*.txt']); NetAudioLogClient = dir(['NetAudioLogClient_BS' BlockSize '*.txt']);
% NetAudioLogClient = {NetAudioLogClient.name}; NetAudioLogClient = {NetAudioLogClient.name};
% NetAudioLogClientTab = readtable(NetAudioLogClient{1}, 'FileType', 'text', 'Delimiter', '\t'); NetAudioLogClientTab = readtable(NetAudioLogClient{1}, 'FileType', 'text', 'Delimiter', '\t');
% minTime = NetAudioLogClientTab.WorldTimeStamp(1); minTime = NetAudioLogClientTab.WorldTimeStamp(1);
% maxTime = NetAudioLogClientTab.WorldTimeStamp(end); maxTime = NetAudioLogClientTab.WorldTimeStamp(end);
% for k=2:numel(NetAudioLogClient) for k=2:numel(NetAudioLogClient)
% temp = readtable(NetAudioLogClient{k}, 'FileType', 'text', 'Delimiter', '\t'); temp = readtable(NetAudioLogClient{k}, 'FileType', 'text', 'Delimiter', '\t');
% NetAudioLogClientTab = [NetAudioLogClientTab; temp]; NetAudioLogClientTab = [NetAudioLogClientTab; temp];
% minTime = min(minTime, temp.WorldTimeStamp(1)); minTime = min(minTime, temp.WorldTimeStamp(1));
% maxTime = max(maxTime, temp.WorldTimeStamp(end)); maxTime = max(maxTime, temp.WorldTimeStamp(end));
% end end
%% Protocolstatus ersetzten %% Protocolstatus ersetzten
Protocol = {'100', 'NP_CLIENT_OPEN';... Protocol = {'100', 'NP CLIENT OPEN';...
'101', 'NP_CLIENT_CLOSE';... '101', 'NP CLIENT CLOSE';...
'111', 'NP_CLIENT_SENDING_RINGBUFFER_FREE_SAMPLES';... '111', 'NP CLIENT SENDING RINGBUFFER FREE SAMPLES';...
'200', 'NP_SERVER_OPEN';... '200', 'NP SERVER OPEN';...
'201', 'NP_SERVER_CLOSE';... '201', 'NP SERVER CLOSE';...
'211', 'NP_SERVER_GET_RINGBUFFER_FREE_SAMPLES';... '211', 'NP SERVER GET RINGBUFFER FREE SAMPLES';...
'222', 'NP_SERVER_SENDING_SAMPLES'}; '222', 'NP SERVER SENDING SAMPLES'};
%NumPro = zeros(size(NetAudioLogServerTab.ProtocolStatus)); %NumPro = zeros(size(NetAudioLogServerTab.ProtocolStatus));
for k = (1:size(Protocol,1)) Time100 = NetAudioLogServerTab.WorldTimeStamp(find(NetAudioLogServerTab.ProtocolStatus == 100));
%NumPro( NetAudioLogServerTab.ProtocolStatus == 211) = 'NP_SERVER_GET_RINGBUFFER_FREE_SAMPLES'; Time101 = NetAudioLogServerTab.WorldTimeStamp(find(NetAudioLogServerTab.ProtocolStatus == 101));
end Time111 = NetAudioLogServerTab.WorldTimeStamp(find(NetAudioLogServerTab.ProtocolStatus == 111));
Time200 = NetAudioLogServerTab.WorldTimeStamp(find(NetAudioLogServerTab.ProtocolStatus == 200));
Time201 = NetAudioLogServerTab.WorldTimeStamp(find(NetAudioLogServerTab.ProtocolStatus == 201));
Time211 = NetAudioLogServerTab.WorldTimeStamp(find(NetAudioLogServerTab.ProtocolStatus == 211));
Time222 = NetAudioLogServerTab.WorldTimeStamp(find(NetAudioLogServerTab.ProtocolStatus == 222));
Time = {Time100 Time101 Time111 Time200 Time201 Time211 Time222};
%% Plot Protocol %% Plot Protocol
plot(NetAudioLogServerTab.WorldTimeStamp, NetAudioLogServerTab.ProtocolStatus) %plot(NetAudioLogServerTab.WorldTimeStamp, NetAudioLogServerTab.ProtocolStatus)
hold on; hold on;
%plot(NetAudioLogServerTab.WorldTimeStamp, NetAudioLogServerTab.FreeSamples) plot(NetAudioLogServerTab.WorldTimeStamp, NetAudioLogServerTab.FreeSamples)
legende = {};
legende{1} = 'Freie Samples';
i = 2;
for k = (1:7)
if size(Time{k}, 1) ~= 0
plot(Time{k}, k* 100 * ones(size(Time{k})),'.')
legende{i} = Protocol{k,2};
i = i + 1;
end
end
legend(legende);
legend('show');
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment