Skip to content

Commit

Permalink
Change the bubble text to reflect the status of the ACK bit
Browse files Browse the repository at this point in the history
  • Loading branch information
pierremolinaro committed Sep 4, 2023
1 parent aff390a commit bc1f8d4
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 25 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,39 @@ jobs:
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Build
run: |
cmake -B ${{github.workspace}}/build -A x64
cmake --build ${{github.workspace}}/build --config Release
- name: Upload windows build
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: windows
path: ${{github.workspace}}/build/Analyzers/Release/*.dll
macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Build
run: |
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release
cmake --build ${{github.workspace}}/build
- name: Upload MacOS build
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: macos
path: ${{github.workspace}}/build/Analyzers/*.so
linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Build
run: |
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release
cmake --build ${{github.workspace}}/build
- name: Upload Linux build
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: linux
path: ${{github.workspace}}/build/Analyzers/*.so
Expand All @@ -53,7 +53,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: download individual builds
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
path: ${{github.workspace}}/artifacts
- name: zip
Expand All @@ -68,4 +68,4 @@ jobs:
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: ${{github.workspace}}/analyzer.zip
files: ${{github.workspace}}/analyzer.zip
4 changes: 3 additions & 1 deletion src/CANFDMolinaroAnalyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -581,10 +581,12 @@ void CANFDMolinaroAnalyzer::handle_CRCDEL_state (const bool inBit, U64 & ioBitCe

void CANFDMolinaroAnalyzer::handle_ACK_state (const bool inBit, const U64 inBitCenterSampleNumber) {
mFieldBitIndex ++ ;
U8 u8Acked = 0;
if (mFieldBitIndex == 1) { // ACK SLOT
addMark (inBitCenterSampleNumber, inBit ? AnalyzerResults::ErrorSquare : AnalyzerResults::DownArrow);
mAcked = inBit ;
}else{ // ACK DELIMITER
addBubble (ACK_FIELD_RESULT, 0, 0, inBitCenterSampleNumber) ;
addBubble (ACK_FIELD_RESULT, mAcked, 0, inBitCenterSampleNumber) ;
mFrameFieldEngineState = FrameFieldEngineState::ENDOFFRAME ;
if (inBit) {
addMark (inBitCenterSampleNumber, AnalyzerResults::One) ;
Expand Down
1 change: 1 addition & 0 deletions src/CANFDMolinaroAnalyzer.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ class ANALYZER_EXPORT CANFDMolinaroAnalyzer : public Analyzer2 {
private: FrameType mFrameType ;
private: bool mBRS ;
private: bool mESI ;
private: bool mAcked ;
private: AnalyzerResults::MarkerType mMarkerTypeForDataAndCRC ;

//---------------- CAN decoder methods
Expand Down
35 changes: 19 additions & 16 deletions src/CANFDMolinaroAnalyzerResults.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,11 @@ void CANFDMolinaroAnalyzerResults::GenerateText (const Frame & inFrame,
break ;
case ACK_FIELD_RESULT :
if (inBubbleText) {
ioText << "ACK" ;
if (inFrame.mData1 != 0) {
ioText << "NAK\n" ;
}else{
ioText << "ACK\n" ;
}
}
break ;
case SBC_FIELD_RESULT :
Expand Down Expand Up @@ -174,32 +178,31 @@ void CANFDMolinaroAnalyzerResults::GenerateFrameTabularText (const U64 inFrameIn

//----------------------------------------------------------------------------------------

void CANFDMolinaroAnalyzerResults::GenerateExportFile( const char* file, DisplayBase display_base, U32 export_type_user_id )
{
std::ofstream file_stream( file, std::ios::out );
void CANFDMolinaroAnalyzerResults::GenerateExportFile (const char* file,
DisplayBase display_base,
U32 export_type_user_id) {
std::ofstream file_stream (file, std::ios::out) ;

U64 trigger_sample = mAnalyzer->GetTriggerSample();
U32 sample_rate = mAnalyzer->GetSampleRate();
const U64 trigger_sample = mAnalyzer->GetTriggerSample();
const U32 sample_rate = mAnalyzer->GetSampleRate();

file_stream << "Time [s],Value" << std::endl;

U64 num_frames = GetNumFrames();
for( U32 i=0; i < num_frames; i++ )
{
for(U32 i = 0 ; i < num_frames ; i++) {
Frame frame = GetFrame( i );

char time_str[128];
AnalyzerHelpers::GetTimeString( frame.mStartingSampleInclusive, trigger_sample, sample_rate, time_str, 128 );
char time_str[128] ;
AnalyzerHelpers::GetTimeString (frame.mStartingSampleInclusive, trigger_sample, sample_rate, time_str, 128);

char number_str[128];
AnalyzerHelpers::GetNumberString( frame.mData1, display_base, 8, number_str, 128 );
char number_str[128] ;
AnalyzerHelpers::GetNumberString (frame.mData1, display_base, 8, number_str, 128) ;

file_stream << time_str << "," << number_str << std::endl;

if( UpdateExportProgressAndCheckForCancel( i, num_frames ) == true )
{
file_stream.close();
return;
if (UpdateExportProgressAndCheckForCancel (i, num_frames) == true) {
file_stream.close () ;
return ;
}
}

Expand Down

0 comments on commit bc1f8d4

Please sign in to comment.