Skip to content

Commit

Permalink
#1824 Adds diagnostic report generation to File>>Reports menu to log …
Browse files Browse the repository at this point in the history
…thread dumps and generate a processing diagnostic/status report.
  • Loading branch information
Dennis Sheirer committed Feb 9, 2024
1 parent 7b9adc1 commit ecf3b69
Show file tree
Hide file tree
Showing 17 changed files with 96 additions and 261 deletions.
@@ -1,23 +1,20 @@
/*
* *****************************************************************************
* Copyright (C) 2014-2024 Dennis Sheirer
*
* * ******************************************************************************
* * Copyright (C) 2014-2019 Dennis Sheirer
* *
* * This program is free software: you can redistribute it and/or modify
* * it under the terms of the GNU General Public License as published by
* * the Free Software Foundation, either version 3 of the License, or
* * (at your option) any later version.
* *
* * This program is distributed in the hope that it will be useful,
* * but WITHOUT ANY WARRANTY; without even the implied warranty of
* * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* * GNU General Public License for more details.
* *
* * You should have received a copy of the GNU General Public License
* * along with this program. If not, see <http://www.gnu.org/licenses/>
* * *****************************************************************************
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
* ****************************************************************************
*/

package io.github.dsheirer.channel.state;
Expand Down Expand Up @@ -47,9 +44,37 @@ public abstract class AbstractDecoderState extends Module implements ActivitySum
protected Broadcaster<IDecodeEvent> mDecodeEventBroadcaster = new Broadcaster<>();
protected Listener<DecoderStateEvent> mDecoderStateListener;
private DecoderStateEventListener mDecoderStateEventListener = new DecoderStateEventListener();
private boolean mRunning;

public abstract DecoderType getDecoderType();

/**
* Implements module start and sets the mRunning flag to true so that messages can be processed.
*/
@Override
public void start()
{
mRunning = true;
}

/**
* Implements the module stop and sets the mRunning flag to false to stop message processing
*/
@Override
public void stop()
{
mRunning = false;
}

/**
* Indicates if this module is running and can process/pass messages down to sub-class implementations.
* @return true if running
*/
public boolean isRunning()
{
return mRunning;
}

/**
* Provides subclass reference to the decode event broadcaster
*/
Expand Down Expand Up @@ -145,4 +170,22 @@ public void receive(DecoderStateEvent event)
}
}

/**
* Message listener that only passes messages while we're running. This is important because each of the decoders
* can process blocks of samples and that can result in additional messages being generated even after shutdown
* and so we shut off the processing of decoded messages when we're commanded to stop. The sample processing thread
* cannot be shutdown or forcefully interrupted because downstream decoder and channel states may have acquired
* locks that have to be properly released.
*/
private class MessageListener implements Listener<IMessage>
{
@Override
public void receive(IMessage message)
{
if(isRunning())
{
receive(message);
}
}
}
}

This file was deleted.

@@ -1,6 +1,6 @@
/*
* *****************************************************************************
* Copyright (C) 2014-2022 Dennis Sheirer
* Copyright (C) 2014-2024 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -54,6 +54,7 @@ public DecoderState()
@Override
public void start()
{
super.start();
//Broadcast the existing identifiers (as add events) so that they can be received by external listeners
mIdentifierCollection.broadcastIdentifiers();
}
Expand Down
@@ -1,6 +1,6 @@
/*
* *****************************************************************************
* Copyright (C) 2014-2023 Dennis Sheirer
* Copyright (C) 2014-2024 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -145,11 +145,10 @@ private void endCallEvent()
@Override
public void start()
{
super.start();
getIdentifierCollection().update(getChannelNameIdentifier());
}

@Override
public void stop() {}
@Override
public void init() {}
@Override
Expand Down
@@ -1,6 +1,6 @@
/*
* *****************************************************************************
* Copyright (C) 2014-2023 Dennis Sheirer
* Copyright (C) 2014-2024 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -115,9 +115,4 @@ public String getActivitySummary()
public void init()
{
}

@Override
public void stop()
{
}
}
Expand Up @@ -1472,6 +1472,8 @@ public void receiveDecoderStateEvent(DecoderStateEvent event)
@Override
public void start()
{
super.start();

//Change the default (45-second) traffic channel timeout to 1 second
if(mChannel.isTrafficChannel())
{
Expand All @@ -1483,9 +1485,4 @@ public void start()
public void init()
{
}

@Override
public void stop()
{
}
}
@@ -1,6 +1,6 @@
/*
* *****************************************************************************
* Copyright (C) 2014-2023 Dennis Sheirer
* Copyright (C) 2014-2024 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -53,20 +53,7 @@ public DecoderType getDecoderType()
}

@Override
public void start()
{
}

@Override
public void stop()
{
}

@Override
public void init()
{

}
public void init() {}

@Override
public void receive(IMessage message)
Expand Down
@@ -1,6 +1,6 @@
/*
* *****************************************************************************
* Copyright (C) 2014-2023 Dennis Sheirer
* Copyright (C) 2014-2024 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -150,20 +150,5 @@ public void reset()
}

@Override
public void start()
{

}

@Override
public void stop()
{

}

@Override
public void init()
{

}
public void init() {}
}
@@ -1,6 +1,6 @@
/*
* *****************************************************************************
* Copyright (C) 2014-2023 Dennis Sheirer
* Copyright (C) 2014-2024 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -586,19 +586,7 @@ public String getActivitySummary()
}

@Override
public void start()
{
}

@Override
public void stop()
{
}

@Override
public void init()
{
}
public void init() {}

/**
* Resets the decoder state after a call or other decode event
Expand Down
@@ -1,6 +1,6 @@
/*
* *****************************************************************************
* Copyright (C) 2014-2023 Dennis Sheirer
* Copyright (C) 2014-2024 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -153,19 +153,7 @@ public void reset()
}

@Override
public void start()
{
}

@Override
public void stop()
{
}

@Override
public void init()
{
}
public void init() {}

/**
* Performs a temporal reset following a call or other decode event
Expand Down

0 comments on commit ecf3b69

Please sign in to comment.