mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-15 01:57:39 -05:00
@@ -193,6 +193,11 @@ public class TalkgroupEditor extends DocumentListenerEditor<AliasID>
|
|||||||
{
|
{
|
||||||
Protocol protocol = mComboProtocol.getItemAt(mComboProtocol.getSelectedIndex());
|
Protocol protocol = mComboProtocol.getItemAt(mComboProtocol.getSelectedIndex());
|
||||||
|
|
||||||
|
if(protocol == null)
|
||||||
|
{
|
||||||
|
protocol = Protocol.UNKNOWN;
|
||||||
|
}
|
||||||
|
|
||||||
int value = -1;
|
int value = -1;
|
||||||
|
|
||||||
try
|
try
|
||||||
|
|||||||
@@ -83,6 +83,14 @@ public enum TalkgroupFormat
|
|||||||
return mMaximumValue;
|
return mMaximumValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates if the value is valid for the protocol
|
||||||
|
*/
|
||||||
|
public boolean isValid(int value)
|
||||||
|
{
|
||||||
|
return getMinimumValidValue() <= value && value <= getMaximumValidValue();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Short description of the valid value range
|
* Short description of the valid value range
|
||||||
*/
|
*/
|
||||||
@@ -99,9 +107,14 @@ public enum TalkgroupFormat
|
|||||||
return mValidRangeHelpText;
|
return mValidRangeHelpText;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TalkgroupFormat get(Protocol prococol)
|
public static TalkgroupFormat get(Protocol protocol)
|
||||||
{
|
{
|
||||||
switch(prococol)
|
if(protocol == null)
|
||||||
|
{
|
||||||
|
return UNKNOWN;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch(protocol)
|
||||||
{
|
{
|
||||||
case APCO25:
|
case APCO25:
|
||||||
return APCO25;
|
return APCO25;
|
||||||
|
|||||||
@@ -174,6 +174,8 @@ public class TalkgroupRangeEditor extends DocumentListenerEditor<AliasID>
|
|||||||
|
|
||||||
TalkgroupRange talkgroupRange = getTalkgroupRange();
|
TalkgroupRange talkgroupRange = getTalkgroupRange();
|
||||||
|
|
||||||
|
updateEditor(talkgroupRange.getProtocol());
|
||||||
|
|
||||||
if(talkgroupRange != null)
|
if(talkgroupRange != null)
|
||||||
{
|
{
|
||||||
mComboProtocol.getModel().setSelectedItem(talkgroupRange.getProtocol());
|
mComboProtocol.getModel().setSelectedItem(talkgroupRange.getProtocol());
|
||||||
@@ -202,6 +204,12 @@ public class TalkgroupRangeEditor extends DocumentListenerEditor<AliasID>
|
|||||||
if(talkgroupRange != null)
|
if(talkgroupRange != null)
|
||||||
{
|
{
|
||||||
Protocol protocol = mComboProtocol.getItemAt(mComboProtocol.getSelectedIndex());
|
Protocol protocol = mComboProtocol.getItemAt(mComboProtocol.getSelectedIndex());
|
||||||
|
|
||||||
|
if(protocol == null)
|
||||||
|
{
|
||||||
|
protocol = Protocol.UNKNOWN;
|
||||||
|
}
|
||||||
|
|
||||||
talkgroupRange.setProtocol(protocol);
|
talkgroupRange.setProtocol(protocol);
|
||||||
|
|
||||||
int minValue = -1;
|
int minValue = -1;
|
||||||
|
|||||||
Reference in New Issue
Block a user