Skip to content

Commit bc1f8d4

Browse files
Change the bubble text to reflect the status of the ACK bit
1 parent aff390a commit bc1f8d4

File tree

4 files changed

+31
-25
lines changed

4 files changed

+31
-25
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,39 +12,39 @@ jobs:
1212
windows:
1313
runs-on: windows-latest
1414
steps:
15-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v3
1616
- name: Build
1717
run: |
1818
cmake -B ${{github.workspace}}/build -A x64
1919
cmake --build ${{github.workspace}}/build --config Release
2020
- name: Upload windows build
21-
uses: actions/upload-artifact@v2
21+
uses: actions/upload-artifact@v3
2222
with:
2323
name: windows
2424
path: ${{github.workspace}}/build/Analyzers/Release/*.dll
2525
macos:
2626
runs-on: macos-latest
2727
steps:
28-
- uses: actions/checkout@v2
28+
- uses: actions/checkout@v3
2929
- name: Build
3030
run: |
3131
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release
3232
cmake --build ${{github.workspace}}/build
3333
- name: Upload MacOS build
34-
uses: actions/upload-artifact@v2
34+
uses: actions/upload-artifact@v3
3535
with:
3636
name: macos
3737
path: ${{github.workspace}}/build/Analyzers/*.so
3838
linux:
3939
runs-on: ubuntu-latest
4040
steps:
41-
- uses: actions/checkout@v2
41+
- uses: actions/checkout@v3
4242
- name: Build
4343
run: |
4444
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release
4545
cmake --build ${{github.workspace}}/build
4646
- name: Upload Linux build
47-
uses: actions/upload-artifact@v2
47+
uses: actions/upload-artifact@v3
4848
with:
4949
name: linux
5050
path: ${{github.workspace}}/build/Analyzers/*.so
@@ -53,7 +53,7 @@ jobs:
5353
runs-on: ubuntu-latest
5454
steps:
5555
- name: download individual builds
56-
uses: actions/download-artifact@v2
56+
uses: actions/download-artifact@v3
5757
with:
5858
path: ${{github.workspace}}/artifacts
5959
- name: zip
@@ -68,4 +68,4 @@ jobs:
6868
uses: softprops/action-gh-release@v1
6969
if: startsWith(github.ref, 'refs/tags/')
7070
with:
71-
files: ${{github.workspace}}/analyzer.zip
71+
files: ${{github.workspace}}/analyzer.zip

src/CANFDMolinaroAnalyzer.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,10 +581,12 @@ void CANFDMolinaroAnalyzer::handle_CRCDEL_state (const bool inBit, U64 & ioBitCe
581581

582582
void CANFDMolinaroAnalyzer::handle_ACK_state (const bool inBit, const U64 inBitCenterSampleNumber) {
583583
mFieldBitIndex ++ ;
584+
U8 u8Acked = 0;
584585
if (mFieldBitIndex == 1) { // ACK SLOT
585586
addMark (inBitCenterSampleNumber, inBit ? AnalyzerResults::ErrorSquare : AnalyzerResults::DownArrow);
587+
mAcked = inBit ;
586588
}else{ // ACK DELIMITER
587-
addBubble (ACK_FIELD_RESULT, 0, 0, inBitCenterSampleNumber) ;
589+
addBubble (ACK_FIELD_RESULT, mAcked, 0, inBitCenterSampleNumber) ;
588590
mFrameFieldEngineState = FrameFieldEngineState::ENDOFFRAME ;
589591
if (inBit) {
590592
addMark (inBitCenterSampleNumber, AnalyzerResults::One) ;

src/CANFDMolinaroAnalyzer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ class ANALYZER_EXPORT CANFDMolinaroAnalyzer : public Analyzer2 {
8080
private: FrameType mFrameType ;
8181
private: bool mBRS ;
8282
private: bool mESI ;
83+
private: bool mAcked ;
8384
private: AnalyzerResults::MarkerType mMarkerTypeForDataAndCRC ;
8485

8586
//---------------- CAN decoder methods

src/CANFDMolinaroAnalyzerResults.cpp

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,11 @@ void CANFDMolinaroAnalyzerResults::GenerateText (const Frame & inFrame,
107107
break ;
108108
case ACK_FIELD_RESULT :
109109
if (inBubbleText) {
110-
ioText << "ACK" ;
110+
if (inFrame.mData1 != 0) {
111+
ioText << "NAK\n" ;
112+
}else{
113+
ioText << "ACK\n" ;
114+
}
111115
}
112116
break ;
113117
case SBC_FIELD_RESULT :
@@ -174,32 +178,31 @@ void CANFDMolinaroAnalyzerResults::GenerateFrameTabularText (const U64 inFrameIn
174178

175179
//----------------------------------------------------------------------------------------
176180

177-
void CANFDMolinaroAnalyzerResults::GenerateExportFile( const char* file, DisplayBase display_base, U32 export_type_user_id )
178-
{
179-
std::ofstream file_stream( file, std::ios::out );
181+
void CANFDMolinaroAnalyzerResults::GenerateExportFile (const char* file,
182+
DisplayBase display_base,
183+
U32 export_type_user_id) {
184+
std::ofstream file_stream (file, std::ios::out) ;
180185

181-
U64 trigger_sample = mAnalyzer->GetTriggerSample();
182-
U32 sample_rate = mAnalyzer->GetSampleRate();
186+
const U64 trigger_sample = mAnalyzer->GetTriggerSample();
187+
const U32 sample_rate = mAnalyzer->GetSampleRate();
183188

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

186191
U64 num_frames = GetNumFrames();
187-
for( U32 i=0; i < num_frames; i++ )
188-
{
192+
for(U32 i = 0 ; i < num_frames ; i++) {
189193
Frame frame = GetFrame( i );
190194

191-
char time_str[128];
192-
AnalyzerHelpers::GetTimeString( frame.mStartingSampleInclusive, trigger_sample, sample_rate, time_str, 128 );
195+
char time_str[128] ;
196+
AnalyzerHelpers::GetTimeString (frame.mStartingSampleInclusive, trigger_sample, sample_rate, time_str, 128);
193197

194-
char number_str[128];
195-
AnalyzerHelpers::GetNumberString( frame.mData1, display_base, 8, number_str, 128 );
198+
char number_str[128] ;
199+
AnalyzerHelpers::GetNumberString (frame.mData1, display_base, 8, number_str, 128) ;
196200

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

199-
if( UpdateExportProgressAndCheckForCancel( i, num_frames ) == true )
200-
{
201-
file_stream.close();
202-
return;
203+
if (UpdateExportProgressAndCheckForCancel (i, num_frames) == true) {
204+
file_stream.close () ;
205+
return ;
203206
}
204207
}
205208

0 commit comments

Comments
 (0)