Compare commits

..

393 Commits

Author SHA1 Message Date
Denny
336669f1d5 Updates build version to 0.3.3 beta 3 2018-01-01 07:26:42 -05:00
Denny Sheirer
46cf7f4193 Merge pull request #309 from DSheirer/308-icon-manager-npe
308 IconManager throws NPE when loading external icons
2018-01-01 07:25:29 -05:00
Denny
e9aeb09011 Resolves issues with NPE handling and loading external icons. 2018-01-01 07:24:37 -05:00
Denny
c7f00ea124 Updates version to 0.3.3 beta 2 2017-12-26 07:19:06 -05:00
Denny Sheirer
1759f4a804 Merge pull request #306 from DSheirer/305-gradle-icons-missing
305 Icons missing from gradle build
2017-12-26 07:17:12 -05:00
Denny
3d9044802e Resolves issue with including icons in gradle build product. Updates
all icon handling code to use absolute path for bundled icons.
2017-12-26 07:13:15 -05:00
Denny
42aec490bd Updates build version and changelog. 2017-12-25 07:42:56 -05:00
Denny Sheirer
c3f5c1c70e Merge pull request #303 from DSheirer/278-wave-metadata
278 Add Metadata to WAV audio recordings
2017-12-25 07:17:08 -05:00
Denny
188a521770 Adds wave file ID3 metadata chunk to audio recordings.
Updates wave writer to add the metadata LIST and ID3 chunks to the end
of the recording so that the file contains the final/complete set of
metadata that was accumulated over the call lifecycle.
2017-12-25 07:08:55 -05:00
Denny
6e352143d2 Adds wave file LIST metadata chunk to audio recordings.
Note: the metadata chunk may be added multiple times over the life span
of an audio call, as additional metadata details are added.
2017-12-24 06:51:09 -05:00
Denny Sheirer
7391265949 Merge pull request #302 from DSheirer/tsypuk-SDR-build
Gradle Build System
2017-12-21 20:55:44 -05:00
Denny
26b97f09b7 Updates SettingsManager to use jackson xml serialization. Final
testing on all changes to xml serialization.
2017-12-21 19:59:11 -05:00
Denny
1d2d9e8630 Updates IconManager to use faster jackson XML serialization. 2017-12-21 13:42:03 -05:00
Denny
ee6aeafa84 Updates PlaylistManager to use faster jackson XML serialization.
Removes native xml.bind serialization for improved compatibility with
 Java 9.

 Global optimize imports on the entire project.
2017-12-21 07:18:27 -05:00
Denny
47cc194415 Resolves issue with runtime exception when identifying application
version string from jar manifest
2017-12-17 07:34:47 -05:00
Denny
9316599dec Updates pull request from Roman Tsypuk to convert the build system from
ant to gradle.  Removes linux and windows application launch scripts and
produces an executable jar with all resources included.
2017-12-17 07:28:06 -05:00
Roman Tsypuk
a1535c4157 updated README, gitignore, moved styles 2017-12-16 11:12:59 +02:00
Roman Tsypuk
b478068475 - cosmetics naming changes 2017-12-16 10:44:54 +02:00
Roman Tsypuk
7286c978da updated gitignore 2017-12-16 10:36:04 +02:00
Roman Tsypuk
628d514462 - updated to current version 2017-12-16 01:05:07 +02:00
Roman Tsypuk
3478702845 - removed scripts 2017-12-16 01:04:14 +02:00
Roman Tsypuk
695d622603 - added fatJar task 2017-12-16 00:57:44 +02:00
Roman Tsypuk
e8e47bfb40 - moved to package in.ua.smartjava 2017-12-16 00:56:22 +02:00
Roman Tsypuk
c1a4425969 - cleanup 2017-12-16 00:27:12 +02:00
Roman Tsypuk
4fa1a1aa81 - moved dependencies to gradle 2017-12-16 00:23:12 +02:00
Roman Tsypuk
4e1f9bcf97 - moved dependencies lib4java to gradle 2017-12-16 00:09:43 +02:00
Roman Tsypuk
50bb96b14a - moved dependencies to gradle 2017-12-16 00:01:23 +02:00
Roman Tsypuk
51ea70f279 moved resource files 2017-12-15 23:57:27 +02:00
Roman Tsypuk
e15f271a54 - moved dependencies to gradle 2017-12-15 23:56:28 +02:00
Roman Tsypuk
605475c98b - moved dependencies to gradle 2017-12-15 23:38:22 +02:00
Roman Tsypuk
86248c511a updated gitignore 2017-12-15 23:23:42 +02:00
Roman Tsypuk
b1e07f762c fix src folder structure 2017-12-15 23:22:32 +02:00
Roman Tsypuk
f2d1ac7e48 - commons moved to gradle 2017-12-15 22:56:38 +02:00
Roman Tsypuk
d114282e4b added dependencies from import folder 2017-12-15 22:53:33 +02:00
Roman Tsypuk
0fd20655fa - added gradle wrapper 2017-12-15 22:52:42 +02:00
Roman Tsypuk
181527f54c - added gradle build 2017-12-15 22:45:40 +02:00
Roman Tsypuk
910587bad7 - updated gitignore 2017-12-15 22:44:29 +02:00
Denny Sheirer
1dc9a7fb0e Merge pull request #300 from DSheirer/299-traffic-channel-event-logging
299 Traffic Channel Event Logging
2017-12-11 21:08:09 -05:00
Denny
eef29d28da #299 - adds support for traffic channel event logging of binary or
decoded messages and event logging, as inherited from the parent
control channel's configuration.
2017-12-11 21:07:30 -05:00
Denny Sheirer
a3ecb339be Merge pull request #294 from DSheirer/241-lj1200-crc-error-checking
241 LJ1200 Error Correction
2017-12-02 03:16:29 -05:00
Denny
910a08f7bb #241 Resolves issue with error correction routine introducing invalid messages 2017-12-02 03:15:31 -05:00
Denny
5a76f31dea Updated change log 2017-11-23 07:37:53 -05:00
Denny Sheirer
1b42e64f50 Merge pull request #290 from DSheirer/289-shoutcast-2-credentials-encryption-error
289 Shoutcast 2 Login Error
2017-11-23 07:30:45 -05:00
Denny
1ddc0a33a5 #289 resolves issue with encrypting username and password with XTEA
algorithm using credential values longer than 8 characters/bytes.
2017-11-23 07:28:15 -05:00
Denny Sheirer
88580af436 Merge pull request #284 from DSheirer/283-broadcastify-text-html-response
283 Broadcastify mount point in use error
2017-11-04 13:31:40 +00:00
Denny
64688a3c20 Updates CHANGELOG 2017-11-04 09:07:46 -04:00
Denny
8be3399a6b Issue #283
Updates Icecast TCP broadcaster to correctly handle content type:text/html
message that normally follows mount point in use error received from
broadcastify.

Changes mount point in use broadcast state to be a temporary error so that
the stream will attempt to reconnect after receiving this error.

Updates logging to include memory allocation/usage metrics with each
logging entry in order to support debugging issues related to high
memory usage situations.  Updates initial application logging to better
identify the host system operating environment.
2017-11-04 09:02:03 -04:00
Denny Sheirer
28340809ca Merge pull request #279 from DSheirer/276-traffic-channel-manager-deadlocked-threads
276 TrafficController Infinite Loop
2017-10-21 09:43:42 -04:00
Denny
f3d3a8187a Resolves #276 Traffic Channel threads locking in overflow state. Issue
occured when the ChannelProcessionManager was allocating a new channel
causing the tuner to invoke the updateLOFrequency() method that was
trying to find a center tune frequency that would accommodate all of the
channels, specifically in the instance where the distance between the
highest channel and the middle channel was exactly one-half of the
tuner's bandwidth.  This situation would cause the calculated adjustment
to be zero and would cause an infinite loop, locking all channels from
accessing the any channel startup/teardown events and causing running
channels to block with buffer overflows. Added 1 to the adjustment to
ensure that the initial adjustment placed the center overlapping channel
fully to the left of the center DC spike so that on the next iteration
that channel would no longer be overlapping.
2017-10-21 09:31:34 -04:00
Denny Sheirer
8484e837b8 Merge pull request #277 from DSheirer/273-gui-title-version
273 Application Title Version String
2017-10-16 19:38:15 -04:00
Denny
01b188ea25 Resolves #273 issue with dangling dash in application title version string. 2017-10-16 19:37:11 -04:00
Denny Sheirer
108691dc3c Merge pull request #274 from DSheirer/272-java-9-compatibility
272 java 9 compatibility
2017-10-09 12:40:04 -04:00
Denny
455aa97286 Updates build number to 'final' 2017-10-09 12:35:28 -04:00
Denny
d608834214 Resolves #272. Updates the windows launch script to perform conditional
launching based on the JRE version 8 or 9.
2017-10-09 16:33:58 +00:00
Denny
41660e1881 Updates the build number to 0.3.1 for the next patch release
Updates the build script for conditional compilation using either Java
8 or Java 9 options.  Java 9 deprecated the java.xml.bind package and
removed it as a default Java SE package, so we have to reference it via
the --add-modules argument.

Updates the linux/mac launch script to check the java runtime version
and use either a Java 8 or Java 9 launch command.
2017-10-08 09:00:10 -04:00
Denny Sheirer
110ccb158c Update README.md
Removed Version 0.2.0 user manual link
2017-09-22 06:16:34 -04:00
Denny
64ccacf04a Releasing Version 0.3.0 (final). 2017-09-22 05:56:27 -04:00
Denny Sheirer
f00b9555fe Merge pull request #271 from DSheirer/269-viterbi-3-4-rate
269 Viterbi decoder for DMR 3/4-rate packet messages
2017-09-15 11:50:19 -04:00
Denny
85442a9648 Resolves #269 - creates a generic Viterbi decoder and a Digital Mobile Radio (DMR) 3/4 Rate Viterbi decoder implementation for decoding Trellis Coded Modulation (TCM) encoded DMR Data packets. 2017-09-15 11:40:23 -04:00
Denny Sheirer
c67a0b329d Merge pull request #267 from DSheirer/266-licence-directory
266 Update build script to use gitlab license file
2017-09-10 04:55:57 -04:00
Denny
8035d64fcd Resolves #266 - updates build script to use new gitlab license file and
removes previous license file.
2017-09-10 04:54:26 -04:00
Denny Sheirer
df2a061a08 Create LICENSE 2017-08-28 19:51:13 -04:00
Denny
e430319937 Updates build to 0.3.0 Beta 14 2017-08-19 07:15:57 -04:00
Denny Sheirer
724f769771 Merge pull request #262 from DSheirer/260-icecast-stream-doesn't-reconnect
260 - Icecast and Shoutcast streaming doesn't auto-reconnect
2017-08-19 07:14:55 -04:00
Denny
c196cfebed Resolves issue #260 - applies changes to Shoutcast V1 and v2 that were
applied to the Icecast streamer for issue releated to reconnecting.
2017-08-19 07:13:08 -04:00
Denny
e80b5866d4 Resolves issue #260 where audio streaming was not re-connecting after a
disconnect.
2017-08-18 20:07:53 -04:00
Denny
c8994d5593 Updates build to version 0.3.0 Beta 13 2017-07-22 05:45:36 -04:00
Denny Sheirer
99ef57c90f Merge pull request #255 from DSheirer/249-overflow-teardown-lockup
249 Channel TEARDOWN/OVERFLOW state lockup
2017-07-22 05:44:12 -04:00
Denny
be62ae0459 Resolves #249 - removes the state monitor runnable from the channel
state and replaces it with a processing chain heartbeat that is generated
by the sample source.

Previously, the state monitor was running on a separate thread and this
was causing multi-threading issues.  With this update, all channel state
operations (and all module operations) occur on the source's buffer
processing thread.
2017-07-22 05:42:13 -04:00
Denny Sheirer
b9be6f43e0 Merge pull request #253 from DSheirer/252-usb-transfer-processor-bad-logging
252 USB transfer processor erroneous logging and performance enhancements
2017-07-09 12:29:21 +00:00
Denny
d5ad3f807d Resolves issue where the tuner's buffer processor is logging that an overflow state has been cleared, caused by a clearing of the buffer when the tuner is being shutdown because there are no more channel consumers registered on the tuner.
Tweaked buffer size limits and buffer handling to attempt to avoid overflow situations in the first place.

Resolved an issue where the tuner processor was not deregistering correctly from the LIBUSB tuner processor during tuner shutdown.
2017-07-09 08:21:07 -04:00
Denny Sheirer
d85ebd018d Merge pull request #251 from DSheirer/250-state-monitor-throwable
StateMonitor - try/catch for Throwables
2017-07-01 11:39:21 +00:00
Denny
ab4e31ae00 Ensures that any leftover cached LDU1 message is reset when the call ends. 2017-07-01 07:36:55 -04:00
Denny
5efd89632e Ensures that any leftover cached LDU1 message is reset when the call ends. 2017-05-28 07:30:05 -04:00
Denny
1dc3863489 Updates build to 0.3.0 Beta 12 2017-05-28 07:22:43 -04:00
Denny Sheirer
441286ba13 Merge pull request #247 from DSheirer/244-ldu1-encryption-flag
244 Prevent P25 Encrypted Audio Decoding/Playback
2017-05-28 11:20:20 +00:00
Denny
e4323df347 Resolves issue #244 - updates the P25 IMBE audio module to correctly
detect encrypted audio state so that encrypted audio is not (incorrectly)
decoded and played back to the user.

Processes HDU and LDU2 messages to identify encrypted call state.  Once
established, all subsequent LDU1/2 messages are decoded only if the call
is unencrypted.  If an LDU1 message is received out-of-sequence, meaning
that the initial HDU message was missed, then the LDU1 is cached until
we receive an LDU2 message and correctly determine the call encryption
state.
2017-05-28 07:17:09 -04:00
Denny
a872e0d664 Updates version to Beta 0.3.0 Beta 11 2017-05-20 07:24:27 -04:00
Denny Sheirer
fbc92cfe31 Merge pull request #246 from DSheirer/245-sound-card-source-issue
Using sound card or mixer as a source throws an error
2017-05-20 10:55:23 +00:00
Denny
1a432197ac Resolves #245 issue with NPE for frequency change event listener when using the sound card/mixer as a source. 2017-05-20 06:51:53 -04:00
Denny
fbc6e508bd Increments build to 0.3.0-beta10 2017-04-14 07:46:18 -04:00
Denny Sheirer
f9b6e67b00 Merge pull request #240 from DSheirer/234-long-alias-names-cause-audio-label-to-wrap
Long alias names cause audio label to wrap
2017-03-31 01:13:17 +00:00
Denny
a628800a71 Resolves #234 - updates the miglayout layout manager to allow jlabel text strings to be automatically truncated (with ellipses) when the alias name is too long. 2017-03-30 21:12:06 -04:00
Denny
25f71a76c4 Resolves #234 - hard codes alias name truncation when name exceeds 33 characters in length. 2017-03-30 20:03:48 -04:00
Denny
5fe8ccd478 Resolves #234 - change the order of assigning an icon and alias text to the audio panel in an attempt to prevent the audio channel panel from wrapping to the next line when the text is too long to display. 2017-03-30 19:52:35 -04:00
Denny Sheirer
069f951a86 Merge pull request #239 from DSheirer/228-traffic-channel-allocation-for-do-not-monitor
Traffic channel manager now allocates traffic channels for do not monitor aliases
2017-03-30 23:27:38 +00:00
Denny
dab6df7836 Resolves #228 - traffic channel manager now allocates traffic channels even when the alias is marked as do not monitor 2017-03-30 19:26:35 -04:00
Denny Sheirer
89da46b63c Merge pull request #238 from DSheirer/235-lojack-decoder-error-on-construction
Resolves error on constructing a LoJack decoder state.
2017-03-30 23:19:29 +00:00
Denny
5f2ce2a9f2 Resolves #235 - fixes error on constructing a LoJack decoder state. 2017-03-30 19:18:39 -04:00
Denny Sheirer
7a0b377971 Merge pull request #232 from DSheirer/229-p25-phase2-event-duplicates
Resolves #229 - duplicate P25 TDMA call events.
2017-03-23 21:52:47 +00:00
Denny
5dbe0ecce3 Resolves #229 - duplicate P25 TDMA call events. 2017-03-23 21:48:52 +00:00
Denny Sheirer
6647c581a6 Merge pull request #231 from DSheirer/230-p25-tdma-frequency-bands
P25 Phase II TDMA frequency bands are now displayed in details summary
2017-03-23 21:01:58 +00:00
Denny
a2ab5bfa95 Resolves #230 - P25 Phase II TDMA frequency bands are now displayed in the channel details summary. 2017-03-23 20:55:42 +00:00
Denny
ed486440b8 Merge remote-tracking branch 'origin/master' 2017-03-12 11:33:17 -04:00
Denny
13464e01fc Updates build to 0.3.0 Beta 9 2017-03-12 11:33:04 -04:00
Denny Sheirer
ea46a8b0e8 Merge pull request #225 from DSheirer/222-spectral-display-of-frequency-correction-offset
Frequency change event handling in the processing chain
2017-03-11 17:03:34 +00:00
Denny
d510c34356 Adds frequency change event listener handler to LSM decoder. 2017-03-11 12:01:45 -05:00
Denny
ae8a44caed Removes cic cleanup filter from processing chain. 2017-03-11 11:53:12 -05:00
Denny
1aa85a86ca Resolves issue with channel frequency correction events not being broadcast within the processing chain and rendering in the spectral display. 2017-03-11 10:16:08 -05:00
Denny Sheirer
17539d4d55 Merge pull request #224 from DSheirer/223-now-playing-frequency-format
Now Playing frequency display formatting
2017-03-11 11:14:58 +00:00
Denny
1db1d28390 Resolves issue with frequency display formating in the Now Playing window. 2017-03-11 06:13:59 -05:00
Denny Sheirer
37a941e904 Merge pull request #219 from DSheirer/218-audio-priority-
Resolves issue with audio playback allowing higher priority audio to preempt lower priority audio
2017-03-05 12:34:09 +00:00
Denny
57f6655824 Resolves issue where higher priority audio was not preempting lower priority audio. 2017-03-05 07:32:42 -05:00
Denny Sheirer
4cd8f8209f Merge pull request #216 from DSheirer/215-audio-recording-handles-part-2
215 audio recording handles part 2
2017-03-03 15:49:24 +00:00
Denny
61bfef5798 Incrementing build to version 0.3.0 beta8 2017-03-03 10:44:50 -05:00
Denny
ef172a04c6 Cleanup - removed synchronized blocks since the buffer processor thread is the only thread managing recorders. 2017-03-03 10:04:21 -05:00
Denny
a877afcceb Updates buffer processing in recorder manager so that we're not blocking any of the decoding channel producer threads that are trying to push audio packets to the recorder manager. Adds an overflowable packet queue and services the queue once a second followed by an idle recorder check (and disposal). 2017-03-03 10:01:32 -05:00
Denny
980ad72d4d Incrementing build to 0.3.0 beta7 2017-03-03 06:01:09 -05:00
Denny Sheirer
9b746cc032 Merge pull request #215 from DSheirer/198-audio-recorder-handles-left-open
Resolves issue audio recorders left open
2017-03-03 10:58:08 +00:00
Denny
f51ae0b5da Resolves issue with periodic instances of audio recorders not being shutdown correctly. Adds recorder monitor as a fail-safe to automatically shutdown recorders that don't receive an end-call indication. 2017-03-03 05:56:32 -05:00
Denny Sheirer
561078e9bf Merge pull request #214 from DSheirer/210-playlist-saving-all-times
Resolves issue with the playlist saving all of the time
2017-03-03 00:34:25 +00:00
Denny
e052b01f9b Resolves issue with the playlist saving all of the time due to audio streaming broadcast events. 2017-03-02 19:33:10 -05:00
Denny
09cf4fcfd7 Resolves issue with empty string list models in channel editor 2017-02-26 10:29:14 -05:00
Denny
5e731d0e9f Resolves issue with alias list and group combo box value editing. 2017-02-26 06:51:58 -05:00
Denny Sheirer
670a02b0ba Merge pull request #209 from DSheirer/153-cursor-frequency-artifacts
Resolves issue with spectral display rendering artifacts
2017-02-26 10:48:59 +00:00
Denny
9ef156b061 Resolves issue with spectral display rendering artifacts from cursor frequency readout when accessing menu items directly above the spectral display. 2017-02-26 05:47:26 -05:00
Denny
d9cf1b19f3 Removes assert() usage throughout project and replaces with Validate from apache commons. 2017-02-25 16:03:35 -05:00
Denny
a4a339b505 Resolves issue with FCD2 tuner frequency. 2017-02-25 14:58:51 -05:00
Denny
119370c46e Resolves issue with FCD2 tuner frequency. 2017-02-25 14:57:25 -05:00
Denny
4eb66e6045 Updated readme file with screen shot and link to new Version 0.3.0 user's manual. 2017-02-25 06:18:59 -05:00
Denny Sheirer
8827ecd0e9 Merge pull request #207 from DSheirer/206-alias-list-npe-null-list-name
206 alias list npe null list name
2017-02-24 10:25:29 +00:00
Denny
8660002f93 Incrementing build to beta 6 2017-02-24 05:24:38 -05:00
Denny
2058fcbc1d Resolves issue #206 - alias list throws NPE on aliases that don't have a list name specified. 2017-02-24 05:23:48 -05:00
Denny
9515dfa380 Incrementing build for 0.3.0 beta #5 2017-02-20 20:25:43 -05:00
Denny
9e9a604c6a Merge remote-tracking branch 'origin/master' 2017-02-20 20:20:11 -05:00
Denny
234e313b7a Resolves issue with Null Pointer exception in alias list 2017-02-20 20:19:47 -05:00
Denny Sheirer
e1e7169029 Merge pull request #203 from DSheirer/199-utf8-encoding-of-metadata
Resolves issue with UTF-8 encoding of Shoutcast 2 metadata updates.
2017-02-17 23:09:10 +00:00
Denny
f3605db0ed Resolves issue where metadata is UTF-8 URL encoded versus UTF-8 String encoding. 2017-02-17 18:08:01 -05:00
Denny Sheirer
c0a6d578c7 Merge pull request #202 from DSheirer/201-audio-stream-failed-reconnect
Resolves issue with audio broadcasters attempting to reconnect if a c…
2017-02-17 22:54:58 +00:00
Denny
79b4b30ec7 Resolves issue with audio broadcasters attempting to reconnect if a connection attempt is not successful. 2017-02-17 17:53:42 -05:00
Denny
17c7466c6b Resolves logic issue in Icecast error handling during resets. 2017-02-13 20:51:10 -05:00
Denny Sheirer
8162d6ffd6 Merge pull request #196 from DSheirer/164-patched-group-streaming-duplicates
Resolves #173 - duplicate streaming calls for patch groups.
2017-02-12 15:59:46 +00:00
Denny
cd60251337 Resolves #173 - duplicate streaming calls for patch groups. 2017-02-12 10:59:06 -05:00
Denny Sheirer
5647879b37 Merge pull request #195 from DSheirer/173-p25-tdma-channel-frequencies-incorrect
Resolves #173 - logging/management of  P25 TDMA channels.
2017-02-12 15:21:50 +00:00
Denny
6916d95cdf Resolves #173 - logging/management of P25 TDMA channels. There is no Phase II decoder support yet. 2017-02-12 10:20:45 -05:00
Denny Sheirer
a0c32f6fe0 Merge pull request #194 from DSheirer/193-icecast-tcp-write-timeout-exception
Resolves #193 - adds handling for MINA WriteTimeoutException
2017-02-12 13:05:11 +00:00
Denny
c3d60dc174 Resolves #193 - adds handling for MINA WriteTimeoutException error. Resets connection when this occurs. 2017-02-12 08:04:27 -05:00
Denny Sheirer
e55a2226a2 Merge pull request #192 from DSheirer/189-shoutcast-ultravox-UTF8-encoding
Resolves #189 - add UTF-8 encoding to shoutcast v2
2017-02-12 12:45:10 +00:00
Denny
9f01678b00 Resolves #189 - add UTF-8 encoding to shoutcast v2 (ultravox) XML metadata update values. 2017-02-12 07:43:51 -05:00
Denny Sheirer
46425e9cae Merge pull request #191 from DSheirer/188-p25-activity-summary-cleanup
188 p25 activity summary cleanup
2017-02-12 12:31:45 +00:00
Denny
3726401563 Resolves #188 - cleanup of the P25 and MPT activity summaries. Resolves an issue in the SNDCP downlink/uplink channel frequencies. 2017-02-12 07:30:32 -05:00
Denny
a3e50acfe3 Incrementing build to 0.3.0-beta4 2017-02-11 09:02:35 -05:00
Denny
cf0018e6ba Incrementing build to 0.3.0-beta4 2017-02-11 07:22:54 -05:00
Denny Sheirer
e8055dcab0 Merge pull request #187 from DSheirer/186-p25-c4fm-decoder-no-worky
Resolves #186 - p25 C4FM decoder wasn't working (at all).
2017-02-11 12:17:58 +00:00
Denny
fce3d5c4f3 Resolves #186 - p25 C4FM decoder wasn't working (at all). 2017-02-11 07:17:23 -05:00
Denny Sheirer
9cc0d367a8 Merge pull request #185 from DSheirer/183-alias-list-throws-npe-on-empty-name
Resolves #183 - alias list throws NPE when created with a null or emp…
2017-02-11 00:35:16 +00:00
Denny
2ca9e5d5ce Resolves #183 - alias list throws NPE when created with a null or empty name and receives alias updates. 2017-02-10 19:34:50 -05:00
Denny Sheirer
861203c3a0 Merge pull request #184 from DSheirer/181-patch-group-audio-priority
Resolves #181 - patch group audio priority will assume the highest (l…
2017-02-11 00:31:42 +00:00
Denny
7c930deefe Resolves #181 - patch group audio priority will assume the highest (listenable) audio priority and override a 'Do Not Monitor' setting if any of the other aliases have an audio priority defined. 2017-02-10 19:31:09 -05:00
Denny
0e0af932eb Incrementing build to 0.3.0-beta3 2017-02-10 17:09:54 -05:00
Denny Sheirer
6ba5e91fcb Merge pull request #182 from DSheirer/176-streaming-handle-additional-io-exceptions
Resolves #176 - resolves 2 streaming related issues
2017-02-10 22:06:32 +00:00
Denny
34dd2161ef Resolves #176 - 2 issues:
A) streaming connection errors - detects errors and if currently connected, resets the connection.

B)duplicate calls being streamed - issue with comparison of broadcast channels allowed the same broadcast channel to be queued two or more times for the list of channels to stream a recording.
2017-02-10 17:05:28 -05:00
Denny Sheirer
2543072e08 Merge pull request #180 from DSheirer/166-traffic_channel_manager_cleanup
Resolves #166 - removes traffic channel timeout from traffic channel manager
2017-02-10 15:31:24 +00:00
Denny
281be147f8 Resolves #166 - removes traffic channel timeout from traffic channel manager 2017-02-10 10:30:35 -05:00
Denny Sheirer
12ecca4555 Merge pull request #179 from DSheirer/169-aarch64-usb-support-for-ARM64
Resolves #165 - adds ARM64 (aarch64) linux libusb support
2017-02-10 15:26:16 +00:00
Denny
4c27d04120 Resolves #165 - adds ARM64 (aarch64) linux libusb support 2017-02-10 10:08:52 -05:00
Denny Sheirer
ece202315f Merge pull request #178 from DSheirer/165-overflowable-buffer-issue-causes-channels-decoding-stop
165 overflowable buffer issue causes channels decoding stop
2017-02-10 14:50:30 +00:00
Denny Sheirer
6afe5dcec9 Merge pull request #177 from DSheirer/master
165 - P25 Channel stops decoding
2017-02-10 14:47:33 +00:00
Denny
8db47c25bc #165 - cleanup of logging and comments in TunerChannelSource 2017-02-10 09:45:32 -05:00
Denny
6a340050c6 #165 - cleanup of logging and comments in TunerChannelSource 2017-02-10 06:41:45 -05:00
Denny
183eb2f7c7 Resolves #165 - P25 decoding channel stops arbitrarily and never recovers.
Issue identified with Patch Group management and circular dependencies that can develop because of stale patch groups.  Refactored all patch group management into a new PatchGroupManager.  Patch groups are now automatically deleted if we don't receive any update messages within 5 seconds.  The PatchGroupAlias was also updated to not roll-up attributes from subordinate patched group aliases when those aliases are also patch group aliases -- this eliminates the circular dependency chaining.

Added IOverflowListener interface and updated Sources to support overflow listeners.  Updated ChannelState to register as an overflow listener so that it can visually depict to the user when the channel enters/exits source overflow state.  Added new color pattern for OVERFLOW with yellow text on red.
2017-02-10 06:36:57 -05:00
Denny Sheirer
6bc92e8b94 Merge pull request #174 from RachelOlivero/gui_accessibility_enhancements
Add a Text Label to the Mute Image Button
2017-02-04 20:21:44 +00:00
Denny
767b302ed7 Adds additional unresolved address exception handler to metadata updater 2017-02-04 07:32:22 -05:00
Rachel Olivero
952d930b5b Adds a screen reader accessible label to the mute button. Label toggles between mute and unmute to match the action that will be taken when the button is next pressed. 2017-02-03 10:19:52 -05:00
Denny
26087c465f Adds additional unresolved address exception handler to metadata updater 2017-01-29 12:37:09 -05:00
Denny
74c15d530b Resolves #164 - USB time out while processing buffer transfers. Decreases periodicity of processing the LibUsb timeout handler from 9 milliseconds to 5 milliseconds to reduce chance that buffers are not being serviced in time. 2017-01-29 11:02:12 -05:00
Denny
8621d1c8e2 Bumping build to 0.3.0-beta2 2017-01-29 09:11:11 -05:00
Denny Sheirer
1cd45a1b79 Merge pull request #162 from DSheirer/161-e4000-tuner-error
Resolves #161 - E4000 tuner error.
2017-01-29 09:08:41 -05:00
Denny
8215b78a43 Resolves #161 - E4000 tuner error. Tweaks settings in the USB transfer processor to improve latency in IQ buffer handling. 2017-01-29 09:07:48 -05:00
Denny
f53519ad59 Updated CHANGELOG 2017-01-29 06:56:21 -05:00
Denny
e6ab615931 Updates the overflowable queue to reduce thread contention on the queue size monitor 2017-01-29 06:26:12 -05:00
Denny Sheirer
0c84984fcc Merge pull request #160 from DSheirer/159-icecast-unresolved-host
159 icecast unresolved host
2017-01-29 06:17:44 -05:00
Denny
b3e493989e Updates javadoc 2017-01-29 06:16:46 -05:00
Denny
50e838749d Resovles #159 - adds UnresolvedHostException error in Icecast metadata updater. 2017-01-29 04:31:31 -05:00
Denny Sheirer
c097e536e0 Merge pull request #158 from DSheirer/154-channel-metadata-context-menu
Resolves #154 - add right-click contextual channel menus for Now Play…
2017-01-28 20:42:58 -05:00
Denny
a228f29a40 Resolves #154 - add right-click contextual channel menus for Now Playing table.
Also disables right-click channel activation from the spectral display as a clean-up action.
2017-01-28 20:41:46 -05:00
Denny
74aab2cc72 Expanded error message for when drivers are not installed on user machine for RTL2832. 2017-01-28 20:04:20 -05:00
Denny
3543712fd3 Updating build to 0.3.0.beta1 2017-01-28 20:02:38 -05:00
Denny Sheirer
4780f00c44 Merge pull request #157 from DSheirer/155-libusb-pipe-error-on-resubmit
Resolves #155 - adds usb endpoint clear halt when attempting to resubmit transfer buffer
2017-01-28 19:35:38 -05:00
Denny
7e4acc568c Resolves #155 - adds usb endpoint clear halt when attempting to resubmit a transferred buffer that causes a usb pipe error. 2017-01-28 19:33:52 -05:00
Denny Sheirer
a1757686e9 Merge pull request #156 from DSheirer/155-libusb-pipe-error
Resolves #155 - LIBUSB_PIPE_ERROR when trying to start R820T tuner
2017-01-28 17:35:01 -05:00
Denny
960bf975d9 Resolves #155 - LIBUSB_PIPE_ERROR when trying to start R820T tuner 2017-01-28 17:33:59 -05:00
Denny Sheirer
57a52a662a Merge pull request #152 from DSheirer/151-mpt1327-call-timeout-no-persist
Resolves #151 - mpt1327 decoder configuration persistence
2017-01-28 17:01:10 -05:00
Denny
f7c144ca16 Resolves #151 - mpt1327 decoder configuration was not setting editor to modified on changes to traffic channel pool size or traffic channel timeout 2017-01-28 16:59:58 -05:00
Denny Sheirer
f63b05c1e4 Merge pull request #149 from DSheirer/123-add-channel-details-tab
Resolves #123 - adds channel details tab
2017-01-28 16:50:24 -05:00
Denny
78a4bfe915 Resolves #123 - adds channel details tab to display: System, Site and Channel name, and the complete Activity Summary 2017-01-28 16:47:44 -05:00
Denny Sheirer
3b2ff7144b Merge pull request #148 from DSheirer/111-broadcaster-queue-management
Resolves #111 - adds 'Maximum Age Limit' setting to streaming queues
2017-01-28 16:08:39 -05:00
Denny
cd9bb5a84d Resolves #111 - adds 'Maximum Age Limit' setting to each streaming configuration. Calls that sit in the streaming queue for too long will be aged off if their start time exceeds the delay time and maximum recording age limit. A new column is added to the streaming status table to reflect the number of calls that have been aged off. This would be an indicator to the user that they have too many talkgroups tagged to stream for a given channel and may want to change their settings to avoid age off. This mainly prevents excessive streaming queue build-up that might never get streamed and could potentially impact application memory usage. 2017-01-28 16:06:43 -05:00
Denny Sheirer
37d447066d Merge pull request #147 from DSheirer/81-p25-call-priority-and-encrypted-state
Resolves #81 - adds priority, encrypted channel, session mode and cal…
2017-01-28 14:47:12 -05:00
Denny
2ec882a87f Resolves #81 - adds priority, encrypted channel, session mode and call timer to P25 call events in the details column. 2017-01-28 14:46:38 -05:00
Denny Sheirer
7b9004af08 Merge pull request #146 from DSheirer/140-icecast-metadata-updater-url-encoding
Resolves #140 issue with updating metadata on Icecast2 servers
2017-01-28 11:17:16 -05:00
Denny
eba9367674 Resolves #140 issue with updating metadata on Icecast 2 servers where mountpoint was not URL encoded. 2017-01-28 11:15:27 -05:00
Denny Sheirer
8ffe91911b Merge pull request #145 from DSheirer/114-CSV-logging-issue
Resolves #114 issue with event log entries missing single quotes around date and time values.
2017-01-28 10:56:55 -05:00
Denny
a0e0a5ddc0 Resolves #114 issue with event log entries missing single quotes around date and time values. 2017-01-28 10:55:46 -05:00
Denny Sheirer
d500346ba2 Merge pull request #144 from DSheirer/112-playlist-v2-loading-issue
Resolves #112 issue with loading/discovering playlist V2 filename
2017-01-28 10:44:11 -05:00
Denny
3283b66bdc Resolves #112 issue with loading/discovering playlist V2 filename from the system properties. V2 playlist name is now hard-coded until a future enhancement that supports multiple user playlists. 2017-01-28 10:43:18 -05:00
Denny Sheirer
c16416ab14 Merge pull request #143 from DSheirer/141-streaming-temp-recordings-when-disabled
#141 - resolves issue with temporary streaming recordings being gener…
2017-01-28 10:36:07 -05:00
Denny
5e46e22721 #141 - resolves issue with temporary streaming recordings being generated for aliases that contained broadcast stream channel identifiers, but when no streaming channels were enabled. Resolved second issue where a broadcast channel that is enabled and streaming on application startup then gets disabled by the user and subsequently (persistently) auto restarts and connects. 2017-01-28 10:35:12 -05:00
Denny Sheirer
97e2ac31cd Merge pull request #142 from DSheirer/126-tuner-buffer-processor-out-of-memory
126 - Tuner processing refactor and significant improvement in processor and memory utilization.  R…
2017-01-28 09:09:47 -05:00
Denny
a302d098de 126 - Significant improvement in processor and memory utilization. Refactors all USB tuner sample processing with a new USBTransferProcessor class. LibUSB transfer timeout processing is now consolidated under the TunerManager and tuners register with this singleton to auto-start or auto-stop USB bulk transfer processing. Resolves long-standing issue impacting multi-tuner use where the second and subsequent tuners may have been routinely starved for LibUSB processing time under heavy-loading. All tuner buffer threaded processing is now handled as runnables in the scheduled thread pool, eliminating tuner-dedicated processing threads. Added tuner buffer size management to prevent memory blow-out when down-stream processing is either lagging or impacted by java garbage collection operations. Both tuners and individual DDC channels now have bounded sample buffer queues that automatically enter and exit overflow mode when predefined max/reset thresholds are met. When any queue goes into overflow mode, sample buffers are simply dropped in favor of preserving program/memory stability. 2017-01-28 09:08:11 -05:00
Denny Sheirer
b9e1efa92f Merge pull request #138 from DSheirer/135-audio_recording_issue
135 audio recording issue
2017-01-26 19:19:34 -05:00
Denny
07933831d2 135 WIP - resolves issue with recording. 2017-01-25 21:04:28 -05:00
Denny
e2e00a98d5 135 WIP - updates to resolve issue with all audio being recorded, even when user has not elected to record the audio. 2017-01-24 21:14:16 -05:00
Denny
ea0e1b152f Merge branch 'master' into 135-audio_recording_issue 2017-01-24 20:52:40 -05:00
Denny
afa451a070 #130 MPT-1327 Decoder Filter issue resolved. Converts the post-demodulation filter from a band pass filter to a low-pass filter with 60 dB attenuation and a cutoff of 3200 Hz. This is then followed by a high-pass filter at the decimated channel rate, internal to the decoder that performs DC removal and removes any CTCSS tones prior to the FSK decoder. 2017-01-24 20:49:12 -05:00
Denny Sheirer
eaeedc53fc Merge pull request #136 from DSheirer/130-mpt1327-decoder-filtering
#130 MPT-1327 Decoder Filter issue resolved.
2017-01-24 20:27:56 -05:00
Denny
1786ffac47 #130 MPT-1327 Decoder Filter issue resolved. Converts the post-demodulation filter from a band pass filter to a low-pass filter with 60 dB attenuation and a cutoff of 3200 Hz. This is then followed by a high-pass filter at the decimated channel rate, internal to the decoder that performs DC removal and removes any CTCSS tones prior to the FSK decoder. 2017-01-24 20:26:57 -05:00
Denny Sheirer
8b403e6d87 Merge pull request #134 from DSheirer/132-streaming_error_socket_timeout
#132 - adds enhanced streaming connection error handling.  Adds speci…
2017-01-24 19:31:00 -05:00
Denny
8a8fbc4936 #132 - adds enhanced streaming connection error handling. Adds specific handler for connection timeout to reset the connection. 2017-01-24 19:26:18 -05:00
Denny Sheirer
3c9c7794c9 Merge pull request #129 from DSheirer/128-mpt1327-editor-no-wildcards
#128-resolves issue with MPT1327 alias identifier editor preventing u…
2017-01-22 09:53:58 -05:00
Denny
48d3d7a8c1 #128-resolves issue with MPT1327 alias identifier editor preventing use of * wildcard characters. 2017-01-22 09:53:25 -05:00
Denny Sheirer
d81ef8db2a Merge pull request #127 from DSheirer/#108-thread-pool-cleanup
#108 thread pool cleanup
2017-01-22 09:38:44 -05:00
Denny
3d644c2460 #108 - cleanup 2017-01-22 09:34:55 -05:00
Denny
6e94d9ce51 #108 [WIP] Created new ThreadPool class with a static ScheduledThreadExecutor that is now shared by all components. Removed ThreadPoolManager from all classes. Consolidating into 1 pool seems to have reduced CPU usage by ~15-20%. Overall memory usage is also reduced. 2017-01-22 09:33:47 -05:00
Denny
523ac0314e Merge remote-tracking branch 'origin/master' 2017-01-22 07:29:33 -05:00
Denny Sheirer
b252159250 Merge pull request #124 from DSheirer/111-audio_broadcaster_queue_management
#111 resolves issue with probable thread contention on temporary stre…
2017-01-22 07:29:11 -05:00
Denny
2168ed112e #111 - import cleanup 2017-01-22 07:28:37 -05:00
Denny
2faaa93785 #111 resolves issue with probable thread contention on temporary streamed recording queue management that was causing processing thread backups and memory issues. Audio broadcaster was originally in this configuration but was changed to account for a potential issue where recordings could be streamed out of sequence if they occurred at the same time. Reverted queue type back to a more efficient FIFO linked transfer queue to minimize queue contention. 2017-01-22 07:20:24 -05:00
Denny Sheirer
7dc32954bf Merge pull request #122 from DSheirer/#90-channel_processing_list_and_gui_reformat
#90 channel processing list and gui reformat
2017-01-22 06:51:30 -05:00
Denny
a57183c4cc #90 - updated metadata and attributes to carry channel system/site/name values to support audio recording name generation. Updated always unsquelched decoder state to reset the PRIMARY_TO address to the channel name since the decoder will never push a value to this attribute and it's needed to correctly display audio content. 2017-01-22 06:44:07 -05:00
Denny
8fb2a66411 #90 [WIP] Logging cleanup 2017-01-21 11:06:11 -05:00
Denny
26837b8a68 #90 [WIP] Resolves issue with MPT-1327 decoder which has apparently been broken for a long time. 2017-01-21 11:05:30 -05:00
Denny
6b67a74055 #90 [WIP] Adds ability to show streaming status on main application window using menu (View > Show Streaming Status). Resolves a number of issues with the SystemProperties class. 2017-01-21 08:13:18 -05:00
Denny
2d9c3c0aa4 #90 [WIP] Adds support for attribute monitors to all of the decoder states. Updates color scheme in 'Now Playing' view for channel states. Wires selection listener for selected channel metadata to the Events and Messages views. Finalizes format for horizontal audio panels, font and coloration. 2017-01-20 21:12:57 -05:00
Denny
ce47d2545d #90 [WIP] GUI is functioning again and the new channels table is showing calls and the audio panel is now horizontal. Lots of gui tweaks still to do. 2017-01-19 22:10:49 -05:00
Denny
5f179c4863 #90 [WIP] adds AttributeMonitor and AliasedStringAttributeMonitor for managing the metadata attributes and issuing attribute change requests, so that we can remove attribute management code out of the decoder states. Adds heuristic tracking with the monitor so that we can better track the talkgroups and other attributes and smooth out the rapidly changing values when we're decoding a weak signal. This will eventually close out issue #101 2017-01-18 20:34:37 -05:00
Denny
acabab35ff Merge branch 'master' into #90-channel_processing_list_and_gui_reformat
# Conflicts:
#	src/alias/AliasList.java
2017-01-18 19:07:39 -05:00
Denny Sheirer
929fbdb21e Merge pull request #116 from DSheirer/#115_patch_group_alias_no_wildcard_alias
#115 patch group alias - resolves issue where wildcard aliases were b…
2017-01-17 20:45:32 -05:00
Denny
95a6deaae1 #115 patch group alias - resolves issue where wildcard aliases were being matched against a temporary patch group id and removed from the alias list for the lifespan of the patch group. General cleanup of the rollup methods for the patch group alias. Adds a new method to alias list that allows alias lookup from a tgid while excluding wildcard talkgroups. 2017-01-17 20:43:49 -05:00
Denny
bc8873de01 #90 [WIP] merged metadata management for channel state, decoder states and audio metadata into a new metadata class. The new metadata class is maintained for each decoding audio channel, or in the future, a decoding TDMA channel. Audio playback, recording and streaming all use the same metadata object for the channel. The list of channel processing gui panels have been deleted and channel processing status will now reside in a table where each table row is a metadata instance from the processing channel. The channel processing manager is responsible for adding/removing the channel's metadata instance to/from the metadata table. This allows the channel processing table to be the controller for the messages, events and channel spectrum views, keyed to the selected table row metadata.
I still have to clean up the gui components and wire in the table selection listeners.
2017-01-17 19:24:54 -05:00
Denny
16b69d4aef #90 [WIP] on redesigning the channel processing gui components and backing model. Simplifies channel state by introducing a new Metadata class that tracks all metadata for all decoders. 2017-01-15 08:42:13 -05:00
Denny
7115b4feb1 #90 [WIP] on redesigning the channel processing gui components and backing model. Simplifies channel state by introducing a new Metadata class that tracks all metadata for all decoders. 2017-01-14 11:21:53 -05:00
Denny Sheirer
6a9e522d77 Merge pull request #109 from DSheirer/#100-patch_group_aliases
#100 patch group alias enhancement
2017-01-13 15:48:56 -05:00
Denny
c39c49b049 #100 enhances patch group alias to include any existing alias for the patch talkgroup ID in the rolled-up alias. Streaming channels for the alias now includes any channels designated for the existing alias as well as the highest audio priority. Alias name for the patch group alias is either the existing alias name, or the label "Patch:" and the patch group ID. 2017-01-13 15:47:55 -05:00
Denny Sheirer
471685b576 Merge pull request #105 from DSheirer/#102-tooltip_typo
#102 resolves typo in tooltip for R820T Tuner Editor
2017-01-13 06:03:51 -05:00
Denny
2268879cec #102 resolves typo in tooltip for R820T Tuner Editor 2017-01-13 06:03:20 -05:00
Denny Sheirer
86e4ce817d Merge pull request #103 from DSheirer/#82_icon_manager_model
#82 icon manager model
2017-01-11 20:45:23 -05:00
Denny
75cb6c27d4 #82 - resolves issue with icon management and list updating after additions/deletions of icons. Updates the single and multi alias list editors to refresh their view any time that changes are made to the list of icons. 2017-01-11 20:44:07 -05:00
Denny
1352ef9092 Merge branch 'master' into #82_icon_manager_model 2017-01-09 18:19:28 -05:00
Denny Sheirer
8a150451c4 Merge pull request #99 from DSheirer/98_jmbe_version_check_error
#98 - updated logging to reflect the required version of JMBE (0.3.3).
2017-01-09 18:16:38 -05:00
Denny
5ff3f4169a #98 - updated logging to reflect the required version of JMBE (0.3.3). 2017-01-09 18:15:41 -05:00
Denny
b6498d048a #82 WIP - converted all classes to get icons from IconManager and removed icon management from the SettingsManager 2017-01-08 21:06:02 -05:00
Denny
488dc9da4c #82 WIP - reorganizing icon management and extracting icon model from the settings manager. 2017-01-08 15:01:53 -05:00
Denny Sheirer
4481560c41 Merge pull request #97 from DSheirer/#78_p25_patch_group_management
#78 p25 patch group management
2017-01-08 08:54:05 -05:00
Denny
1dbdede5a2 #78 updated change log 2017-01-08 07:57:22 -05:00
Denny
6bfe98dae6 #78 patch group alias and call event management. Adds new PatchGroupAlias which is a temporary alias group that is added to the alias list by the decoder state. The P25 decoder state maintains a mapping of patch group identifier to patched talkgroups and creates the patch group alias. This allows audio recording and audio streaming of patched talkgroups, according to the aliases corresponding to the group of patched aliases contained in the patch group alias.
Event logging is now pared down to only logging events when the internal patch group mapping is updated.
2017-01-08 07:54:48 -05:00
Denny Sheirer
de9c51c228 Merge pull request #94 from DSheirer/#66_remove_loggers_and_recorders_between_channel_restarts
#66 remove loggers and recorders between channel restarts
2017-01-08 05:28:16 -05:00
Denny
7865e813de #66 resolves issue with baseband recorders and loggers not being removed from channel processing chains when processing stops. This is now handled in the channel processing manager where baseband recorders and message/event loggers are added at processing start and removed at processing stop. 2017-01-08 05:21:42 -05:00
Denny
a55296eb45 Merge branch 'master' into #66_remove_loggers_and_recorders_between_channel_restarts 2017-01-08 04:44:53 -05:00
Denny
2c558ce929 #93 resolves issue with NPE when an exception is handled in the audio broadcaster exception handler 2017-01-08 04:44:13 -05:00
Denny
49a1ea04f8 #66 wip 2017-01-08 04:38:10 -05:00
Denny Sheirer
2226306de3 Merge pull request #89 from DSheirer/#65_audio_recorder_exception_on_startup
#65 resolves issue where on audio recorder startup an IO exception is…
2017-01-07 10:59:57 -05:00
Denny
0cf26da94e #65 resolves issue where on audio recorder startup an IO exception is thrown. Traps the exception and shuts down the recorder. 2017-01-07 10:56:57 -05:00
Denny Sheirer
59671738a2 Merge pull request #88 from DSheirer/#86_playlist_file_corruption_on_save
#86 - updates playlist configuration file save operations to 1)create…
2017-01-07 10:26:41 -05:00
Denny
c6f4d6da05 #86 - updates playlist configuration file save operations to 1)create a backup copy, 2)create a lock file, 3)store the playlist, and 4)remove the lock file. On startup, if it detects a residual lock file, the playlist manager will delete the existing playlist (assumes it is incomplete or corrupted), restore the previous playlist from the backup file, and remove the lock file. 2017-01-07 10:24:04 -05:00
Denny Sheirer
2d07734cc5 Merge pull request #85 from DSheirer/30-audio_streaming_support
30 audio streaming support
2017-01-07 08:25:19 -05:00
Denny
ad377f4006 #30 - updates changelog with description of audio broadcaster feature. 2017-01-07 08:19:18 -05:00
Denny
648b12fd16 #30 - resolves logic issue that was preventing deletion of temporary stream recordings. Changes the streamable recording queue in the AudioBroadcaster to find the recording with the earliest start time to prevent situations where a long recording might close out and enter the broadcast queue after a shorter recording that started later, but would have been replayed first. 2017-01-07 07:31:47 -05:00
Denny
bc430b255f #30 - changes internal MP3 temporary recording stream management so that the broadcast model manages the recordings and sends the completed recordings to the broadcasters to avoid 2 or more streams recording MP3 files for the same audio call.
Note: there is a bug where temporary recordings are not being consistently deleted that I'm still working on.
2017-01-03 09:27:17 -05:00
Denny
4578e45f60 #30 - adds streaming status color indicators to the streaming panel table.
Resolves issue with temporary streaming file name collisions by adding a 1-up number to each generated temporary recording file.
2017-01-03 06:41:22 -05:00
Denny
42c18341b6 #30 - adds support for Shoutcast V2 (aka Ultravox 2.1) audio streams.
Resolves issue with MP3 framing where the remote server was disconnecting us due to bad MP3 sync.  The LAME encoder was sending partial 20 byte MP3 frames initiall, then following with a 144 byte array which contained the remainder of the first frame and the header of the next frame.  Adjusted the MP3SilenceGenerator to only emit complete MP3 frames.

This should be the final commit for this feature, pending merge back into master branch.
2017-01-02 16:05:00 -05:00
Denny
e71a1dbeda #30 - changes audio broadcaster to send full/complete MP3 frames instead of partial frames in order to reduce remote server disconnnects due to MP3 frame sync loss on remote server. 2016-12-29 08:20:10 -05:00
Denny
a4e3c53ba8 #30 - adds support for Shoutcast V1 streaming. Resolves issue where temporary MP3 recording files were not being flushed at the end, causing partial frames to be streamed resulting in repeated remote server connection resets.
Note: Shoutcast V1 streaming to a Shoutcast V2.5.x server seems to be problematic.  The newer server tracks MP3 boundaries in order to insert advertising and this appears to have problems keeping sync with the MP3 stream.  I spent significant time eliminating MP3 framing errors in my code.  You can see these 'Bad frame' errors in the sc_serv.log and the shoutcast server will eventually reset the connection after a period of time or after a number of framing errors occur.  I anticipate that streaming to a Shoutcast V2 server using the ultravox (ie V2.x) protocol may resolve this issue.
2016-12-29 05:59:14 -05:00
Denny
0cebe7e5d9 #30 - cleanup 2016-12-26 13:48:24 -05:00
Denny
5611f594c7 #30 - improves silence frame handling. Appends silence to end of MP3 recordings to round them out to whole second intervals and adds an MP3 silence generator to generate 1 second silence frames each interval when there is no audio to broadcast. Previous approach used static silence frame, but we can't generate an exactly 1 second frame, so the remote server was resetting the connection when it detected that we were sending data at over or under rate. 2016-12-26 11:52:25 -05:00
Denny
524a76e583 #30 WIP extracted the IcecastMetadataUpdater and merged some of the icecast configuration method into a new superclass. 2016-12-26 09:08:34 -05:00
Denny
c216f56c4f #30 WIP extracted the IcecastMetadataUpdater and merged some of the icecast configuration method into a new superclass. 2016-12-24 05:41:04 -05:00
Denny
5e4cbf2a4e #30 WIP on using the new apache mina library 2016-12-18 10:17:09 -05:00
Denny
1d7354b4a8 #30 WIP on using the new apache mina library 2016-12-18 09:09:47 -05:00
Denny
d085ecc0c9 #30 WIP on using the new apache mina library 2016-12-17 16:29:52 -05:00
Denny
1c8362c1fc #30 WIP - cleanup 2016-12-11 10:38:23 -05:00
Denny
b65ff17ede #30 WIP - adds support for Icecast 2 (v2.4+) audio streams. Adds additional fields (genre, description, public) to Icecast 1 configuration editors. Adds audio broadcast delay to Broadcastify and Icecast editors. 2016-12-11 06:55:42 -05:00
Denny
ebca330730 #30 WIP - icecast 2 broadcaster cleanup 2016-12-10 10:42:59 -05:00
Denny
ef373daeef #30 WIP - icecast 2 broadcaster cleanup 2016-12-10 10:36:38 -05:00
Denny
4290d8e403 #30 WIP - icecast 2 broadcaster cleanup 2016-12-10 10:21:08 -05:00
Denny
293dec8a1c #30 WIP - adds radio reference web service lookup of broadcastify feed settings dialog. 2016-12-09 19:50:14 -05:00
Denny
f44892c62b #30 WIP - broadcastify and icecast TCP streams working and editors are complete. Adds icons to editor and table views. 2016-12-04 07:28:03 -05:00
Denny
b71415b82a #30 WIP - broadcastify multi-channel streaming is functional. 2016-11-27 11:58:34 -05:00
Denny
ecfac83eb4 #30 WIP - adds stream manager to receive multiple audio stream's packets and convert the audio and persist to disk. Broadcaster will now receive converted audio files to stream out to the server. 2016-11-13 04:33:45 -05:00
Denny
357979a5dd #30 - WIP - adds Icecast TCP(v2.3) and HTTP(v2.4) server support. Adds streaming tab and ability to add/delete/change streaming configurations. Adds streaming channel alias id so that aliases can be tagged to stream to one or more stream channels. Adds initial support for broadcastify streaming. 2016-11-06 09:33:49 -05:00
Denny
893cbba277 #30 - WIP on the shoutcast v2 protocol 2016-10-23 06:03:07 -04:00
Denny
ac23aea602 #30 - WIP on the shoutcast v2 protocol 2016-10-21 05:30:36 -04:00
Denny
a43ae9ce53 #30 - WIP on the shoutcast v2 protocol 2016-09-30 05:59:14 -04:00
Denny
02f470cf91 #30 - WIP on the shoutcast v2 protocol 2016-09-29 20:50:00 -04:00
Denny
6138838d60 #30 - WIP on the shoutcast v2 protocol 2016-09-14 06:07:21 -04:00
Denny
2537a71375 #30 - WIP Streaming audio support. Adds Shoutcast V1 handler. 2016-09-12 04:28:46 -04:00
Denny
9031fd78c9 #30 - WIP Streaming audio support 2016-08-21 11:41:42 -04:00
Denny Sheirer
e75290c42c Merge pull request #79 from DSheirer/53_audio_sample_rate_to_8kHz
53 audio sample rate to 8k hz
2016-08-21 07:27:29 -04:00
Denny
d466ec9f5e Changes audio module decimation filter from lowpass to bandpass so that we can remove 0-250 Hz and any LTR signalling from the audio output. 2016-08-21 07:21:38 -04:00
Denny
3af4b953f4 Changes internal audio sample rate from 48 kHz down to 8 kHz. Updates the P25 audio module to output 8 kHz audio. Updates the audio recorder to record at 8 kHz rate.
Note: required updated JMBE 0.3.3 library which supports 8 kHz audio output sample rate.
2016-08-19 21:09:39 -04:00
Denny
cc65d44237 Updates change log with efforts to day for 0.3.0 2016-08-04 20:01:45 -04:00
Denny
ae6ccc5d51 Updates change log with efforts to day for 0.3.0 2016-08-04 20:00:37 -04:00
Denny
77cdcf1862 #72 Enhances management of wildcard values for aliases. Calculates a relative weighting for each wildcard alias id and then orders (smallest to largest) the wildcard values so that when attempting to lookup an id value, it first attempts to look for a direct match and then defaults to iterating the list of wildcard values until it finds the most specific or best matching wildcard value. 2016-08-04 19:54:43 -04:00
Denny
bccd4f0e32 #72 Resolves issue with alias identifier wildcard matching 2016-08-01 05:04:01 -04:00
Denny
a76268b32c Cleanup 2016-07-31 11:00:34 -04:00
Denny
ba31015423 #74 - added specific call event types for patch group processing. 2016-07-31 10:18:15 -04:00
Denny
c635dc5d79 Updated call event details message for traffic channel rejects (no tuner, unknown frequency) to include the original call event details in addition to the traffic channel reject message. 2016-07-31 10:08:13 -04:00
Denny
d57c485450 Resolves issue with correct parsing of channel number for motorola patch group channel grants. 2016-07-31 09:46:09 -04:00
Denny
6e1f28917e Resolves null pointer exception when updating identifier from values. 2016-07-31 09:20:00 -04:00
Denny
6af24ffa38 Closes #72 - updates alias list to maintain a map of alias id to alias and separate lists for wildcard alias id values. Alias lookup logic is changed to first look for in the alias map for a concrete match to the alias identifier. If an alias is not found, then the list of wildcard alias identifier values is iterated looking for a matching wildcard. If the wildcard is found, then the matching alias is returned from the map. 2016-07-31 09:18:25 -04:00
Denny
b19bfb400e Merge remote-tracking branch 'origin/master' 2016-07-31 07:52:43 -04:00
Denny
a56935f92c Closes #74 - adds support for vendor-specific (Motorola) TSBK patch group management. Processes patch group channel grants and updates and allocates voice channel processing. Logs call events for patch group add (register) and patch group delete (deregister). Also adds call event logging when there is a planned control channel shutdown--logged only once. 2016-07-31 07:52:01 -04:00
Denny
b33c0359ef Resolves issue with 10 MHz sample rate discovery in Airspy R0/R2 2016-07-12 13:44:17 +00:00
Denny
078a6fddce Closes #71 - frequency controller throws exception when exceeding min/max tuning limits of a tuner.
Updated code to show dialog to user whenever the tuning limit has been exceeded.  Added new InvalidFrequencyException that includes the requested invalid frequency and the valid frequency limit that was exceeded
2016-06-04 08:21:28 -04:00
Denny
bf5ded53e2 Code cleanup 2016-06-01 04:15:16 -04:00
Denny
3c53f864c4 Closes #70 - airspy mini sample rates.
Change code to no longer assume that 10 MHz is an available default sample rate.  The mini is only capable of 6 and 3 MHz.

Note: only the 6 MHz sample rate option should be used at this time.  6 MHz can be decimated to 48 kHz using an integer decimator.  sdrtrunk doesn't support the 3 MHz option, because it can't decimate that rate to 48 kHz until the new channelizer is developed.
2016-05-30 08:58:00 -04:00
Denny
61d9698ca5 Code cleanup for waterfall and overlay panels 2016-05-30 07:30:17 -04:00
Denny
8fec7c7314 IntelliJ and configuration updates 2016-05-30 07:29:43 -04:00
Denny
90324404b2 Resolves issue #69 with double audio recordings 2016-05-30 07:25:50 -04:00
Denny
d520f43265 Adds support for Intelli-J IDE and adds missing CSS file for filter viewer 2016-05-30 07:03:31 -04:00
Denny
192d39294b Merge branch 'master' of https://github.com/DSheirer/sdrtrunk.git 2016-05-30 05:33:20 -04:00
Denny
129dba869f Adds Remez filter designer for low, high and band-pass filters. Support
for Hilbert and Differentiator FIR filter designers may be added in the
future.

Adds developer filter viewer tool written in JavaFX to visualize the
frequency and impulse response of FIR filters.  This application is not
intended to be a user application and is specifically for the developer
to analyze filters and filter specifications that will be used in the
code.

NOTE: Java 8 JDK is now required to build this project for version 0.3.x
and forward.  The JavaFX visualizer application and future user
interfaces will use the Java 8 version of JavaFX
2016-05-29 08:54:07 -04:00
Denny Sheirer
72390cc62a Update README.md
Updated download link
2016-05-02 04:28:22 -04:00
Denny
5cd51c3199 Revert "wip: adds filter viewer JavaFX utility application for visualizing filters designed through the filter factory."
This reverts commit 097884337b.
2016-04-18 18:44:43 -04:00
denny
097884337b wip: adds filter viewer JavaFX utility application for visualizing
filters designed through the filter factory.
2016-04-11 19:22:56 -04:00
denny
3231e9828b Resolves #64 Persist last tuned frequency to tuner configurations
Task-Url: http://github.com/DSheirer/sdrtrunk/issues/issue/64
2016-04-05 19:30:09 -04:00
Denny Sheirer
5672182609 Fixed type in R820T tuner editor 2016-04-02 08:15:09 -04:00
denny
631ce112bd Resolves issue with MessageActivityModel and includes missing files from
previous commit.
2016-04-01 08:27:50 -04:00
denny
c3d52ff86e Merges #34 Major redesign of Tuner, Channel and Alias management.
Changes to model, view and controller components and updates all gui
editors.  Removes the configuration panel and tree and replaces with 3
new panels.  Updates playlist.xml to a new playlist_v2.xml format.
2016-04-01 08:23:49 -04:00
denny
64fee2c718 wip #34 - testing and validating changes and testing decoding. 2016-03-29 20:00:23 -04:00
denny
55443b42f3 wip #34 - resolved issue with airspy correctly loading stored tuner
configuration values.  Updated remaining tuner editors to set loading
flag when loading tuner configuration and turn off after loading is
complete.
2016-03-27 07:25:17 -04:00
denny
3caadf0c90 Moves audio panel into the channel state list panel so that we don't
have to use a split pane.
2016-03-26 07:29:10 -04:00
denny
58160d6c6b wip #34 - resolved various issues with alias controller and editors.
Added synchronized method to channel processing manager to ensure that
we don't have contention during channel changes.
2016-03-26 07:17:43 -04:00
denny
112083a22f wip #34 - finished updating all channel configuration editors and
completed preliminary functional testing.
2016-03-25 14:26:08 -04:00
denny
e89e7bd361 wip #34 - updating the decoder editors to the new editor format 2016-03-21 18:30:19 -04:00
denny
d93f497b33 wip #34 - reformatting the channel configuration editors. 2016-03-20 19:35:45 -04:00
denny
f32c520cab wip #34 - updates FCD Pro tuner and completes work on tuners, tuner
configurations and tuner editors.
2016-03-20 08:13:28 -04:00
denny
13617e8fe2 wip #34 updates funcube dongle pro plus tuner editor 2016-03-20 07:22:18 -04:00
denny
4adffbdca7 wip #34 adds sort ordering to tuner table 2016-03-20 06:40:25 -04:00
denny
7a5dc5ad58 wip: #34 Updates the HackRF tuner editor and a few other tuner
config/editor items
2016-03-20 06:27:53 -04:00
denny
d3e8816bb4 wip: #34 Adds the E4000 tuner editor and updates a few other tuner
editor pieces.
2016-03-20 05:30:16 -04:00
denny
6bb417f69a wip: #34 - finishes the airspy tuner editor panel and adds tuner info
button to the r820t tuner editor to view serial number and misc info.
2016-03-19 14:49:55 -04:00
denny
a4d69ce0aa wip #34 - final edits to R820T tuner configuration editor and introduced
frequency correction to the airspy tuner configuration.
2016-03-18 10:59:36 -04:00
denny
45f0e09d5a wip #34 - updated tuner configurations to include unique id and assigned
flag, so that we can get rid of tuner configuration assignment objects.
2016-03-17 22:01:31 -04:00
denny
f518c15a06 wip #34
34: Redesign Channel Management 

Task-Url: http://github.com/DSheirer/sdrtrunk/issues/issue/34
2016-03-17 21:16:21 -04:00
denny
6eade2b7ea wip: #34 2016-03-13 20:06:26 -04:00
denny
86816228c2 wip #34 - adds enable/disable to tuner editor components and frequency
control
2016-03-13 08:43:55 -04:00
denny
0605760fcd wip #34 - removed some wrapper methods from tuner since the tuner
controller is now exposed (frequency, sample rate, channel count, etc)
2016-03-13 07:38:29 -04:00
denny
415f95ec89 wip #34: refactored tuners to take a tuner controller as an argument.
Removed frequency change listener framework from tuner so that the tuner
controller handles all frequency change interaction.

Updated tuner view to allow selecting tuners for main spectral display
and/or launching a new spectral display by clicking in the tuner table
cell.
2016-03-13 07:09:26 -04:00
denny
1078bdc4fd wip: #34 - adds tuner spectral display manager to handle requests to
show a tuner in the main spectral display or to show the tuner in a new
spectral display
2016-03-12 13:11:06 -05:00
denny
218eeb1848 WIP #34 - more work on tuner model and view. Includes new tuner
configuration and tuner configuration assignment editors.  Beginning of
tuner editor panel rework.   Removes most of the remaining JTree
configuration pieces.  Updates the settings manager to load and save
tuners and refactors all of the tuner configuration management out into
the tuner configuration model.
2016-03-12 12:54:48 -05:00
denny
9d4afb8c1f WIP #34 - updates tuners and tuner model to provide details on
frequency, sample rate, sourced channels, and spectral display in the
tuner view tab.
2016-03-11 07:16:29 -05:00
denny
6fa3089bc9 WIP #34 - adds tuner model and view tab, preparing to remove the
configuration panel from the controller view.
2016-03-07 20:43:43 -05:00
denny
9273f679f4 Resolves issue with loading of channel map ranges from playlist_v2.xml 2016-03-07 19:05:34 -05:00
denny
b6e4c4e7aa WIP #34 - new channel map manager/editor is complete. Channel map
manager is now a separate window launched from the decoder tab,
specifically the MPT1327 decoder tab.
2016-03-06 19:22:54 -05:00
denny
2394ac2fa9 WIP #34: added channel map manager and new editor window. Removed a
number of unused classes.  Removed playlist manager from a number of
classes and replaced with the alias, channel and channel map models.
Updated playlist manager to no longer retain a playlist except for when
loading to models or when storing from models.  Extracted version 1 to
version 2 playlist conversion and changed playlist manager to keep the
original version 1 playlist and create a new version 2 (playlist_v2.xml)
file.  On startup, try to load a v2, and if not, look for a v1 to
convert.  Otherwise, don't create a playlist and one will be created
once the user adds items to the models.
2016-03-06 07:48:14 -05:00
denny
8aebdd1c26 Changes default channel source to be a tuner. 2016-03-05 08:25:22 -05:00
denny
8b11fabf3d wip: adds call priority and non-recordable editors to the alias
multi-select editor.  

Changes example hyperlink to 'Help'.
Ensures editor only allows 1 instance of call priority or non-recordable
can be added to any alias.
2016-03-05 08:23:08 -05:00
denny
4ad16296d8 wip: alias multi-editor feature complete 2016-03-05 07:33:04 -05:00
denny
e8fd4f363a wip: alias multi-select editor feature 2016-03-05 04:30:21 -05:00
denny
00d2b43c2a wip: finished alias, alias ID and alias action editing framework. 2016-03-04 09:33:46 -05:00
denny
2c3dbe1b22 Work in progress - more updates to the Alias Identifier editor 2016-03-01 19:54:59 -05:00
denny
6d1e7a78cf Work in progress - added ability to add new alias identifiers and to
auto save alias/identifier changes.
2016-02-29 20:14:52 -05:00
denny
d1ea8656c4 Resolved error when clicking clear on an empty message model. 2016-02-29 19:16:41 -05:00
denny
e31b6adf52 Updated help text display for each of the alias identifier editors. 2016-02-28 10:06:28 -05:00
denny
63cea60c42 Merges master CF2C0CA, EEAD22F, 5F2D8C8, 22D3871, and 6F2A7E8 - updates
libusb transfer processing and shutdown/cancel management of transfers
in progress.
2016-02-27 09:45:47 -05:00
denny
ece555dead Merges master 1550c62 - channel state panel null checking 2016-02-27 09:04:13 -05:00
denny
15716d1270 merges master 455e452 - removes logging from dft processor about buffer
overflows
2016-02-27 09:02:17 -05:00
denny
8d10b502ab Merges master ca8406b - DFT processor queue backing up 2016-02-27 09:01:07 -05:00
denny
62851351a4 Merges master 399d164 - default tuner configurations issue #57 2016-02-27 08:58:47 -05:00
denny
a807ff5c07 Resolves issue with RTL2832 tuner where we attempt to cancel transfers
that have not yet been initialized.
2016-02-22 20:47:40 -05:00
denny
e5004f9fa6 Work in progress - updates to alias and alias ID editors. 2016-02-21 20:02:27 -05:00
denny
bd09911e68 Alias updates to allow JAXB persistence 2016-02-21 05:45:54 -05:00
denny
ca2b12b868 Merges master 88d3088 2016-02-20 17:56:28 -05:00
denny
7ff9e9a7ce Merges master 894ebeb - patch to audio playback where audio output
channels were locking up after a period of time
2016-02-20 17:54:35 -05:00
denny
7da541ed06 Merges master a7da60c - TDU message text 2016-02-20 17:46:38 -05:00
denny
d90684dbdc Merges master be7ab87 patch to audio metadata 2016-02-20 17:45:18 -05:00
denny
9286fdf42d Merges cdcc487 from master 2016-02-20 17:42:07 -05:00
denny
62c5265bce Updates launch script to allow clean exit on program termination. 2016-02-15 21:05:08 -05:00
denny
1687ca2c4b Updated data state default color setting 2016-02-15 20:29:46 -05:00
denny
5ee4a48ab3 Resolved issue with duplicate properties saves 2016-02-15 20:23:01 -05:00
denny
c8328b3eff Channel editor and sub editors updates. 2016-02-15 20:12:23 -05:00
denny
691e4c3383 merges master commit 94d85f6 to persist FFT size. 2016-02-15 20:11:53 -05:00
denny
5573b9a9fb Changes audio timeout from 2 seconds to 1 2016-02-15 16:01:06 -05:00
denny
f7f6c2fc3e Merges changes from master branch to resolve issue with CPU and memory
and constraints on scheduled thread pool saturation.  Adds a new
scheduled thread pool for each processing chain that the components in
the chain can share, versus the single shared pool exposed by the
threadpoolmanager class.
2016-02-15 15:47:14 -05:00
denny
e2a0451bfb Resolves issue with scheduled thread pool overtasking. Removes tuner
channel source decimation processing over to its own thread pool.
2016-02-15 08:42:29 -05:00
denny
e7d3713791 Removes message broadcaster from Decoder abstract class -- processing
chain has a message broadcaster built in, so the decoder's broadcaster
is redundant.  Changes Decoder(s) to only have a single registered
message listener (ie processing chain)
2016-02-15 07:32:26 -05:00
denny
2c6e35c739 Work in progress.
-Removed channel collection panel since panels will only have 1 channel
now
-Resolved issue with channel list and channel selection events
-Fixed some of the classes from the rebase to master branch
2016-02-15 07:10:41 -05:00
denny
1f654b5b9c Rebase channel/alias model redesign branch on current master
(v0.2.0.beta5)
2016-02-14 11:45:43 -05:00
denny
1d7f255784 Revert "Merges master onto development branch"
This reverts commit 2420bc901c63ad9d41e7c99ac95a426f826182ff.
2016-02-13 15:07:53 -05:00
denny
3f674c0b8f Revert "Updates."
This reverts commit 0e01381935f0630fa8e1755d7c9c7fbeed7ae746.
2016-02-13 15:07:52 -05:00
denny
5071205e73 Updates. 2016-02-13 15:07:02 -05:00
denny
37a93c8884 Merges master onto development branch 2016-02-13 15:05:45 -05:00
denny
12ff5513b7 Adds preliminary support for legacy P25 CAI VSELP voice frames. VSELP 1
and 2 messages simply capture the message at this point -- don't yet
know the format for the voice frames and embedded signalling.
2016-02-13 15:04:10 -05:00
denny
bca39e74ce Work in progress - more updates to the alias controller and alias editor
panels.
2016-02-13 15:04:10 -05:00
denny
75714072b2 Adds AliasModel, AliasController tab with new AliasEditor 2016-02-13 15:04:10 -05:00
denny
15edcdebe6 Adds AliasModel and AliasEvent and support for conversion from legacy
playlist format.

Renames PlaylistEditor to ChannelController
2016-02-13 15:04:09 -05:00
denny
da924e8b3a Updates playlist editor with Add, Copy/Clone and Delete channel
functionality
2016-02-13 14:58:51 -05:00
denny
61f68c08e8 Adds support to channel model and processing manager to auto-start
channels upon loading the playlist.  

Processing manager now detects channel configuration changes and
restarts the channel if it is currently processing.

Channel editor enable button now shows green if it is processing, or
default when not processing.
2016-02-13 14:58:50 -05:00
denny
ec10bb7e62 Work in progress. 2016-02-13 14:57:13 -05:00
denny
7d1ec344de Work in progress - updates channel component editors and changes
functionality so that the editor starts up without a channel displayed
and as each channel row is selected in the channels table, the editor is
updated with the channel configuration.

Likewise, the channel editor is now a channel event listener on the
channel model and will maintain channel state if the user changes
channel configuration in any of the external channel controllers like
the spectral display or the channel list.
2016-02-13 14:57:13 -05:00
denny
4be63d4b95 Work in progress.
-Started work on new channel editor channel viewer/controller
-Removed a number of unused buffer package classes
-Moved automatic frequency control to be a module and removed special
handling
-Added IUnfilteredRealBufferListener & Provider interfaces
-Completely removed the ResourceManager class
2016-02-13 14:57:12 -05:00
denny
c405ddad96 Work in progress - program compiles and runs 2016-02-13 14:37:36 -05:00
1438 changed files with 95593 additions and 81137 deletions

View File

@@ -1,29 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="lib" path="imports/commons-lang3-3.2.1.jar"/>
<classpathentry kind="lib" path="imports/jide-oss-3.5.15.jar"/>
<classpathentry kind="lib" path="imports/jsr80-1.0.1.jar"/>
<classpathentry kind="lib" path="imports/libusb4java-1.2.0-linux-arm.jar"/>
<classpathentry kind="lib" path="imports/libusb4java-1.2.0-linux-x86_64.jar"/>
<classpathentry kind="lib" path="imports/libusb4java-1.2.0-linux-x86.jar"/>
<classpathentry kind="lib" path="imports/libusb4java-1.2.0-osx-x86_64.jar"/>
<classpathentry kind="lib" path="imports/libusb4java-1.2.0-osx-x86.jar"/>
<classpathentry kind="lib" path="imports/libusb4java-1.2.0-windows-x86_64.jar"/>
<classpathentry kind="lib" path="imports/libusb4java-1.2.0-windows-x86.jar"/>
<classpathentry kind="lib" path="imports/miglayout-4.0-swing.jar"/>
<classpathentry kind="lib" path="imports/usb-api-1.0.2.jar"/>
<classpathentry kind="lib" path="imports/usb4java-1.2.0.jar"/>
<classpathentry kind="lib" path="imports/usb4java-javax-1.2.0.jar"/>
<classpathentry kind="lib" path="config"/>
<classpathentry kind="lib" path="imports/JTransforms-3.0.jar" sourcepath="/home/denny/.m2/repository/com/github/wendykierp/JTransforms/3.0/JTransforms-3.0-sources.jar"/>
<classpathentry kind="lib" path="imports/libusb4java-1.2.0-linux-ppc.jar"/>
<classpathentry kind="lib" path="imports/JLargeArrays-1.2.jar"/>
<classpathentry kind="lib" path="imports/slf4j-api-1.7.7.jar"/>
<classpathentry kind="lib" path="imports/logback-classic-1.1.2.jar"/>
<classpathentry kind="lib" path="imports/logback-core-1.1.2.jar"/>
<classpathentry kind="lib" path="imports/commons-io-2.4.jar"/>
<classpathentry kind="lib" path="imports/jmbe-interface-0.3.2.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@@ -1,4 +0,0 @@
[Dolphin]
Timestamp=2015,9,8,20,39,49
Version=3
ViewMode=1

35
.gitignore vendored
View File

@@ -1,4 +1,35 @@
/*.class
### JetBrains template
.idea/
/classes*
/product*
/bin/
out/
.directory
.settings
## File-based project format:
*.iws
*.iml
# mpeltonen/sbt-idea plugin
.idea_modules/
### Java template
*.class
*.log
# Package Files #
*.jar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
### Gradle template
.gradle
/build/
# Ignore Gradle GUI config
gradle-app.setting
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar
# Cache of project
.gradletasknamecache

9
.idea/compiler.xml generated Normal file
View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel>
<module name="sdr-trunk_main" target="1.8" />
<module name="sdr-trunk_test" target="1.8" />
</bytecodeTargetLevel>
</component>
</project>

6
.idea/misc.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

10
.idea/modules.xml generated Normal file
View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/modules/sdr-trunk.iml" filepath="$PROJECT_DIR$/.idea/modules/sdr-trunk.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/sdr-trunk_main.iml" filepath="$PROJECT_DIR$/.idea/modules/sdr-trunk_main.iml" group="sdr-trunk" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/sdr-trunk_test.iml" filepath="$PROJECT_DIR$/.idea/modules/sdr-trunk_test.iml" group="sdr-trunk" />
</modules>
</component>
</project>

6
.idea/vcs.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View File

@@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>sdrtrunk</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@@ -1,11 +0,0 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.7

View File

@@ -1,17 +1,53 @@
0.3.3 20171225
- Changes build system from ant to gradle. Thanks to: Roman Tsypuk https://github.com/tsypuk
- Adds LIST and ID3 metadata to wav audio recordings
0.2.0 2015xxxx
0.3.2 20171105
- Resolves issue with tuner frequency adjustments that was causing channel processing
to lockup and show persistent 'overflow' state in each channel status
- Resolves issue with broadcastify 'mountpoint-in-use' error handling and updates
memory usage logging
- Resolves issue with Shoutcast 2 login error
0.3.1 20171009
- Resolves Java 9 incompatibility issues
0.3.0 20170922
- REQUIRES: Java 8 (or newer) for compatibility and eventual changeover to JavaFX
- FEATURE: audio streaming - adds capability to stream to multiple remote broadcast
servers (Broadcastify, Icecast v2.3 and v2.4+, and Shoutcast V1 and V2). Each
stream can be independently configured with a delay. Audio calls are directed
to one or more streams by attaching one or more stream identifiers to each alias.
- Extensive GUI updates for tuner, channel and alias management. Includes new
'Now Playing' channel view and 'Detail' view.
- Updated alias list management of alias id values and wildcards. Weighting is now
applied to each wildcard so that they can be ordered from most specific to least
specific for lookup value matching purposes.
- Added handling for Motorola-specific P25 patch messages and auto-generation of
patch group aliases that roll-up aliases from each patched talkgroup to support
audio recording and streaming of patch calls according to the identifiers and
actions defined for each of the patched talkgroups.
- Implemented bounded queues for both tuner and individual channel IQ sample
buffers. Bounded queues have ability to enter/exit overflow state when queue
size reaches overflow threshold and reset when queue size falls below the reset
threshold. Channel state will show OVERFLOW in red/yellow.
- Improves handling of P25 TDMA channels (NO Phase 2 decoder support yet)
- Updated airspy controller for airspy-mini specific sample rate handling.
- New developer remez filter designer tool and internal usage
0.2.0 20160329
- Major overhaul of underlying processing chain and extensive updates to all
decoders and filters
- New audio playback interface with global mute and support for one or two
audio channels
- Audio playback is prioritized using a new Call Priority alias action
- Audio playback is prioritized using a new Call Priority name action
with selected channels having the highest priority and any audio without
an alias identifier having the lowest priority.
- Updated Audio recording per call with new 'Non-Recordable' alias action
an name identifier having the lowest priority.
- Updated Audio recording per call with new 'Non-Recordable' name action
- Updated Baseband (I/Q) recording at 48 kHz
- Added Airspy tuner support
- New traffic channel pool manager for trunked call following
- P25 Decoder for C4FM and LSM with trunked call following and audio
- P25 Decoder for C4FM and LSM with trunked call following and audio
decoding via the JMBE library
- Updated MPT1327 decoder and trunked call following.
- Updated spectral and waterfall display with zoom (2-64x) and pan and automatic

View File

@@ -631,8 +631,8 @@ to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
{one line to give the program's name and a brief idea of what it does.}
Copyright (C) {year} {name of author}
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
@@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
{project} Copyright (C) {year} {fullname}
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
@@ -671,4 +671,4 @@ into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

View File

@@ -1,22 +1,54 @@
# sdrtrunk #
A cross-platform java application for decoding, monitoring and recording trunked
mobile and related radio protocols using Software Defined Radios (SDR).
# sdrtrunk
A cross-platform java application for decoding, monitoring, recording and streaming trunked mobile and related radio protocols using Software Defined Radios (SDR).
# Documentation #
* [Getting Started](https://github.com/DSheirer/sdrtrunk/wiki/GettingStarted)
* [User's Manual (Version 0.2.0)](https://github.com/DSheirer/sdrtrunk/wiki/UserManual)
* [Wiki](https://github.com/DSheirer/sdrtrunk/wiki)
# Support Group and Error Reporting #
You can get help with setting up the sdrtrunk application or report any errors
that you encounter while running the application in the sdrtrunk Google Group at:
* [User's Manual Version 0.3.0](https://github.com/DSheirer/sdrtrunk/wiki/UserManual_Version0.3.0)
* [Download](https://github.com/DSheirer/sdrtrunk/releases)
* [Support](https://groups.google.com/forum/#!forum/sdrtrunk)
# Updates #
Subscribe to this group to receive updates about new releases and the ongoing
application development effort.
![sdrtrunk Application Overview - Version 0.3.0](https://github.com/DSheirer/sdrtrunk/wiki/images/ApplicationOverview_V0.3.0.png)
**Figure 1:** sdrtrunk **Version 0.3.0** Application Screenshot
* [Subscribe for Updates](https://groups.google.com/forum/#!forum/sdrtrunk)
# Instructions:
## Build the project
Project uses gradle as build system. You can build it with locally installed gradle or if you do not have/want install gradle you can use preconfigured linux/windows wrapper.
### Build with locally installed gradle 4.3.1
```
gradle clean buildSdr
```
### Build with preconfigured wrapper for linux/windows
Linux
```
./gradlew clean buildSdr
```
Windows
```
gradle.bat clean buildSdr
```
This would add gradle, download all project dependencies and build JAR
![](https://github.com/DSheirer/sdrtrunk/wiki/images/SDRTrunk_application.png)
## Development
All dependencies/versions are controlled from build.gradle.
To change the new release version tag of artifact - change property:
```
version = '0.3.2'
```
## Run SDRTrunk
SDRTrunk is packed into single uber-jar file. There is need to have folders with dependecies and
adding them with classpath. Just run with java.
### Use Java8
```
java -jar build/libs/sdr-trunk-all-0.3.2.jar
```
## TODO ITEMS
- [x] Move project to gradle build
- [x] Changed folders structure, based on java project
- [x] Dependencies are moved to gradle and versions are updated
- [x] Create uberJAR with all dependencies
- [ ] Some dependencies left in imports folder. Find them and include into gradle
- [ ] Move images into resources of project
- [ ] Add tests to project. This would guarantee that after refactoring part of functionality is not broken
- [ ] Create modular OOP system (radio-module, gui, web-ui, etc). This would allow to use RADIO modules to call from CLI, GUI or Web UI. And use SDRTrunk as dependency for other projects.

73
build.gradle Normal file
View File

@@ -0,0 +1,73 @@
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
}
}
apply plugin: 'java'
apply plugin: 'idea'
repositories {
jcenter()
mavenCentral()
}
version = '0.3.3-beta.3'
sourceCompatibility = 1.8
sourceSets {
main.java.srcDirs 'src/main'
test.java.srcDirs 'src/test'
}
idea {
module {
downloadJavadoc = true
downloadSources = true
}
}
dependencies {
testCompile 'junit:junit:4.12'
testCompile 'org.assertj:assertj-core:3.8.0'
compile fileTree(dir: 'imports', include: '*.jar')
compile 'org.apache.commons:commons-lang3:3.7'
compile 'org.apache.commons:commons-io:1.3.2'
compile 'org.slf4j:slf4j-api:1.7.25'
compile 'ch.qos.logback:logback-core:1.2.3'
compile 'ch.qos.logback:logback-classic:1.2.3'
compile 'com.miglayout:miglayout-swing:5.0'
compile 'org.usb4java:usb4java-javax:1.2.0'
compile 'org.usb4java:usb4java:1.2.0'
compile 'org.usb4java:libusb4java:1.2.0'
compile 'javax.usb:usb-api:1.0.2'
compile 'com.github.wendykierp:JTransforms:3.1'
compile 'pl.edu.icm:JLargeArrays:1.6'
compile 'net.coderazzi:tablefilter-swing:5.3.1'
compile 'com.jidesoft:jide-oss:3.4.3'
compile 'org.apache.mina:mina-core:2.0.16'
compile 'org.apache.mina:mina-http:2.0.16'
compile 'org.apache.axis:axis-jaxrpc:1.4'
compile 'org.apache.axis:axis:1.4'
compile 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.9.3'
}
task wrapper(type: Wrapper) {
gradleVersion = '4.3.1'
}
task buildSdr(type: Jar) {
manifest {
attributes 'Implementation-Title': 'SdrTrunk project',
'Implementation-Version': version,
'Main-Class': 'io.github.dsheirer.gui.SDRTrunk',
'Class-Path': 'jmbe-0.3.2.jar jmbe-0.3.3.jar'
}
baseName = project.name + '-all'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}

View File

@@ -1,121 +0,0 @@
<project name="SDRTrunk" default="SDRTrunk" basedir=".">
<description>
Ant build script for SDRTrunk Decoder Application
</description>
<!-- version properties -->
<property name="major" value="0"/>
<property name="minor" value="2"/>
<property name="patch" value="0"/>
<property name="release" value=""/>
<property name="filename" value="sdrtrunk_${major}.${minor}.${patch}${release}"/>
<!-- Build properties -->
<property name="repo" location=".."/>
<property name="source.code" location="${repo}/src"/>
<property name="source.configs" location="${repo}/config"/>
<property name="source.images" location="${repo}/images"/>
<property name="source.libs" location="${repo}/imports"/>
<property name="source.license" location="${repo}/license"/>
<property name="source.scripts" location="${repo}/scripts"/>
<property name="output" location="${repo}/product"/>
<property name="output.classes" location="${repo}/classes"/>
<property name="output.folder" location="${output}/sdrtrunk"/>
<property name="output.config" location="${output.folder}/config"/>
<property name="output.images" location="${output.folder}/images"/>
<property name="output.libs" location="${output.folder}/libs"/>
<path id="classpath">
<fileset dir="${source.libs}" includes="*.jar" />
</path>
<target name="init">
<!-- Create the classes folder to contain the compiled java classes -->
<mkdir dir="${output.classes}"/>
<!-- Create version file -->
<echo message="${major}.${minor}.${patch}-${release}" file="${output.classes}/sdrtrunk-version"/>
</target>
<target name="compile" depends="clean,init" description="Compile java classes" >
<javac srcdir="${source.code}" destdir="${output.classes}" classpathref="classpath" includeantruntime="false" />
</target>
<target name="SDRTrunk" depends="compile" description="Create SDRTrunk application" >
<!-- Create the distribution directory -->
<mkdir dir="${output.folder}"/>
<!-- Create jar file -->
<jar jarfile="${output.folder}/sdrtrunk.jar" basedir="${output.classes}">
<manifest>
<attribute name="Title" value="sdrtrunk"/>
<attribute name="Main-Class" value="gui.SDRTrunk"/>
<attribute name="Version" value="${major}.${minor}.${patch}-${release}"/>
</manifest>
<fileset dir="${source.configs}">
<exclude name="*.rules"/>
</fileset>
<fileset dir="${source.license}">
<include name="license.txt"/>
</fileset>
</jar>
<!-- Copy third-party libraries -->
<mkdir dir="${output.libs}"/>
<copy todir="${output.libs}">
<fileset dir="${source.libs}" includes="*.jar" />
</copy>
<!-- Copy config files -->
<mkdir dir="${output.config}"/>
<copy todir="${output.config}">
<fileset dir="${source.configs}">
<include name="*.rules"/>
</fileset>
</copy>
<!-- Copy image files -->
<mkdir dir="${output.images}"/>
<copy todir="${output.images}">
<fileset dir="${source.images}" />
</copy>
<!-- Copy license file -->
<copy todir="${output.folder}">
<fileset dir="${source.license}">
<include name="license.txt"/>
</fileset>
</copy>
<!-- Copy program scripts -->
<copy todir="${output.folder}">
<fileset dir="${source.scripts}" />
</copy>
<!-- Bundle the files into .zip -->
<zip destfile="${output}/${filename}.zip" basedir="${output}" />
<!-- Remove linux start script before tar task -->
<delete file="${output.folder}/run_sdrtrunk_linux.sh"/>
<!-- Bundle files into .tar.gz and copy/set permissions on linux start script -->
<tar destfile="${output}/${filename}.tar.gz" compression="gzip">
<tarfileset dir="${output.folder}" prefix="sdrtrunk" />
<tarfileset dir="${source.scripts}" prefix="sdrtrunk" filemode="777">
<include name="run_sdrtrunk_linux.sh"/>
</tarfileset>
</tar>
<delete dir="${output.folder}"/>
</target>
<target name="clean" description="Clean previous build artifacts" >
<delete dir="${output.classes}"/>
<delete dir="${output}"/>
</target>
</project>

View File

@@ -1,30 +0,0 @@
<configuration>
<timestamp key="appstart" datePattern="HHmmss"/>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${user.home}/SDRTrunk/logs/sdrtrunk_app.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- daily log rollover -->
<fileNamePattern>${user.home}/SDRTrunk/logs/%d{yyyyMMdd}_sdrtrunk_app.log</fileNamePattern>
<maxHistory>10</maxHistory>
</rollingPolicy>
<encoder>
<pattern>%-25(%d{yyyyMMdd HHmmss.SSS} [%thread]) %-5level %logger{30} - %msg%n</pattern>
</encoder>
</appender>
<root level="DEBUG">
<appender-ref ref="FILE" />
</root>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%-12(%d{HH:mm:ss.SSS}) %-5level %logger{25} - %msg%n</pattern>
</encoder>
</appender>
<root level="DEBUG">
<appender-ref ref="STDOUT" />
</root>
</configuration>

View File

@@ -1,6 +1,6 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2015 Dennis Sheirer
* Copyright (C) 2014-2016 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

BIN
gradle/wrapper/gradle-wrapper.jar vendored Normal file

Binary file not shown.

View File

@@ -0,0 +1,5 @@
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3.1-bin.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME

172
gradlew vendored Executable file
View File

@@ -0,0 +1,172 @@
#!/usr/bin/env sh
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"

84
gradlew.bat vendored Normal file
View File

@@ -0,0 +1,84 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

View File

@@ -1,4 +0,0 @@
[Dolphin]
PreviewsShown=true
Timestamp=2013,9,20,8,54,21
Version=3

Binary file not shown.

Before

Width:  |  Height:  |  Size: 688 B

View File

@@ -1,4 +0,0 @@
[Dolphin]
Timestamp=2013,4,7,10,12,39
Version=3
ViewMode=1

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
imports/wsdl4j-1.5.1.jar Normal file

Binary file not shown.

View File

@@ -1,2 +0,0 @@
#!/bin/bash
java -XX:+UseG1GC -cp "*:libs/*" gui.SDRTrunk

View File

@@ -1 +0,0 @@
java -XX:+UseG1GC -cp "sdrtrunk.jar;*;libs/*;config/*;images/*" gui.SDRTrunk

1
settings.gradle Normal file
View File

@@ -0,0 +1 @@
rootProject.name = 'sdr-trunk'

View File

@@ -1,4 +0,0 @@
[Dolphin]
Timestamp=2015,9,1,6,42,59
Version=3
ViewMode=1

View File

@@ -1,200 +0,0 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 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/>
******************************************************************************/
package alias;
import java.awt.Color;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAttribute;
import alias.action.AliasAction;
import alias.priority.Priority;
import audio.inverted.AudioType;
public class Alias
{
private String mName;
private int mColor;
private String mIconName;
private ArrayList<AliasID> mAliasIDs = new ArrayList<AliasID>();
private List<AliasAction> mAliasActions = new ArrayList<AliasAction>();
public Alias()
{
}
public String toString()
{
return getName();
}
@XmlAttribute
public String getName()
{
return mName;
}
public void setName( String name )
{
mName = name;
}
@XmlAttribute
public int getColor()
{
return mColor;
}
public void setColor( int color )
{
mColor = color;
}
public Color getMapColor()
{
return new Color( mColor );
}
@XmlAttribute
public String getIconName()
{
return mIconName;
}
public void setIconName( String iconName )
{
mIconName = iconName;
}
public ArrayList<AliasID> getId()
{
return mAliasIDs;
}
public void setId( ArrayList<AliasID> id )
{
mAliasIDs = id;
}
public void addAliasID( AliasID id )
{
mAliasIDs.add( id );
}
public void removeAliasID( AliasID id )
{
mAliasIDs.remove( id );
}
public List<AliasAction> getAction()
{
return mAliasActions;
}
public void setAction( List<AliasAction> actions )
{
mAliasActions = actions;
}
public void addAliasAction( AliasAction action )
{
mAliasActions.add( action );
}
public void removeAliasAction( AliasAction action )
{
mAliasActions.remove( action );
}
public boolean hasActions()
{
return !mAliasActions.isEmpty();
}
public boolean hasAudioType()
{
for( AliasID id: mAliasIDs )
{
if( id.hasAudioType() )
{
return true;
}
}
return false;
}
public AudioType getAudioType()
{
for( AliasID id: mAliasIDs )
{
if( id.hasAudioType() )
{
return id.getAudioType();
}
}
return AudioType.NORMAL;
}
/**
* Returns the priority level of this alias, if defined, or the default priority
*/
public int getCallPriority()
{
for( AliasID id: mAliasIDs )
{
if( id.getType() == AliasIDType.Priority )
{
return ((Priority)id).getPriority();
}
}
return Priority.DEFAULT_PRIORITY;
}
public boolean hasPriority()
{
for( AliasID id: mAliasIDs )
{
if( id.getType() == AliasIDType.Priority )
{
return true;
}
}
return false;
}
/**
* Inspects the alias for a non-recordable alias id. Default is true;
*/
public boolean isRecordable()
{
for( AliasID id: getId() )
{
if( id.getType() == AliasIDType.NonRecordable )
{
return false;
}
}
return true;
}
}

View File

@@ -1,87 +0,0 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 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/>
******************************************************************************/
package alias;
import java.util.ArrayList;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSeeAlso;
@XmlSeeAlso( { AliasList.class} )
@XmlRootElement( name = "alias_directory" )
public class AliasDirectory
{
private ArrayList<AliasList> mAliasList = new ArrayList<AliasList>();
public AliasDirectory()
{
}
public void refresh()
{
for( AliasList list: mAliasList )
{
list.update();
}
}
@XmlElement( name = "alias_list" )
public ArrayList<AliasList> getAliasList()
{
return mAliasList;
}
public void setAliasList( ArrayList<AliasList> lists )
{
mAliasList = lists;
if( mAliasList == null )
{
mAliasList = new ArrayList<AliasList>();
}
}
public void addAliasList( AliasList list )
{
mAliasList.add( list );
}
public void removeAliasList( AliasList list )
{
mAliasList.remove( list );
}
/**
* Gets the named alias list, or returns an empty alias list
*/
public AliasList getAliasList( String name )
{
AliasList retVal = new AliasList();
for( AliasList list: mAliasList )
{
if( list.getName().equalsIgnoreCase( name ) )
{
return list;
}
}
return retVal;
}
}

View File

@@ -1,91 +0,0 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 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/>
******************************************************************************/
package alias;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JMenuItem;
import javax.swing.JPopupMenu;
import controller.ConfigurableNode;
public class AliasDirectoryNode extends ConfigurableNode
{
private static final long serialVersionUID = 1L;
public AliasDirectoryNode( AliasDirectory directory )
{
super( directory );
}
public AliasDirectory getAliasDirectory()
{
return (AliasDirectory)getUserObject();
}
public void init()
{
for( AliasList list: getAliasDirectory().getAliasList() )
{
AliasListNode node = new AliasListNode( list );
getModel().addNode( node, AliasDirectoryNode.this, getChildCount() );
node.init();
}
sort();
}
public String toString()
{
return "Alias Lists [" + this.getChildCount() + "]";
}
public JPopupMenu getContextMenu()
{
JPopupMenu retVal = new JPopupMenu();
JMenuItem addItem = new JMenuItem( "Add Alias List" );
addItem.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent e )
{
AliasList list = new AliasList();
getAliasDirectory().addAliasList( list );
AliasListNode node = new AliasListNode( list );
getModel().addNode( node,
AliasDirectoryNode.this,
AliasDirectoryNode.this.getChildCount() );
sort();
getModel().showNode( node );
}
} );
retVal.add( addItem );
return retVal;
}
}

View File

@@ -1,205 +0,0 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 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/>
******************************************************************************/
package alias;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JColorChooser;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.tree.TreePath;
import map.MapIcon;
import map.MapIconListCellRenderer;
import net.miginfocom.swing.MigLayout;
import settings.SettingsManager;
import controller.ConfigurableNode;
import controller.ResourceManager;
public class AliasEditor extends JPanel implements ActionListener
{
private static final long serialVersionUID = 1L;
private AliasNode mAliasNode;
private ResourceManager mResourceManager;
private JLabel mLabelName;
private JTextField mTextAlias;
private JLabel mLabelMapColor;
private JButton mButtonColor;
private JComboBox<MapIcon> mComboMapIcon;
private JButton mBtnIconManager;
public AliasEditor( AliasNode aliasNode, ResourceManager resourceManager )
{
mAliasNode = aliasNode;
mResourceManager = resourceManager;
initGUI();
}
private void initGUI()
{
setLayout( new MigLayout( "", "[right][grow,fill]", "[][][][][][grow][]" ) );
setBorder( BorderFactory.createTitledBorder( "Alias" ) );
mLabelName = new JLabel( "Name:" );
add( mLabelName );
mTextAlias = new JTextField( mAliasNode.getAlias().getName() );
add( mTextAlias, "wrap" );
mLabelMapColor = new JLabel( "Map Color:" );
add( mLabelMapColor );
mButtonColor = new JButton( "Map Color" );
mButtonColor.setBackground( mAliasNode.getAlias().getMapColor() );
mButtonColor.setForeground( mAliasNode.getAlias().getMapColor() );
mButtonColor.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent e )
{
Color newColor = JColorChooser.showDialog(
AliasEditor.this,
"Choose color for map labels and routes",
mAliasNode.getAlias().getMapColor() );
mButtonColor.setForeground( newColor );
mButtonColor.setBackground( newColor );
}
} );
add( mButtonColor, "wrap" );
add( new JLabel( "Icon:" ) );
mComboMapIcon = new JComboBox<MapIcon>(
mResourceManager.getSettingsManager().getMapIcons() );
MapIconListCellRenderer renderer = new MapIconListCellRenderer();
renderer.setPreferredSize( new Dimension( 200, 30 ) );
mComboMapIcon.setRenderer( renderer );
String iconName = mAliasNode.getAlias().getIconName();
if( iconName == null )
{
iconName = SettingsManager.DEFAULT_ICON;
}
MapIcon savedIcon = mResourceManager.getSettingsManager()
.getMapIcon( iconName );
if( savedIcon != null )
{
mComboMapIcon.setSelectedItem( savedIcon );
}
add( mComboMapIcon, "wrap" );
//Dummy place holder
add( new JLabel() );
mBtnIconManager = new JButton( "Icon Manager" );
mBtnIconManager.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent arg0 )
{
mResourceManager.getController().showIconManager();
}
} );
add( mBtnIconManager, "span 2,wrap" );
JButton btnSave = new JButton( "Save" );
btnSave.addActionListener( AliasEditor.this );
add( btnSave );
JButton btnReset = new JButton( "Reset" );
btnReset.addActionListener( AliasEditor.this );
add( btnReset, "wrap" );
}
@Override
public void actionPerformed( ActionEvent e )
{
String command = e.getActionCommand();
if( command.contentEquals( "Save" ) )
{
String alias = mTextAlias.getText();
if( alias != null )
{
boolean expanded = mAliasNode.getModel().getTree()
.isExpanded( new TreePath( mAliasNode ) );
mAliasNode.getAlias().setName( alias );
((ConfigurableNode)mAliasNode.getParent()).sort();
mAliasNode.getAlias().setColor(
mButtonColor.getBackground().getRGB() );
MapIcon selectedIcon = (MapIcon)mComboMapIcon.getSelectedItem();
if( selectedIcon != null )
{
mAliasNode.getAlias().setIconName( selectedIcon.getName() );
}
mAliasNode.save();
mAliasNode.show();
if( expanded )
{
mAliasNode.getModel().getTree()
.expandPath( new TreePath( mAliasNode ) );
}
}
else
{
JOptionPane.showMessageDialog( AliasEditor.this, "Please enter an alias name" );
}
}
else if( command.contentEquals( "Reset" ) )
{
mTextAlias.setText( mAliasNode.getAlias().getName() );
mButtonColor.setBackground( mAliasNode.getAlias().getMapColor() );
mButtonColor.setForeground( mAliasNode.getAlias().getMapColor() );
MapIcon savedIcon = mResourceManager.getSettingsManager()
.getMapIcon( mAliasNode.getAlias().getIconName() );
mComboMapIcon.setSelectedItem( savedIcon );
}
mAliasNode.refresh();
}
}

View File

@@ -1,41 +0,0 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 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/>
******************************************************************************/
package alias;
import audio.inverted.AudioType;
public abstract class AliasID
{
public AliasID()
{
}
public abstract AliasIDType getType();
public boolean hasAudioType()
{
return false;
}
public AudioType getAudioType()
{
return AudioType.NORMAL;
}
public abstract boolean matches( AliasID id );
}

View File

@@ -1,35 +0,0 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 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/>
******************************************************************************/
package alias;
import controller.ConfigurableNode;
public class AliasIDNode extends ConfigurableNode
{
private static final long serialVersionUID = 1L;
public AliasIDNode( AliasID id )
{
super( id );
}
public void save()
{
getModel().getResourceManager().getPlaylistManager().save();
}
}

View File

@@ -1,580 +0,0 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014,2015 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/>
******************************************************************************/
package alias;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSeeAlso;
import module.decode.lj1200.LJ1200Message.Function;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import alias.action.AliasAction;
import alias.action.beep.BeepAction;
import alias.action.clip.ClipAction;
import alias.action.script.ScriptAction;
import alias.id.esn.Esn;
import alias.id.fleetsync.FleetsyncID;
import alias.id.fleetsync.StatusID;
import alias.id.lojack.LoJackFunctionAndID;
import alias.id.mdc.MDC1200ID;
import alias.id.mobileID.Min;
import alias.id.mpt1327.MPT1327ID;
import alias.id.siteID.SiteID;
import alias.id.talkgroup.TalkgroupID;
import alias.id.uniqueID.UniqueID;
import alias.priority.Priority;
import alias.record.NonRecordable;
import audio.metadata.MetadataType;
@XmlSeeAlso( { Alias.class,
/* Alias ID's */
AliasID.class,
FleetsyncID.class,
Esn.class,
Group.class,
LoJackFunctionAndID.class,
MDC1200ID.class,
Min.class,
MPT1327ID.class,
UniqueID.class,
SiteID.class,
StatusID.class,
TalkgroupID.class,
/* Alias Attributes */
NonRecordable.class,
Priority.class,
/* Alias Actions */
AliasAction.class,
BeepAction.class,
ClipAction.class,
ScriptAction.class } )
@XmlRootElement( name = "alias_list" )
public class AliasList implements Comparable<AliasList>
{
private final static Logger mLog = LoggerFactory.getLogger( AliasList.class );
private String mName;
private ArrayList<Group> mGroups = new ArrayList<Group>();
private Map<String,Alias> mESN = new HashMap<>();
private Map<String,Alias> mFleetsync = new HashMap<>();
private Map<LoJackFunctionAndID,Alias> mLoJack = new HashMap<>();
private Map<String,Alias> mMDC1200 = new HashMap<>();
private Map<String,Alias> mMobileID = new HashMap<>();
private Map<String,Alias> mMPT1327 = new HashMap<>();
private Map<String, Alias> mSiteID = new HashMap<>();
private Map<Integer, Alias> mStatus = new HashMap<>();
private Map<String,Alias> mTalkgroup = new HashMap<>();
private Map<Integer,Alias> mUniqueID = new HashMap<>();
private boolean mESNWildcard = false;
private boolean mMobileIDWildcard = false;
private boolean mFleetsyncWildcard = false;
private boolean mMDC1200Wildcard = false;
private boolean mMPT1327Wildcard = false;
private boolean mSiteWildcard = false;
private boolean mTalkgroupWildcard = false;
public AliasList()
{
this( null );
}
public AliasList( String name )
{
mName = name;
update();
}
/**
* Load/Reload all lookup hashmaps
*/
public void update()
{
//Clear hashmaps
mESN.clear();
mFleetsync.clear();
mLoJack.clear();
mMDC1200.clear();
mMobileID.clear();
mMPT1327.clear();
mSiteID.clear();
mStatus.clear();
mTalkgroup.clear();
mUniqueID.clear();
for( Group group: mGroups )
{
for( Alias alias: group.getAlias() )
{
for( AliasID id: alias.getId() )
{
switch( id.getType() )
{
case ESN:
Esn esn = (Esn)id;
if( esn.getEsn().contains( "*" ) )
{
mESNWildcard = true;
mESN.put( fixWildcard( esn.getEsn() ), alias );
}
else
{
mESN.put( esn.getEsn(), alias );
}
break;
case Fleetsync:
FleetsyncID fs = (FleetsyncID)id;
if( fs.getIdent().contains( "*" ) )
{
mFleetsyncWildcard = true;
mFleetsync.put( fixWildcard( fs.getIdent() ), alias );
}
else
{
mFleetsync.put( fs.getIdent(), alias );
}
break;
case LoJack:
mLoJack.put( (LoJackFunctionAndID)id, alias );
break;
case MDC1200:
MDC1200ID mdc = (MDC1200ID)id;
if( mdc.getIdent().contains( "*" ) )
{
mMDC1200Wildcard = true;
//Replace (*) wildcard with regex wildcard (.)
mMDC1200.put( fixWildcard( mdc.getIdent() ), alias );
}
else
{
mMDC1200.put( mdc.getIdent(), alias );
}
break;
case MPT1327:
MPT1327ID mpt = (MPT1327ID)id;
String ident = mpt.getIdent();
if( ident != null )
{
if( ident.contains( "*" ) )
{
mMPT1327Wildcard = true;
//Replace (*) wildcard with regex wildcard (.)
mMPT1327.put( fixWildcard( ident ), alias );
}
else
{
mMPT1327.put( ident, alias );
}
}
break;
case MIN:
Min min = (Min)id;
if( min.getMin().contains( "*" ) )
{
mMobileIDWildcard = true;
mMobileID.put( fixWildcard( min.getMin() ), alias );
}
else
{
mMobileID.put( min.getMin(), alias );
}
break;
case LTRNetUID:
UniqueID uid = (UniqueID)id;
mUniqueID.put( uid.getUid(), alias );
break;
case Site:
SiteID siteID = (SiteID)id;
if( siteID.getSite().contains( "*" ) )
{
mSiteWildcard = true;
mSiteID.put( fixWildcard( siteID.getSite() ), alias );
}
else
{
mSiteID.put( siteID.getSite(), alias );
}
break;
case Status:
mStatus.put( ((StatusID)id).getStatus(), alias );
break;
case Talkgroup:
TalkgroupID tgid = (TalkgroupID)id;
if( tgid.getTalkgroup().contains( "*" ) )
{
mTalkgroupWildcard = true;
//Replace (*) wildcard with regex wildcard (.)
mTalkgroup.put( fixWildcard( tgid.getTalkgroup() ), alias );
}
else
{
mTalkgroup.put( tgid.getTalkgroup(), alias );
}
break;
case NonRecordable:
case Priority:
//We don't maintain lookups for these items
break;
default:
mLog.warn( "Unrecognized Alias ID Type:" + id.getType().name() );
break;
}
}
}
}
}
/**
* Converts user wildcard character (*) to regex single character wildcard (.)
* but ignores a regex multi-character wildcard (.*)
*/
private String fixWildcard( String value )
{
if( value.contains( "*" ) && !value.contains( ".*" ) )
{
return value.replace( "*", "." );
}
return value;
}
public Alias getSiteID( String siteID )
{
if( siteID != null )
{
if( mSiteWildcard )
{
for( String regex: mSiteID.keySet() )
{
if( siteID.matches( regex ) )
{
return mSiteID.get( regex );
}
}
}
else
{
return mSiteID.get( siteID );
}
}
return null;
}
public Alias getStatus( int status )
{
return mStatus.get( status );
}
public Alias getUniqueID( int uniqueID )
{
return mUniqueID.get( uniqueID );
}
public Alias getESNAlias( String esn )
{
if( esn != null )
{
if( mESNWildcard )
{
for( String regex: mESN.keySet() )
{
if( esn.matches( regex ) )
{
return mESN.get( regex );
}
}
}
else
{
return mESN.get( esn );
}
}
return null;
}
public Alias getFleetsyncAlias( String ident )
{
if( ident != null )
{
if( mFleetsyncWildcard )
{
for( String regex: mFleetsync.keySet() )
{
if( ident.matches( regex ) )
{
return mFleetsync.get( regex );
}
}
}
else
{
return mFleetsync.get( ident );
}
}
return null;
}
public Alias getLoJackAlias( Function function, String id )
{
if( id != null )
{
for( LoJackFunctionAndID lojack: mLoJack.keySet() )
{
if( lojack.matches( function, id ) )
{
return mLoJack.get( lojack );
}
}
}
return null;
}
public Alias getMDC1200Alias( String ident )
{
if( ident != null )
{
if( mMDC1200Wildcard )
{
for( String regex: mMDC1200.keySet() )
{
if( ident.matches( regex ) )
{
return mMDC1200.get( regex );
}
}
}
else
{
return mMDC1200.get( ident );
}
}
return null;
}
public Alias getMPT1327Alias( String ident )
{
if( ident != null )
{
if( mMPT1327Wildcard )
{
for( String regex: mMPT1327.keySet() )
{
if( ident.matches( regex ) )
{
return mMPT1327.get( regex );
}
}
}
else
{
return mMPT1327.get( ident );
}
}
return null;
}
public Group getGroup( Alias alias )
{
if( alias != null )
{
for( Group group: mGroups )
{
if( group.contains( alias ) )
{
return group;
}
}
}
return null;
}
public Alias getMobileIDNumberAlias( String ident )
{
if( ident != null )
{
if( mMobileIDWildcard )
{
for( String regex: mMobileID.keySet() )
{
if( ident.matches( regex ) )
{
return mMobileID.get( regex );
}
}
}
else
{
return mMobileID.get( ident );
}
}
return null;
}
public Alias getTalkgroupAlias( String tgid )
{
if( tgid != null )
{
if( mTalkgroupWildcard )
{
for( String regex: mTalkgroup.keySet() )
{
if( tgid.matches( regex ) )
{
return mTalkgroup.get( regex );
}
}
}
else
{
return mTalkgroup.get( tgid );
}
}
return null;
}
public String toString()
{
return mName;
}
@XmlAttribute
public String getName()
{
return mName;
}
public void setName( String name )
{
mName = name;
}
public ArrayList<Group> getGroup()
{
return mGroups;
}
public void setGroup( ArrayList<Group> groups )
{
mGroups = groups;
}
public void addGroup( Group group )
{
mGroups.add( group );
}
public void removeGroup( Group group )
{
mGroups.remove( group );
}
@Override
public int compareTo( AliasList otherAliasList )
{
return getName().compareTo( otherAliasList.getName() );
}
public Alias getAlias( String value, MetadataType type )
{
switch( type )
{
case ESN:
return getESNAlias( value );
case FLEETSYNC:
return getFleetsyncAlias( value );
case MDC1200:
return getMDC1200Alias( value );
case MOBILE_ID:
return getMobileIDNumberAlias( value );
case MPT1327:
return getMPT1327Alias( value );
case SITE_ID:
return getSiteID( value );
case STATUS:
if( value != null )
{
try
{
return getStatus( Integer.valueOf( value ) );
}
catch( Exception e )
{
//do nothing, we couldn't parse the int value
}
}
break;
case FROM:
case TO:
return getTalkgroupAlias( value );
case UNIQUE_ID:
if( value != null )
{
try
{
return getUniqueID( Integer.valueOf( value ) );
}
catch( Exception e )
{
//do nothing, we couldn't parse the int value
}
}
break;
default:
break;
}
return null;
}
}

View File

@@ -1,126 +0,0 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 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/>
******************************************************************************/
package alias;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.JSeparator;
import controller.ConfigurableNode;
public class AliasListNode extends ConfigurableNode
{
private static final long serialVersionUID = 1L;
public AliasListNode( AliasList list )
{
super( list );
}
@Override
public JPanel getEditor()
{
return new ListEditor( this );
}
public AliasList getList()
{
return (AliasList)getUserObject();
}
public void init()
{
for( Group group: getList().getGroup() )
{
GroupNode node = new GroupNode( group );
getModel().addNode( node, AliasListNode.this, getChildCount() );
node.init();
}
sort();
}
public String toString()
{
return getList().getName() + " [" + this.getChildCount() + "]";
}
public JPopupMenu getContextMenu()
{
JPopupMenu retVal = new JPopupMenu();
JMenuItem addItem = new JMenuItem( "Add Group" );
addItem.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent e )
{
Group group = new Group();
getList().addGroup( group );
GroupNode node = new GroupNode( group );
getModel().addNode( node,
AliasListNode.this,
AliasListNode.this.getChildCount() );
sort();
getModel().showNode( node );
}
} );
retVal.add( addItem );
retVal.add( new JSeparator() );
JMenuItem deleteItem = new JMenuItem( "Delete" );
deleteItem.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent e )
{
int n = JOptionPane.showConfirmDialog( getModel().getTree(),
"Are you sure you want to permanently delete this node?" );
if( n == JOptionPane.YES_OPTION )
{
AliasDirectoryNode parent = (AliasDirectoryNode)getParent();
parent.getAliasDirectory().removeAliasList( getList() );
save();
getModel().removeNodeFromParent( AliasListNode.this );
}
}
} );
retVal.add( deleteItem );
return retVal;
}
}

View File

@@ -1,562 +0,0 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 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/>
******************************************************************************/
package alias;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import map.MapIcon;
import alias.action.AliasAction;
import alias.action.beep.BeepAction;
import alias.action.beep.BeepActionNode;
import alias.action.clip.ClipAction;
import alias.action.clip.ClipActionNode;
import alias.action.script.ScriptAction;
import alias.action.script.ScriptActionNode;
import alias.id.esn.ESNNode;
import alias.id.esn.Esn;
import alias.id.fleetsync.FleetsyncID;
import alias.id.fleetsync.FleetsyncIDNode;
import alias.id.fleetsync.StatusID;
import alias.id.fleetsync.StatusIDNode;
import alias.id.lojack.LoJackFunctionAndID;
import alias.id.lojack.LoJackIDNode;
import alias.id.mdc.MDC1200ID;
import alias.id.mdc.MDC1200IDNode;
import alias.id.mobileID.MINNode;
import alias.id.mobileID.Min;
import alias.id.mpt1327.MPT1327ID;
import alias.id.mpt1327.MPT1327IDNode;
import alias.id.siteID.SiteID;
import alias.id.siteID.SiteIDNode;
import alias.id.talkgroup.TalkgroupID;
import alias.id.talkgroup.TalkgroupIDNode;
import alias.id.uniqueID.UniqueID;
import alias.id.uniqueID.UniqueIDNode;
import alias.priority.Priority;
import alias.priority.PriorityNode;
import alias.record.NonRecordable;
import alias.record.NonRecordableNode;
import controller.ConfigurableNode;
public class AliasNode extends ConfigurableNode
{
private static final long serialVersionUID = 1L;
public AliasNode( Alias alias )
{
super( alias );
}
@Override
public JPanel getEditor()
{
return new AliasEditor( this, getModel().getResourceManager() );
}
public Alias getAlias()
{
return (Alias)getUserObject();
}
public String getIconPath()
{
String icon = getAlias().getIconName();
MapIcon mapIcon = getModel().getResourceManager()
.getSettingsManager().getMapIcon( icon );
if( mapIcon != null )
{
return mapIcon.getPath();
}
else
{
return null;
}
}
public void init()
{
for( AliasID aliasID: getAlias().getId() )
{
switch( aliasID.getType() )
{
case ESN:
getModel().addNode( new ESNNode( (Esn)aliasID ),
AliasNode.this, getChildCount() );
break;
case Fleetsync:
getModel().addNode( new FleetsyncIDNode( (FleetsyncID)aliasID ),
AliasNode.this, getChildCount() );
break;
case LoJack:
getModel().addNode( new LoJackIDNode( (LoJackFunctionAndID)aliasID ),
AliasNode.this, getChildCount() );
break;
case LTRNetUID:
getModel().addNode( new UniqueIDNode( (UniqueID)aliasID ),
AliasNode.this, getChildCount() );
break;
case MDC1200:
getModel().addNode( new MDC1200IDNode( (MDC1200ID)aliasID ),
AliasNode.this, getChildCount() );
break;
case MIN:
getModel().addNode( new MINNode( (Min)aliasID ),
AliasNode.this, getChildCount() );
break;
case MPT1327:
getModel().addNode( new MPT1327IDNode( (MPT1327ID)aliasID ),
AliasNode.this, getChildCount() );
break;
case NonRecordable:
getModel().addNode( new NonRecordableNode( (NonRecordable)aliasID ),
AliasNode.this, getChildCount() );
break;
case Priority:
getModel().addNode( new PriorityNode( (Priority)aliasID ),
AliasNode.this, getChildCount() );
break;
case Site:
getModel().addNode( new SiteIDNode( (SiteID)aliasID ),
AliasNode.this, getChildCount() );
break;
case Status:
getModel().addNode( new StatusIDNode( (StatusID)aliasID ),
AliasNode.this, getChildCount() );
break;
case Talkgroup:
getModel().addNode( new TalkgroupIDNode( (TalkgroupID)aliasID ),
AliasNode.this, getChildCount() );
break;
default:
throw new IllegalArgumentException( "Unrecognized alias ID [" +
aliasID.getType() + "]");
}
}
for( AliasAction action: getAlias().getAction() )
{
if( action instanceof BeepAction )
{
getModel().addNode( new BeepActionNode( (BeepAction)action ),
AliasNode.this, getChildCount() );
}
else if( action instanceof ClipAction )
{
getModel().addNode( new ClipActionNode( (ClipAction)action ),
AliasNode.this, getChildCount() );
}
else if( action instanceof ScriptAction )
{
getModel().addNode( new ScriptActionNode( (ScriptAction)action ),
AliasNode.this, getChildCount() );
}
}
sort();
}
public String toString()
{
return getAlias().getName() + " [" + this.getChildCount() + "]";
}
public JPopupMenu getContextMenu()
{
JPopupMenu retVal = new JPopupMenu();
JMenu addIDMenu = new JMenu( "Add ID" );
JMenuItem addESNItem = new JMenuItem( "ESN" );
addESNItem.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent e )
{
Esn esn = new Esn();
getAlias().addAliasID( esn );
ESNNode node = new ESNNode( esn );
getModel().addNode( node,
AliasNode.this,
AliasNode.this.getChildCount() );
node.show();
}
} );
addIDMenu.add( addESNItem );
JMenuItem addFleetsyncItem = new JMenuItem( "Fleetsync" );
addFleetsyncItem.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent e )
{
FleetsyncID fs = new FleetsyncID();
getAlias().addAliasID( fs );
FleetsyncIDNode node = new FleetsyncIDNode( fs );
getModel().addNode( node,
AliasNode.this,
AliasNode.this.getChildCount() );
node.show();
}
} );
addIDMenu.add( addFleetsyncItem );
JMenuItem addLoJackItem = new JMenuItem( "LoJack" );
addLoJackItem.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent e )
{
LoJackFunctionAndID lj = new LoJackFunctionAndID();
getAlias().addAliasID( lj );
LoJackIDNode node = new LoJackIDNode( lj );
getModel().addNode( node,
AliasNode.this,
AliasNode.this.getChildCount() );
node.show();
}
} );
addIDMenu.add( addLoJackItem );
JMenuItem addMDCItem = new JMenuItem( "MDC-1200" );
addMDCItem.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent e )
{
MDC1200ID mdc = new MDC1200ID();
getAlias().addAliasID( mdc );
MDC1200IDNode node = new MDC1200IDNode( mdc );
getModel().addNode( node,
AliasNode.this,
AliasNode.this.getChildCount() );
node.show();
}
} );
addIDMenu.add( addMDCItem );
JMenuItem addMINItem = new JMenuItem( "MIN" );
addMINItem.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent e )
{
Min min = new Min();
getAlias().addAliasID( min );
MINNode node = new MINNode( min );
getModel().addNode( node,
AliasNode.this,
AliasNode.this.getChildCount() );
node.show();
}
} );
addIDMenu.add( addMINItem );
JMenuItem addMPTItem = new JMenuItem( "MPT-1327" );
addMPTItem.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent e )
{
MPT1327ID mpt = new MPT1327ID();
getAlias().addAliasID( mpt );
MPT1327IDNode node = new MPT1327IDNode( mpt );
getModel().addNode( node,
AliasNode.this,
AliasNode.this.getChildCount() );
node.show();
}
} );
addIDMenu.add( addMPTItem );
JMenuItem addSiteItem = new JMenuItem( "Site" );
addSiteItem.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent e )
{
SiteID siteID = new SiteID();
getAlias().addAliasID( siteID );
SiteIDNode node = new SiteIDNode( siteID );
getModel().addNode( node,
AliasNode.this,
AliasNode.this.getChildCount() );
node.show();
}
} );
addIDMenu.add( addSiteItem );
JMenuItem addStatusItem = new JMenuItem( "Status" );
addStatusItem.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent e )
{
StatusID statusID = new StatusID();
getAlias().addAliasID( statusID );
StatusIDNode node = new StatusIDNode( statusID );
getModel().addNode( node,
AliasNode.this,
AliasNode.this.getChildCount() );
node.show();
}
} );
addIDMenu.add( addStatusItem );
JMenuItem addTalkgroupItem = new JMenuItem( "Talkgroup" );
addTalkgroupItem.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent e )
{
TalkgroupID tg = new TalkgroupID();
getAlias().addAliasID( tg );
TalkgroupIDNode node = new TalkgroupIDNode( tg );
getModel().addNode( node,
AliasNode.this,
AliasNode.this.getChildCount() );
node.show();
}
} );
addIDMenu.add( addTalkgroupItem );
JMenuItem addUniqueIDItem = new JMenuItem( "Unique ID" );
addUniqueIDItem.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent e )
{
UniqueID uid = new UniqueID();
getAlias().addAliasID( uid );
UniqueIDNode node = new UniqueIDNode( uid );
getModel().addNode( node,
AliasNode.this,
AliasNode.this.getChildCount() );
node.show();
}
} );
addIDMenu.add( addUniqueIDItem );
retVal.add( addIDMenu );
JMenu addActionMenu = new JMenu( "Add Action" );
JMenuItem addClipItem = new JMenuItem( "Audio Clip" );
addClipItem.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent e )
{
ClipAction clipAction = new ClipAction();
getAlias().addAliasAction( clipAction );
ClipActionNode node = new ClipActionNode( clipAction );
getModel().addNode( node,
AliasNode.this,
AliasNode.this.getChildCount() );
node.show();
}
} );
addActionMenu.add( addClipItem );
JMenuItem addBeepItem = new JMenuItem( "Beep" );
addBeepItem.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent e )
{
BeepAction beepAction = new BeepAction();
getAlias().addAliasAction( beepAction );
BeepActionNode node = new BeepActionNode( beepAction );
getModel().addNode( node,
AliasNode.this,
AliasNode.this.getChildCount() );
node.show();
}
} );
addActionMenu.add( addBeepItem );
JMenuItem addScriptItem = new JMenuItem( "Script" );
addScriptItem.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent e )
{
ScriptAction scriptAction = new ScriptAction();
getAlias().addAliasAction( scriptAction );
ScriptActionNode node = new ScriptActionNode( scriptAction );
getModel().addNode( node,
AliasNode.this,
AliasNode.this.getChildCount() );
node.show();
}
} );
addActionMenu.add( addScriptItem );
retVal.add( addActionMenu );
retVal.addSeparator();
if( getAlias().isRecordable() )
{
JMenuItem nonRecordableItem = new JMenuItem( "Set Non-Recordable" );
nonRecordableItem.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent e )
{
NonRecordable non = new NonRecordable();
getAlias().addAliasID( non );
NonRecordableNode node = new NonRecordableNode( non );
getModel().addNode( node,
AliasNode.this,
AliasNode.this.getChildCount() );
node.show();
}
} );
retVal.add( nonRecordableItem );
retVal.addSeparator();
}
if( !getAlias().hasPriority() )
{
JMenuItem priorityItem = new JMenuItem( "Set Call Priority" );
priorityItem.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent e )
{
Priority priority = new Priority();
getAlias().addAliasID( priority );
PriorityNode node = new PriorityNode( priority );
getModel().addNode( node,
AliasNode.this,
AliasNode.this.getChildCount() );
node.show();
}
} );
retVal.add( priorityItem );
retVal.addSeparator();
}
JMenuItem deleteItem = new JMenuItem( "Delete" );
deleteItem.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent e )
{
int n = JOptionPane.showConfirmDialog( getModel().getTree(),
"Are you sure you want to permanently delete this node?" );
if( n == JOptionPane.YES_OPTION )
{
GroupNode parent = (GroupNode)getParent();
parent.getGroup().removeAlias( getAlias() );
save();
getModel().removeNodeFromParent( AliasNode.this );
}
}
} );
retVal.add( deleteItem );
return retVal;
}
}

View File

@@ -1,73 +0,0 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 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/>
******************************************************************************/
package alias;
import java.util.ArrayList;
import javax.xml.bind.annotation.XmlAttribute;
public class Group
{
private String mName;
private ArrayList<Alias> mAliases = new ArrayList<Alias>();
public Group()
{
}
public String toString()
{
return "Group: " + mName;
}
@XmlAttribute
public String getName()
{
return mName;
}
public void setName( String name )
{
mName = name;
}
public ArrayList<Alias> getAlias()
{
return mAliases;
}
public void setAlias( ArrayList<Alias> aliases )
{
mAliases = aliases;
}
public void addAlias( Alias alias )
{
mAliases.add( alias );
}
public void removeAlias( Alias alias )
{
mAliases.remove( alias );
}
public boolean contains( Alias alias )
{
return mAliases.contains( alias );
}
}

View File

@@ -1,110 +0,0 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 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/>
******************************************************************************/
package alias;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.tree.TreePath;
import net.miginfocom.swing.MigLayout;
import controller.ConfigurableNode;
public class GroupEditor extends JPanel implements ActionListener
{
private static final long serialVersionUID = 1L;
private GroupNode mGroupNode;
private JLabel mLabelName;
private JTextField mTextGroup;
public GroupEditor( GroupNode groupNode )
{
mGroupNode = groupNode;
initGUI();
}
private void initGUI()
{
setLayout( new MigLayout( "", "[right][grow,fill]", "[][][grow]" ) );
setBorder( BorderFactory.createTitledBorder( "Group" ) );
mLabelName = new JLabel( "Name:" );
add( mLabelName, "align right" );
mTextGroup = new JTextField( mGroupNode.getGroup().getName() );
add( mTextGroup, "wrap" );
JButton btnSave = new JButton( "Save" );
btnSave.addActionListener( GroupEditor.this );
add( btnSave );
JButton btnReset = new JButton( "Reset" );
btnReset.addActionListener( GroupEditor.this );
add( btnReset, "wrap" );
}
@Override
public void actionPerformed( ActionEvent e )
{
String command = e.getActionCommand();
if( command.contentEquals( "Save" ) )
{
String group = mTextGroup.getText();
if( group != null )
{
boolean expanded = mGroupNode.getModel().getTree()
.isExpanded( new TreePath( mGroupNode ) );
mGroupNode.getGroup().setName( group );
((ConfigurableNode)mGroupNode.getParent()).sort();
mGroupNode.save();
mGroupNode.show();
if( expanded )
{
mGroupNode.getModel().getTree()
.expandPath( new TreePath( mGroupNode ) );
}
}
else
{
JOptionPane.showMessageDialog( GroupEditor.this, "Please enter a group name" );
}
}
else if( command.contentEquals( "Reset" ) )
{
mTextGroup.setText( mGroupNode.getGroup().getName() );
}
mGroupNode.refresh();
}
}

View File

@@ -1,126 +0,0 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 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/>
******************************************************************************/
package alias;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.JSeparator;
import controller.ConfigurableNode;
public class GroupNode extends ConfigurableNode
{
private static final long serialVersionUID = 1L;
public GroupNode( Group group )
{
super( group );
}
@Override
public JPanel getEditor()
{
return new GroupEditor( this );
}
public Group getGroup()
{
return (Group)getUserObject();
}
public void init()
{
for( Alias alias: getGroup().getAlias() )
{
AliasNode node = new AliasNode( alias );
getModel().addNode( node, GroupNode.this, getChildCount() );
node.init();
}
sort();
}
public String toString()
{
return getGroup().getName() + " [" + this.getChildCount() + "]";
}
public JPopupMenu getContextMenu()
{
JPopupMenu retVal = new JPopupMenu();
JMenuItem addItem = new JMenuItem( "Add Alias" );
addItem.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent e )
{
Alias alias = new Alias();
getGroup().addAlias( alias );
AliasNode node = new AliasNode( alias );
getModel().addNode( node,
GroupNode.this,
GroupNode.this.getChildCount() );
sort();
getModel().showNode( node );
}
} );
retVal.add( addItem );
retVal.add( new JSeparator() );
JMenuItem deleteItem = new JMenuItem( "Delete" );
deleteItem.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent e )
{
int n = JOptionPane.showConfirmDialog( getModel().getTree(),
"Are you sure you want to permanently delete this node?" );
if( n == JOptionPane.YES_OPTION )
{
AliasListNode parent = (AliasListNode)getParent();
parent.getList().removeGroup( getGroup() );
save();
getModel().removeNodeFromParent( GroupNode.this );
}
}
} );
retVal.add( deleteItem );
return retVal;
}
}

View File

@@ -1,107 +0,0 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 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/>
******************************************************************************/
package alias;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.tree.TreePath;
import net.miginfocom.swing.MigLayout;
import controller.ConfigurableNode;
public class ListEditor extends JPanel implements ActionListener
{
private static final long serialVersionUID = 1L;
private AliasListNode mListNode;
private JLabel mLabelName;
private JTextField mTextGroup;
public ListEditor( AliasListNode listNode )
{
mListNode = listNode;
initGUI();
}
private void initGUI()
{
setLayout( new MigLayout( "", "[right][grow,fill]", "[][][grow]" ) );
setBorder( BorderFactory.createTitledBorder( "List" ) );
mLabelName = new JLabel( "Name:" );
add( mLabelName, "align right" );
mTextGroup = new JTextField( mListNode.getList().getName() );
add( mTextGroup, "grow, wrap" );
JButton btnSave = new JButton( "Save" );
btnSave.addActionListener( ListEditor.this );
add( btnSave );
JButton btnReset = new JButton( "Reset" );
btnReset.addActionListener( ListEditor.this );
add( btnReset, "wrap" );
}
@Override
public void actionPerformed( ActionEvent e )
{
String command = e.getActionCommand();
if( command.contentEquals( "Save" ) )
{
String group = mTextGroup.getText();
if( group != null )
{
boolean expanded = mListNode.getModel().getTree()
.isExpanded( new TreePath( mListNode ) );
mListNode.getList().setName( group );
((ConfigurableNode)mListNode.getParent()).sort();
mListNode.save();
mListNode.show();
if( expanded )
{
mListNode.getModel().getTree().expandPath( new TreePath( mListNode ) );
}
}
else
{
JOptionPane.showMessageDialog( ListEditor.this, "Please enter a list name" );
}
}
else if( command.contentEquals( "Reset" ) )
{
mTextGroup.setText( mListNode.getList().getName() );
}
mListNode.refresh();
}
}

View File

@@ -1,30 +0,0 @@
package alias.action;
import message.Message;
import alias.Alias;
import controller.ThreadPoolManager;
/**
* Alias action defines an action to execute when an alias is detected active.
*/
public abstract class AliasAction
{
public AliasAction()
{
}
/**
* Task to execute when an alias action is defined. The message argument is
* the original message containing one or more aliases that have an alias
* action attached. The alias argument is the parent alias containing the
* alias action.
*/
public abstract void execute( ThreadPoolManager threadPoolManager,
Alias alias,
Message message );
/**
* Dismiss a persistent alias action
*/
public abstract void dismiss( boolean reset );
}

View File

@@ -1,62 +0,0 @@
package alias.action;
import java.util.List;
import message.Message;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import sample.Listener;
import alias.Alias;
import controller.ResourceManager;
/**
* Manages all alias action events. Each received message is interrogated for
* any alias entries and then each alias is interrogated for any alias actions.
*
* Each alias action is executed and provided a copy of the source message so
* that the contents of the message can be used as part of the action.
*/
public class AliasActionManager implements Listener<Message>
{
private final static Logger mLog =
LoggerFactory.getLogger( AliasActionManager.class );
private ResourceManager mResourceManager;
public AliasActionManager( ResourceManager resourceManager )
{
mResourceManager = resourceManager;
}
@Override
public void receive( Message message )
{
if( message.isValid() )
{
List<Alias> aliases = message.getAliases();
if( aliases != null )
{
for( Alias alias: aliases )
{
if( alias.hasActions() )
{
List<AliasAction> actions = alias.getAction();
for( AliasAction action: actions )
{
/* Provide access to the thread pool manager in case the
* action needs to setup a timer, and provide the original
* message to be used as part of the action (e.g. sending
* the message as a text message to a cell phone */
action.execute( mResourceManager.getThreadPoolManager(),
alias, message );
}
}
}
}
}
}
}

View File

@@ -1,40 +0,0 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 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/>
******************************************************************************/
package alias.action;
import controller.ConfigurableNode;
public class AliasActionNode extends ConfigurableNode
{
private static final long serialVersionUID = 1L;
public AliasActionNode( AliasAction action )
{
super( action );
}
public void save()
{
getModel().getResourceManager().getPlaylistManager().save();
}
public String getIconPath()
{
return "images/action.png";
}
}

View File

@@ -1,188 +0,0 @@
package alias.action;
import java.awt.EventQueue;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import javax.swing.JOptionPane;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlTransient;
import message.Message;
import alias.Alias;
import controller.ThreadPoolManager;
import controller.ThreadPoolManager.ThreadType;
public abstract class RecurringAction extends AliasAction
{
@XmlTransient
protected AtomicBoolean mRunning = new AtomicBoolean( false );
@XmlTransient
private ScheduledFuture<?> mPerpetualAction;
protected Interval mInterval = Interval.ONCE;
protected int mPeriod = 5;
protected ThreadPoolManager mThreadPoolManager;
public abstract void performAction( Alias alias, Message message );
@Override
public void execute( ThreadPoolManager threadPoolManager,
Alias alias,
Message message )
{
mThreadPoolManager = threadPoolManager;
if( mRunning.compareAndSet( false, true ) )
{
switch( mInterval )
{
case ONCE:
performThreadedAction( alias, message );
/* Don't reset */
break;
case DELAYED_RESET:
performThreadedAction( alias, message );
mThreadPoolManager.scheduleOnce( new ResetTask(),
mPeriod, TimeUnit.SECONDS );
break;
case UNTIL_DISMISSED:
mPerpetualAction = mThreadPoolManager
.scheduleFixedRate( ThreadType.DECODER,
new PerformActionTask( alias, message ),
mPeriod, TimeUnit.SECONDS );
StringBuilder sb = new StringBuilder();
sb.append( "<html><div width='250'>Alias [" );
sb.append( alias.getName() );
sb.append( "] is active in message [" );
sb.append( message.toString() );
sb.append( "]</div></html>" );
final String text = sb.toString();
EventQueue.invokeLater( new Runnable()
{
@Override
public void run()
{
JOptionPane.showMessageDialog( null, text,
"Alias Alert", JOptionPane.INFORMATION_MESSAGE );
dismiss( false );
mThreadPoolManager.scheduleOnce( new ResetTask(),
15, TimeUnit.SECONDS );
}
} );
break;
default:
}
}
}
/**
* Spawns the performAction() event into a new thread so that it doesn't
* delay any decoder actions.
*/
private void performThreadedAction( final Alias alias, final Message message )
{
mThreadPoolManager.scheduleOnce( new Runnable() {
@Override
public void run()
{
performAction( alias, message );
}}, 0, TimeUnit.SECONDS );
}
@Override
public void dismiss( boolean reset )
{
if( mPerpetualAction != null )
{
mPerpetualAction.cancel( true );
mPerpetualAction = null;
}
if( reset )
{
mRunning.set( false );
}
}
@XmlAttribute
public int getPeriod()
{
return mPeriod;
}
public void setPeriod( int period )
{
mPeriod = period;
}
@XmlAttribute
public Interval getInterval()
{
return mInterval;
}
public void setInterval( Interval interval )
{
mInterval = interval;
mRunning.set( false );
}
public enum Interval
{
ONCE( "Once" ),
DELAYED_RESET( "Once, Reset After Delay" ),
UNTIL_DISMISSED( "Until Dismissed" );
private String mLabel;
private Interval( String label )
{
mLabel = label;
}
public String toString()
{
return mLabel;
}
}
public class PerformActionTask implements Runnable
{
private Alias mAlias;
private Message mMessage;
public PerformActionTask( Alias alias, Message message )
{
mAlias = alias;
mMessage = message;
}
@Override
public void run()
{
/* Don't use the performThreadedAction() method, since this is
* already running in a separate thread */
performAction( mAlias, mMessage );
}
}
public class ResetTask implements Runnable
{
@Override
public void run()
{
mRunning.set( false );
}
}
}

View File

@@ -1,14 +0,0 @@
package alias.action.beep;
import message.Message;
import alias.Alias;
import alias.action.RecurringAction;
public class BeepAction extends RecurringAction
{
@Override
public void performAction( Alias alias, Message message )
{
System.out.println( "\007" );
}
}

View File

@@ -1,151 +0,0 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 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/>
******************************************************************************/
package alias.action.beep;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JSpinner;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.SpinnerModel;
import javax.swing.SpinnerNumberModel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import net.miginfocom.swing.MigLayout;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import alias.action.RecurringAction.Interval;
public class BeepActionEditor extends JPanel implements ActionListener
{
private static final long serialVersionUID = 1L;
private final static Logger mLog =
LoggerFactory.getLogger( BeepActionEditor.class );
private BeepActionNode mBeepActionNode;
private JTextField mTextSiteID;
private JComboBox<Interval> mComboInterval;
private JSpinner mSpinnerPeriod;
public BeepActionEditor( BeepActionNode beepActionNode )
{
mBeepActionNode = beepActionNode;
initGUI();
}
private void initGUI()
{
setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][][][][][grow]" ) );
add( new JLabel( "Action: Beep" ), "span,align center" );
add( new JLabel( "Interval:" ) );
mComboInterval = new JComboBox<Interval>( Interval.values() );
mComboInterval.setSelectedItem( mBeepActionNode.getBeepAction().getInterval() );
mComboInterval.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent e )
{
Interval selected = mComboInterval
.getItemAt( mComboInterval.getSelectedIndex() );
if( selected != null )
{
/* Enable/disable period spinner based on selection */
mSpinnerPeriod.setEnabled( selected != Interval.ONCE );
mBeepActionNode.getBeepAction().setInterval( selected );
}
}
});
add( mComboInterval, "wrap" );
final SpinnerModel model = new SpinnerNumberModel(
mBeepActionNode.getBeepAction().getPeriod(), 1, 30, 1 );
model.addChangeListener( new ChangeListener()
{
@Override
public void stateChanged( ChangeEvent e )
{
mBeepActionNode.getBeepAction().setPeriod( (int)model.getValue() );
}
} );
mSpinnerPeriod = new JSpinner( model );
if( mBeepActionNode.getBeepAction().getInterval() == Interval.ONCE )
{
mSpinnerPeriod.setEnabled( false );
}
add( new JLabel( "Period:" ) );
add( mSpinnerPeriod, "wrap" );
StringBuilder sb = new StringBuilder();
sb.append( "This action will sound a beep according to the interval that you select.\n\n" );
sb.append( "Once - Beep the first time the alias is active and never again.\n\n" );
sb.append( "Once, Reset After Delay - Beep once and suppress subsequent beeps for the specified period in seconds. After the reset period, it will beep again when the alias is active.\n\n" );
sb.append( "Until Dismissed - Beep every period seconds until you click OK on the dialog that appears. Alerting is suppressed for 15 seconds after you click OK." );
JTextArea description = new JTextArea( sb.toString() );
description.setLineWrap( true );
description.setBackground( getBackground() );
add( description, "growx,span" );
JButton btnSave = new JButton( "Save" );
btnSave.addActionListener( BeepActionEditor.this );
add( btnSave, "growx,push" );
JButton btnReset = new JButton( "Reset" );
btnReset.addActionListener( BeepActionEditor.this );
add( btnReset, "growx,push" );
}
@Override
public void actionPerformed( ActionEvent e )
{
String command = e.getActionCommand();
if( command.contentEquals( "Save" ) )
{
mBeepActionNode.save();
mBeepActionNode.show();
}
mBeepActionNode.refresh();
}
}

View File

@@ -1,88 +0,0 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 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/>
******************************************************************************/
package alias.action.beep;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import alias.AliasNode;
import alias.action.AliasActionNode;
public class BeepActionNode extends AliasActionNode
{
private static final long serialVersionUID = 1L;
public BeepActionNode( BeepAction beepAction )
{
super( beepAction );
}
@Override
public JPanel getEditor()
{
return new BeepActionEditor( this );
}
public BeepAction getBeepAction()
{
return (BeepAction)getUserObject();
}
public String toString()
{
return "Action: Beep";
}
public JPopupMenu getContextMenu()
{
JPopupMenu retVal = new JPopupMenu();
JMenuItem deleteItem = new JMenuItem( "Delete" );
deleteItem.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent e )
{
int n = JOptionPane.showConfirmDialog( getModel().getTree(),
"Are you sure you want to permanently delete this node?" );
if( n == JOptionPane.YES_OPTION )
{
AliasNode parent = (AliasNode)getParent();
parent.getAlias().removeAliasAction( getBeepAction() );
/* Save before removing the node ... so that we still have
* a reference to the parent's resources */
save();
getModel().removeNodeFromParent( BeepActionNode.this );
}
}
} );
retVal.add( deleteItem );
return retVal;
}
}

View File

@@ -1,90 +0,0 @@
package alias.action.clip;
import java.io.File;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.Clip;
import javax.xml.bind.annotation.XmlTransient;
import message.Message;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import alias.Alias;
import alias.action.RecurringAction;
public class ClipAction extends RecurringAction
{
private final static Logger mLog = LoggerFactory.getLogger( ClipAction.class );
private String mFilePath;
@XmlTransient
private Clip mClip;
public ClipAction()
{
}
public String getPath()
{
return mFilePath;
}
public void setPath( String path )
{
mFilePath = path;
}
@Override
public void performAction( Alias alias, Message message )
{
try
{
play();
}
catch( Exception e )
{
mLog.error( "Couldn't play audio clip", e );
}
}
public void play() throws Exception
{
try
{
if( mFilePath != null )
{
if( mClip == null )
{
mClip = AudioSystem.getClip();
AudioInputStream ais =
AudioSystem.getAudioInputStream( new File( mFilePath ) );
mClip.open( ais );
}
if( mClip.isRunning() )
{
mClip.stop();
}
mClip.setFramePosition( 0 );
mClip.start();
}
}
catch( Exception e )
{
mClip = null;
mLog.error( "Error playing sound clip [" + mFilePath + "] - " + e.getMessage() );
throw e;
}
}
}

View File

@@ -1,218 +0,0 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 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/>
******************************************************************************/
package alias.action.clip;
import java.awt.EventQueue;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFileChooser;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JSpinner;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.SpinnerModel;
import javax.swing.SpinnerNumberModel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import net.miginfocom.swing.MigLayout;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import alias.action.RecurringAction.Interval;
public class ClipActionEditor extends JPanel implements ActionListener
{
private static final long serialVersionUID = 1L;
private final static Logger mLog =
LoggerFactory.getLogger( ClipActionEditor.class );
private ClipActionNode mClipActionNode;
private JComboBox<Interval> mComboInterval;
private JSpinner mSpinnerPeriod;
private JTextField mTextFilePath;
public ClipActionEditor( ClipActionNode clipActionNode )
{
mClipActionNode = clipActionNode;
initGUI();
}
private void initGUI()
{
setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][][][][][grow]" ) );
add( new JLabel( "Action: Audio Clip" ), "span,align center" );
add( new JLabel( "Interval:" ) );
mComboInterval = new JComboBox<Interval>( Interval.values() );
mComboInterval.setSelectedItem( mClipActionNode.getClipAction().getInterval() );
mComboInterval.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent e )
{
Interval selected = mComboInterval
.getItemAt( mComboInterval.getSelectedIndex() );
if( selected != null )
{
/* Enable/disable period spinner based on selection */
mSpinnerPeriod.setEnabled( selected != Interval.ONCE );
mClipActionNode.getClipAction().setInterval( selected );
}
}
});
add( mComboInterval, "wrap" );
final SpinnerModel model = new SpinnerNumberModel(
mClipActionNode.getClipAction().getPeriod(), 1, 30, 1 );
model.addChangeListener( new ChangeListener()
{
@Override
public void stateChanged( ChangeEvent e )
{
mClipActionNode.getClipAction().setPeriod( (int)model.getValue() );
}
} );
mSpinnerPeriod = new JSpinner( model );
if( mClipActionNode.getClipAction().getInterval() == Interval.ONCE )
{
mSpinnerPeriod.setEnabled( false );
}
add( new JLabel( "Period:" ) );
add( mSpinnerPeriod, "wrap" );
JButton fileButton = new JButton( "File" );
fileButton.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent e )
{
final JFileChooser chooser = new JFileChooser();
int value = chooser.showOpenDialog( ClipActionEditor.this );
if( value == JFileChooser.APPROVE_OPTION )
{
File file = chooser.getSelectedFile();
mClipActionNode.getClipAction().setPath( file.getAbsolutePath() );
mTextFilePath.setText( file.getAbsolutePath() );
}
}
} );
add( fileButton );
JButton testButton = new JButton( "Test" );
testButton.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent actionEvent )
{
String path = mClipActionNode.getClipAction().getPath();
if( path == null || path.trim().isEmpty() )
{
JOptionPane.showMessageDialog( ClipActionEditor.this,
"Please select an audio file", "Please select file",
JOptionPane.ERROR_MESSAGE );
}
EventQueue.invokeLater( new Runnable()
{
@Override
public void run()
{
try
{
mClipActionNode.getClipAction().play();
}
catch( Exception e )
{
JOptionPane.showMessageDialog( ClipActionEditor.this,
"Couldn't play audio clip [" + e.getMessage() + "]",
"Error", JOptionPane.ERROR_MESSAGE );
}
}
} );
}
} );
add( testButton, "wrap" );
mTextFilePath = new JTextField( mClipActionNode.getClipAction().getPath() );
add( mTextFilePath, "growx,span" );
StringBuilder sb = new StringBuilder();
sb.append( "This action will play the audio clip according to the interval that you select.\n\n" );
sb.append( "Once - Play the first time the alias is active and never again.\n\n" );
sb.append( "Once, Reset After Delay - Play once and suppress subsequent plays for the specified period in seconds. After the reset period, it will play again when the alias is active.\n\n" );
sb.append( "Until Dismissed - Play audio clip every period seconds until you click OK on the dialog that appears. Alerting is suppressed for 15 seconds after you click OK." );
JTextArea description = new JTextArea( sb.toString() );
description.setLineWrap( true );
description.setBackground( getBackground() );
add( description, "growx,span" );
JButton btnSave = new JButton( "Save" );
btnSave.addActionListener( ClipActionEditor.this );
add( btnSave, "growx,push" );
JButton btnReset = new JButton( "Reset" );
btnReset.addActionListener( ClipActionEditor.this );
add( btnReset, "growx,push" );
}
@Override
public void actionPerformed( ActionEvent e )
{
String command = e.getActionCommand();
if( command.contentEquals( "Save" ) )
{
mClipActionNode.save();
mClipActionNode.show();
}
mClipActionNode.refresh();
}
}

View File

@@ -1,88 +0,0 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 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/>
******************************************************************************/
package alias.action.clip;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import alias.AliasNode;
import alias.action.AliasActionNode;
public class ClipActionNode extends AliasActionNode
{
private static final long serialVersionUID = 1L;
public ClipActionNode( ClipAction clipAction )
{
super( clipAction );
}
@Override
public JPanel getEditor()
{
return new ClipActionEditor( this );
}
public ClipAction getClipAction()
{
return (ClipAction)getUserObject();
}
public String toString()
{
return "Action: Audio Clip";
}
public JPopupMenu getContextMenu()
{
JPopupMenu retVal = new JPopupMenu();
JMenuItem deleteItem = new JMenuItem( "Delete" );
deleteItem.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent e )
{
int n = JOptionPane.showConfirmDialog( getModel().getTree(),
"Are you sure you want to permanently delete this node?" );
if( n == JOptionPane.YES_OPTION )
{
AliasNode parent = (AliasNode)getParent();
parent.getAlias().removeAliasAction( getClipAction() );
/* Save before removing the node ... so that we still have
* a reference to the parent's resources */
save();
getModel().removeNodeFromParent( ClipActionNode.this );
}
}
} );
retVal.add( deleteItem );
return retVal;
}
}

View File

@@ -1,78 +0,0 @@
package alias.action.script;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import message.Message;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import alias.Alias;
import alias.action.RecurringAction;
public class ScriptAction extends RecurringAction
{
private final static Logger mLog = LoggerFactory.getLogger( ScriptAction.class );
private String mScript;
public ScriptAction()
{
}
public String getScript()
{
return mScript;
}
public void setScript( String script )
{
mScript = script;
}
@Override
public void performAction( Alias alias, Message message )
{
try
{
play();
}
catch( Exception e )
{
mLog.error( "Couldn't execute script [" + mScript + "]", e );
}
}
public void play() throws Exception
{
if( mScript != null )
{
ProcessBuilder pb = new ProcessBuilder( mScript );
pb.redirectErrorStream( true );
Process p = pb.start();
int exitCode = p.waitFor();
BufferedReader reader = new BufferedReader(
new InputStreamReader( p.getInputStream() ) );
String line = "";
StringBuilder sb = new StringBuilder();
while( ( line = reader.readLine() ) != null )
{
sb.append(line + "\n");
}
if( exitCode != 0 )
{
throw new RuntimeException( "Exit Code: " + exitCode +
" Console:" + sb.toString() );
}
}
}
}

View File

@@ -1,218 +0,0 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 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/>
******************************************************************************/
package alias.action.script;
import java.awt.EventQueue;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFileChooser;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JSpinner;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.SpinnerModel;
import javax.swing.SpinnerNumberModel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import net.miginfocom.swing.MigLayout;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import alias.action.RecurringAction.Interval;
public class ScriptActionEditor extends JPanel implements ActionListener
{
private static final long serialVersionUID = 1L;
private final static Logger mLog =
LoggerFactory.getLogger( ScriptActionEditor.class );
private ScriptActionNode mScriptActionNode;
private JComboBox<Interval> mComboInterval;
private JSpinner mSpinnerPeriod;
private JTextField mTextFilePath;
public ScriptActionEditor( ScriptActionNode clipActionNode )
{
mScriptActionNode = clipActionNode;
initGUI();
}
private void initGUI()
{
setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][][][][][grow]" ) );
add( new JLabel( "Action: Script" ), "span,align center" );
add( new JLabel( "Interval:" ) );
mComboInterval = new JComboBox<Interval>( Interval.values() );
mComboInterval.setSelectedItem( mScriptActionNode.getScriptAction().getInterval() );
mComboInterval.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent e )
{
Interval selected = mComboInterval
.getItemAt( mComboInterval.getSelectedIndex() );
if( selected != null )
{
/* Enable/disable period spinner based on selection */
mSpinnerPeriod.setEnabled( selected != Interval.ONCE );
mScriptActionNode.getScriptAction().setInterval( selected );
}
}
});
add( mComboInterval, "wrap" );
final SpinnerModel model = new SpinnerNumberModel(
mScriptActionNode.getScriptAction().getPeriod(), 1, 30, 1 );
model.addChangeListener( new ChangeListener()
{
@Override
public void stateChanged( ChangeEvent e )
{
mScriptActionNode.getScriptAction().setPeriod( (int)model.getValue() );
}
} );
mSpinnerPeriod = new JSpinner( model );
if( mScriptActionNode.getScriptAction().getInterval() == Interval.ONCE )
{
mSpinnerPeriod.setEnabled( false );
}
add( new JLabel( "Period:" ) );
add( mSpinnerPeriod, "wrap" );
JButton fileButton = new JButton( "File" );
fileButton.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent e )
{
final JFileChooser chooser = new JFileChooser();
int value = chooser.showOpenDialog( ScriptActionEditor.this );
if( value == JFileChooser.APPROVE_OPTION )
{
File file = chooser.getSelectedFile();
mScriptActionNode.getScriptAction().setScript( file.getAbsolutePath() );
mTextFilePath.setText( file.getAbsolutePath() );
}
}
} );
add( fileButton );
JButton testButton = new JButton( "Test" );
testButton.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent actionEvent )
{
String script = mScriptActionNode.getScriptAction().getScript();
if( script == null || script.trim().isEmpty() )
{
JOptionPane.showMessageDialog( ScriptActionEditor.this,
"Please select a script file", "Please select file",
JOptionPane.ERROR_MESSAGE );
}
EventQueue.invokeLater( new Runnable()
{
@Override
public void run()
{
try
{
mScriptActionNode.getScriptAction().play();
}
catch( Exception e )
{
JOptionPane.showMessageDialog( ScriptActionEditor.this,
"Couldn't run script [" + e.getMessage() + "]",
"Error", JOptionPane.ERROR_MESSAGE );
}
}
} );
}
} );
add( testButton, "wrap" );
mTextFilePath = new JTextField( mScriptActionNode.getScriptAction().getScript() );
add( mTextFilePath, "growx,span" );
StringBuilder sb = new StringBuilder();
sb.append( "This action will run the script according to the interval that you select.\n\n" );
sb.append( "Once - Run script the first time the alias is active and never again.\n\n" );
sb.append( "Once, Reset After Delay - Run once and suppress subsequent runs for the specified period in seconds. After the reset period, it will play again when the alias is active.\n\n" );
sb.append( "Until Dismissed - Run script every period seconds until you click OK on the dialog that appears. Alerting is suppressed for 15 seconds after you click OK." );
JTextArea description = new JTextArea( sb.toString() );
description.setLineWrap( true );
description.setBackground( getBackground() );
add( description, "growx,span" );
JButton btnSave = new JButton( "Save" );
btnSave.addActionListener( ScriptActionEditor.this );
add( btnSave, "growx,push" );
JButton btnReset = new JButton( "Reset" );
btnReset.addActionListener( ScriptActionEditor.this );
add( btnReset, "growx,push" );
}
@Override
public void actionPerformed( ActionEvent e )
{
String command = e.getActionCommand();
if( command.contentEquals( "Save" ) )
{
mScriptActionNode.save();
mScriptActionNode.show();
}
mScriptActionNode.refresh();
}
}

View File

@@ -1,88 +0,0 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 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/>
******************************************************************************/
package alias.action.script;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import alias.AliasNode;
import alias.action.AliasActionNode;
public class ScriptActionNode extends AliasActionNode
{
private static final long serialVersionUID = 1L;
public ScriptActionNode( ScriptAction scriptAction )
{
super( scriptAction );
}
@Override
public JPanel getEditor()
{
return new ScriptActionEditor( this );
}
public ScriptAction getScriptAction()
{
return (ScriptAction)getUserObject();
}
public String toString()
{
return "Action: Script";
}
public JPopupMenu getContextMenu()
{
JPopupMenu retVal = new JPopupMenu();
JMenuItem deleteItem = new JMenuItem( "Delete" );
deleteItem.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent e )
{
int n = JOptionPane.showConfirmDialog( getModel().getTree(),
"Are you sure you want to permanently delete this node?" );
if( n == JOptionPane.YES_OPTION )
{
AliasNode parent = (AliasNode)getParent();
parent.getAlias().removeAliasAction( getScriptAction() );
/* Save before removing the node ... so that we still have
* a reference to the parent's resources */
save();
getModel().removeNodeFromParent( ScriptActionNode.this );
}
}
} );
retVal.add( deleteItem );
return retVal;
}
}

View File

@@ -1,95 +0,0 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 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/>
******************************************************************************/
package alias.id.esn;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
import net.miginfocom.swing.MigLayout;
import controller.ConfigurableNode;
public class ESNEditor extends JPanel implements ActionListener
{
private static final long serialVersionUID = 1L;
private ESNNode mESNNode;
private JTextField mTextESN;
public ESNEditor( ESNNode esnNode )
{
mESNNode = esnNode;
initGUI();
}
private void initGUI()
{
setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][][][grow]" ) );
add( new JLabel( "Electronic Serial Number ID" ), "span,align center" );
add( new JLabel( "ESN:" ) );
mTextESN = new JTextField( mESNNode.getESN().getEsn() );
add( mTextESN, "growx,push" );
JButton btnSave = new JButton( "Save" );
btnSave.addActionListener( ESNEditor.this );
add( btnSave, "growx,push" );
JButton btnReset = new JButton( "Reset" );
btnReset.addActionListener( ESNEditor.this );
add( btnReset, "growx,push" );
}
@Override
public void actionPerformed( ActionEvent e )
{
String command = e.getActionCommand();
if( command.contentEquals( "Save" ) )
{
String esn = mTextESN.getText();
if( esn != null )
{
mESNNode.getESN().setEsn( esn );
((ConfigurableNode)mESNNode.getParent()).sort();
mESNNode.save();
mESNNode.show();
}
else
{
JOptionPane.showMessageDialog( ESNEditor.this, "Please enter an ESN" );
}
}
else if( command.contentEquals( "Reset" ) )
{
mTextESN.setText( mESNNode.getESN().getEsn() );
}
mESNNode.refresh();
}
}

View File

@@ -1,86 +0,0 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 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/>
******************************************************************************/
package alias.id.esn;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import alias.AliasIDNode;
import alias.AliasNode;
public class ESNNode extends AliasIDNode
{
private static final long serialVersionUID = 1L;
public ESNNode( Esn esn )
{
super( esn );
}
@Override
public JPanel getEditor()
{
return new ESNEditor( this );
}
public Esn getESN()
{
return (Esn)getUserObject();
}
public String toString()
{
return "ESN " + getESN().getEsn();
}
public JPopupMenu getContextMenu()
{
JPopupMenu retVal = new JPopupMenu();
JMenuItem addSystemItem = new JMenuItem( "Delete" );
addSystemItem.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent e )
{
int n = JOptionPane.showConfirmDialog( getModel().getTree(),
"Are you sure you want to permanently delete this node?" );
if( n == JOptionPane.YES_OPTION )
{
AliasNode parent = (AliasNode)getParent();
parent.getAlias().removeAliasID( getESN() );
save();
getModel().removeNodeFromParent( ESNNode.this );
}
}
} );
retVal.add( addSystemItem );
return retVal;
}
}

View File

@@ -1,108 +0,0 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 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/>
******************************************************************************/
package alias.id.fleetsync;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import net.miginfocom.swing.MigLayout;
import controller.ConfigurableNode;
public class FleetsyncIDEditor extends JPanel implements ActionListener
{
private static final long serialVersionUID = 1L;
private FleetsyncIDNode mFleetsyncIDNode;
private JLabel mLabelName;
private JTextField mTextIdent;
private String mHelpText = "Enter a formatted fleetsync identifier.\n\n"
+ "Format: PPP-IIII (P=Prefix, I=Identifier)\n\n"
+ "Wildcard: use one or more asterisks (*) for any talkgroup "
+ "digits.\n\n";
public FleetsyncIDEditor( FleetsyncIDNode fsNode )
{
mFleetsyncIDNode = fsNode;
initGUI();
}
private void initGUI()
{
setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][][][grow]" ) );
add( new JLabel( "Fleetsync ID" ), "span,align center" );
add( new JLabel( "Ident:" ) );
mTextIdent = new JTextField( mFleetsyncIDNode.getFleetsyncID().getIdent() );
add( mTextIdent, "grow, wrap" );
JButton btnSave = new JButton( "Save" );
btnSave.addActionListener( FleetsyncIDEditor.this );
add( btnSave, "growx,push" );
JButton btnReset = new JButton( "Reset" );
btnReset.addActionListener( FleetsyncIDEditor.this );
add( btnReset, "growx,push" );
JTextArea helpText = new JTextArea( mHelpText );
helpText.setLineWrap( true );
helpText.setBackground( getBackground() );
add( helpText, "span,grow,push" );
}
@Override
public void actionPerformed( ActionEvent e )
{
String command = e.getActionCommand();
if( command.contentEquals( "Save" ) )
{
String ident = mTextIdent.getText();
if( ident != null )
{
mFleetsyncIDNode.getFleetsyncID().setIdent( ident );
((ConfigurableNode)mFleetsyncIDNode.getParent()).sort();
mFleetsyncIDNode.save();
mFleetsyncIDNode.show();
}
else
{
JOptionPane.showMessageDialog( FleetsyncIDEditor.this, "Please enter an ident" );
}
}
else if( command.contentEquals( "Reset" ) )
{
mTextIdent.setText( mFleetsyncIDNode.getFleetsyncID().getIdent() );
}
mFleetsyncIDNode.refresh();
}
}

View File

@@ -1,97 +0,0 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 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/>
******************************************************************************/
package alias.id.fleetsync;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import alias.AliasIDNode;
import alias.AliasNode;
public class FleetsyncIDNode extends AliasIDNode
{
private static final long serialVersionUID = 1L;
public FleetsyncIDNode( FleetsyncID id )
{
super( id );
}
@Override
public JPanel getEditor()
{
return new FleetsyncIDEditor( this );
}
public FleetsyncID getFleetsyncID()
{
return (FleetsyncID)getUserObject();
}
public String toString()
{
StringBuilder sb = new StringBuilder();
sb.append( "Fleetsync " );
String ident = getFleetsyncID().getIdent();
if( ident != null )
{
sb.append( ident );
}
return sb.toString();
}
public JPopupMenu getContextMenu()
{
JPopupMenu retVal = new JPopupMenu();
JMenuItem deleteItem = new JMenuItem( "Delete" );
deleteItem.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent e )
{
int n = JOptionPane.showConfirmDialog( getModel().getTree(),
"Are you sure you want to permanently delete this node?" );
if( n == JOptionPane.YES_OPTION )
{
AliasNode parent = (AliasNode)getParent();
parent.getAlias().removeAliasID( getFleetsyncID() );
save();
getModel().removeNodeFromParent( FleetsyncIDNode.this );
}
}
} );
retVal.add( deleteItem );
return retVal;
}
}

View File

@@ -1,69 +0,0 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 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/>
******************************************************************************/
package alias.id.fleetsync;
import javax.xml.bind.annotation.XmlAttribute;
import alias.AliasID;
import alias.AliasIDType;
public class StatusID extends AliasID
{
private int mStatus;
public StatusID()
{
}
@XmlAttribute
public int getStatus()
{
return mStatus;
}
public void setStatus( int status )
{
this.mStatus = status;
}
public String toString()
{
return "Status: " + mStatus;
}
@Override
public boolean matches( AliasID id )
{
boolean retVal = false;
if( id instanceof StatusID )
{
StatusID statusId = (StatusID)id;
retVal = ( mStatus == statusId.getStatus() );
}
return retVal;
}
@Override
public AliasIDType getType()
{
return AliasIDType.Status;
}
}

View File

@@ -1,120 +0,0 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 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/>
******************************************************************************/
package alias.id.fleetsync;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
import net.miginfocom.swing.MigLayout;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import controller.ConfigurableNode;
public class StatusIDEditor extends JPanel implements ActionListener
{
private static final long serialVersionUID = 1L;
private final static Logger mLog =
LoggerFactory.getLogger( StatusIDEditor.class );
private StatusIDNode mStatusIDNode;
private JLabel mLabelName;
private JTextField mTextStatusID;
public StatusIDEditor( StatusIDNode statusIDNode )
{
mStatusIDNode = statusIDNode;
initGUI();
}
private void initGUI()
{
setLayout( new MigLayout() );
setBorder( BorderFactory.createTitledBorder( "Status Code" ) );
mLabelName = new JLabel( "Status Code:" );
add( mLabelName, "align right" );
mTextStatusID = new JTextField(
String.valueOf( mStatusIDNode.getStatusID().getStatus() ) );
add( mTextStatusID, "grow, wrap" );
JButton btnSave = new JButton( "Save" );
btnSave.addActionListener( StatusIDEditor.this );
add( btnSave );
JButton btnReset = new JButton( "Reset" );
btnReset.addActionListener( StatusIDEditor.this );
add( btnReset, "wrap" );
}
@Override
public void actionPerformed( ActionEvent e )
{
String command = e.getActionCommand();
if( command.contentEquals( "Save" ) )
{
String statusIDString = mTextStatusID.getText();
if( statusIDString != null )
{
try
{
int id = Integer.parseInt( statusIDString );
mStatusIDNode.getStatusID().setStatus( id );
((ConfigurableNode)mStatusIDNode.getParent()).sort();
mStatusIDNode.save();
mStatusIDNode.show();
}
catch( Exception ex )
{
mLog.error( "StatusIDEditor - error parsing int status " +
"id from [" + statusIDString + "]" );
}
}
else
{
JOptionPane.showMessageDialog( StatusIDEditor.this,
"Please enter a status ID code" );
}
}
else if( command.contentEquals( "Reset" ) )
{
mTextStatusID.setText(
String.valueOf( mStatusIDNode.getStatusID().getStatus() ) );
}
mStatusIDNode.refresh();
}
}

View File

@@ -1,86 +0,0 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 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/>
******************************************************************************/
package alias.id.fleetsync;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import alias.AliasIDNode;
import alias.AliasNode;
public class StatusIDNode extends AliasIDNode
{
private static final long serialVersionUID = 1L;
public StatusIDNode( StatusID id )
{
super( id );
}
@Override
public JPanel getEditor()
{
return new StatusIDEditor( this );
}
public StatusID getStatusID()
{
return (StatusID)getUserObject();
}
public String toString()
{
return "Status Code " + getStatusID().getStatus();
}
public JPopupMenu getContextMenu()
{
JPopupMenu retVal = new JPopupMenu();
JMenuItem addSystemItem = new JMenuItem( "Delete" );
addSystemItem.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent e )
{
int n = JOptionPane.showConfirmDialog( getModel().getTree(),
"Are you sure you want to permanently delete this node?" );
if( n == JOptionPane.YES_OPTION )
{
AliasNode parent = (AliasNode)getParent();
parent.getAlias().removeAliasID( getStatusID() );
save();
getModel().removeNodeFromParent( StatusIDNode.this );
}
}
} );
retVal.add( addSystemItem );
return retVal;
}
}

View File

@@ -1,132 +0,0 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2015 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/>
******************************************************************************/
package alias.id.lojack;
import javax.xml.bind.annotation.XmlAttribute;
import module.decode.lj1200.LJ1200Message;
import module.decode.lj1200.LJ1200Message.Function;
import alias.AliasID;
import alias.AliasIDType;
public class LoJackFunctionAndID extends AliasID
{
private LJ1200Message.Function mFunction = Function.F0_UNKNOWN;
private String mID = "*****";
public LoJackFunctionAndID()
{
}
@XmlAttribute( name="id" )
public String getID()
{
return mID;
}
public void setID( String id )
{
mID = id;
}
@XmlAttribute( name="function" )
public Function getFunction()
{
return mFunction;
}
public void setFunction( Function function )
{
mFunction = function;
}
public String toString()
{
return "LoJack FUNC: " + mFunction.getLabel() + " ID:" + ( mID == null ? "" : mID );
}
/**
* Indicates if the function and id combination match this alias id
*/
public boolean matches( Function function, String id )
{
return mFunction == function &&
mID != null &&
id != null &&
id.matches( mID.replace( "*", ".?" ) );
}
@Override
public boolean matches( AliasID id )
{
boolean retVal = false;
if( mID != null && id instanceof LoJackFunctionAndID )
{
LoJackFunctionAndID otherLojack = (LoJackFunctionAndID)id;
if( otherLojack.getFunction() == mFunction )
{
//Create a pattern - replace * wildcards with regex single-char wildcard
String pattern = mID.replace( "*", ".?" );
retVal = otherLojack.getID().matches( pattern );
}
}
return retVal;
}
@Override
public AliasIDType getType()
{
return AliasIDType.LoJack;
}
@Override
public int hashCode()
{
final int prime = 31;
int result = 1;
result = prime * result
+ ( ( mFunction == null ) ? 0 : mFunction.hashCode() );
result = prime * result + ( ( mID == null ) ? 0 : mID.hashCode() );
return result;
}
@Override
public boolean equals( Object obj )
{
if ( this == obj )
return true;
if ( obj == null )
return false;
if ( getClass() != obj.getClass() )
return false;
LoJackFunctionAndID other = (LoJackFunctionAndID) obj;
if ( mFunction != other.mFunction )
return false;
if ( mID == null )
{
if ( other.mID != null )
return false;
} else if ( !mID.equals( other.mID ) )
return false;
return true;
}
}

View File

@@ -1,128 +0,0 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2015 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/>
******************************************************************************/
package alias.id.lojack;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import module.decode.lj1200.LJ1200Message;
import module.decode.lj1200.LJ1200Message.Function;
import net.miginfocom.swing.MigLayout;
import controller.ConfigurableNode;
public class LoJackIDEditor extends JPanel implements ActionListener
{
private static final long serialVersionUID = 1L;
private LoJackIDNode mLoJackIDNode;
private JComboBox<LJ1200Message.Function> mFunctionCombo;
private JTextField mTextIdent;
private String mHelpText = "Select a LoJack message function code and enter"
+ " a five character reply code/identifier in the ID field.\n\n"
+ "Wildcard: use an asterisk (*) to wildcard any character in the "
+ "five character reply code (e.g. AB*CD or ***12 or *****)\n\n"
+ "Reply codes are five characters where the middle character"
+ " identifies the entity (tower/site or transponder) as follows:\n"
+ "X,Y\t\tTower\n"
+ "0-9,A,C-H,J-N,P-W\tTransponder\n"
+ "B,I,O,Z\t\tNot Used";
public LoJackIDEditor( LoJackIDNode lojackNode )
{
mLoJackIDNode = lojackNode;
initGUI();
}
private void initGUI()
{
setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][][][grow]" ) );
add( new JLabel( "LoJack Function and ID" ), "span,align center" );
LoJackFunctionAndID lojack = mLoJackIDNode.getLoJackID();
add( new JLabel( "Function:" ) );
mFunctionCombo = new JComboBox<LJ1200Message.Function>( Function.values() );
mFunctionCombo.setSelectedItem( lojack.getFunction() );
add( mFunctionCombo, "grow, wrap" );
add( new JLabel( "ID:" ) );
mTextIdent = new JTextField( lojack.getID() );
add( mTextIdent, "grow, wrap" );
JButton btnSave = new JButton( "Save" );
btnSave.addActionListener( LoJackIDEditor.this );
add( btnSave, "growx,push" );
JButton btnReset = new JButton( "Reset" );
btnReset.addActionListener( LoJackIDEditor.this );
add( btnReset, "growx,push" );
JTextArea helpText = new JTextArea( mHelpText );
helpText.setLineWrap( true );
helpText.setBackground( getBackground() );
add( helpText, "span,grow,push" );
}
@Override
public void actionPerformed( ActionEvent e )
{
String command = e.getActionCommand();
final LoJackFunctionAndID lojack = mLoJackIDNode.getLoJackID();
if( command.contentEquals( "Save" ) )
{
String id = mTextIdent.getText();
if( id != null )
{
lojack.setID( id );
lojack.setFunction( (Function)mFunctionCombo.getSelectedItem() );
((ConfigurableNode)mLoJackIDNode.getParent()).sort();
mLoJackIDNode.save();
mLoJackIDNode.show();
}
else
{
JOptionPane.showMessageDialog( LoJackIDEditor.this, "Please enter an ident" );
}
}
else if( command.contentEquals( "Reset" ) )
{
mFunctionCombo.setSelectedItem( lojack.getFunction() );
mTextIdent.setText( lojack.getID() );
}
mLoJackIDNode.refresh();
}
}

View File

@@ -1,86 +0,0 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 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/>
******************************************************************************/
package alias.id.lojack;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import alias.AliasIDNode;
import alias.AliasNode;
public class LoJackIDNode extends AliasIDNode
{
private static final long serialVersionUID = 1L;
public LoJackIDNode( LoJackFunctionAndID id )
{
super( id );
}
@Override
public JPanel getEditor()
{
return new LoJackIDEditor( this );
}
public LoJackFunctionAndID getLoJackID()
{
return (LoJackFunctionAndID)getUserObject();
}
public String toString()
{
return getLoJackID().toString();
}
public JPopupMenu getContextMenu()
{
JPopupMenu retVal = new JPopupMenu();
JMenuItem deleteItem = new JMenuItem( "Delete" );
deleteItem.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent e )
{
int n = JOptionPane.showConfirmDialog( getModel().getTree(),
"Are you sure you want to permanently delete this node?" );
if( n == JOptionPane.YES_OPTION )
{
AliasNode parent = (AliasNode)getParent();
parent.getAlias().removeAliasID( getLoJackID() );
save();
getModel().removeNodeFromParent( LoJackIDNode.this );
}
}
} );
retVal.add( deleteItem );
return retVal;
}
}

View File

@@ -1,73 +0,0 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 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/>
******************************************************************************/
package alias.id.mdc;
import javax.xml.bind.annotation.XmlAttribute;
import alias.AliasID;
import alias.AliasIDType;
public class MDC1200ID extends AliasID
{
private String mID;
public MDC1200ID()
{
}
@XmlAttribute
public String getIdent()
{
return mID;
}
public void setIdent( String ident )
{
mID = ident;
}
public String toString()
{
return "MDC-1200: " + mID;
}
@Override
public boolean matches( AliasID id )
{
boolean retVal = false;
if( mID != null && id instanceof MDC1200ID )
{
MDC1200ID tgid = (MDC1200ID)id;
//Create a pattern - replace * wildcards with regex single-char wildcard
String pattern = mID.replace( "*", ".?" );
retVal = tgid.getIdent().matches( pattern );
}
return retVal;
}
@Override
public AliasIDType getType()
{
return AliasIDType.MDC1200;
}
}

View File

@@ -1,95 +0,0 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 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/>
******************************************************************************/
package alias.id.mdc;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
import net.miginfocom.swing.MigLayout;
import controller.ConfigurableNode;
public class MDC1200IDEditor extends JPanel implements ActionListener
{
private static final long serialVersionUID = 1L;
private MDC1200IDNode mMDC1200IDNode;
private JTextField mTextIdent;
public MDC1200IDEditor( MDC1200IDNode fsNode )
{
mMDC1200IDNode = fsNode;
initGUI();
}
private void initGUI()
{
setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][][][grow]" ) );
add( new JLabel( "MDC-1200 " ), "span,align center" );
add( new JLabel( "Unit ID:" ) );
mTextIdent = new JTextField( mMDC1200IDNode.getMDC1200ID().getIdent() );
add( mTextIdent, "growx,push" );
JButton btnSave = new JButton( "Save" );
btnSave.addActionListener( MDC1200IDEditor.this );
add( btnSave, "growx,push" );
JButton btnReset = new JButton( "Reset" );
btnReset.addActionListener( MDC1200IDEditor.this );
add( btnReset, "growx,push" );
}
@Override
public void actionPerformed( ActionEvent e )
{
String command = e.getActionCommand();
if( command.contentEquals( "Save" ) )
{
String ident = mTextIdent.getText();
if( ident != null )
{
mMDC1200IDNode.getMDC1200ID().setIdent( ident );
((ConfigurableNode)mMDC1200IDNode.getParent()).sort();
mMDC1200IDNode.save();
mMDC1200IDNode.show();
}
else
{
JOptionPane.showMessageDialog( MDC1200IDEditor.this, "Please enter a unit ID" );
}
}
else if( command.contentEquals( "Reset" ) )
{
mTextIdent.setText( mMDC1200IDNode.getMDC1200ID().getIdent() );
}
mMDC1200IDNode.refresh();
}
}

View File

@@ -1,91 +0,0 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 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/>
******************************************************************************/
package alias.id.mdc;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import alias.AliasIDNode;
import alias.AliasNode;
public class MDC1200IDNode extends AliasIDNode
{
private static final long serialVersionUID = 1L;
public MDC1200IDNode( MDC1200ID id )
{
super( id );
}
@Override
public JPanel getEditor()
{
return new MDC1200IDEditor( this );
}
public MDC1200ID getMDC1200ID()
{
return (MDC1200ID)getUserObject();
}
public String toString()
{
StringBuilder sb = new StringBuilder();
sb.append( "MDC-1200 " );
sb.append( getMDC1200ID().getIdent() );
return sb.toString();
}
public JPopupMenu getContextMenu()
{
JPopupMenu retVal = new JPopupMenu();
JMenuItem deleteItem = new JMenuItem( "Delete" );
deleteItem.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent e )
{
int n = JOptionPane.showConfirmDialog( getModel().getTree(),
"Are you sure you want to permanently delete this node?" );
if( n == JOptionPane.YES_OPTION )
{
AliasNode parent = (AliasNode)getParent();
parent.getAlias().removeAliasID( getMDC1200ID() );
save();
getModel().removeNodeFromParent( MDC1200IDNode.this );
}
}
} );
retVal.add( deleteItem );
return retVal;
}
}

View File

@@ -1,98 +0,0 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 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/>
******************************************************************************/
package alias.id.mobileID;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
import net.miginfocom.swing.MigLayout;
import controller.ConfigurableNode;
public class MINEditor extends JPanel implements ActionListener
{
private static final long serialVersionUID = 1L;
private MINNode mMINNode;
private JLabel mLabelName;
private JTextField mTextMIN;
public MINEditor( MINNode minNode )
{
mMINNode = minNode;
initGUI();
}
private void initGUI()
{
setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][][][grow]" ) );
add( new JLabel( "Mobile ID Number (MIN)" ), "span,align center" );
add( new JLabel( "MIN:" ) );
mTextMIN = new JTextField( mMINNode.getMIN().getMin() );
add( mTextMIN, "growx,push" );
JButton btnSave = new JButton( "Save" );
btnSave.addActionListener( MINEditor.this );
add( btnSave, "growx,push" );
JButton btnReset = new JButton( "Reset" );
btnReset.addActionListener( MINEditor.this );
add( btnReset, "growx,push" );
}
@Override
public void actionPerformed( ActionEvent e )
{
String command = e.getActionCommand();
if( command.contentEquals( "Save" ) )
{
String esn = mTextMIN.getText();
if( esn != null )
{
mMINNode.getMIN().setMin( esn );
((ConfigurableNode)mMINNode.getParent()).sort();
mMINNode.save();
mMINNode.show();
}
else
{
JOptionPane.showMessageDialog( MINEditor.this, "Please enter an ESN" );
}
}
else if( command.contentEquals( "Reset" ) )
{
mTextMIN.setText( mMINNode.getMIN().getMin() );
}
mMINNode.refresh();
}
}

View File

@@ -1,86 +0,0 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 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/>
******************************************************************************/
package alias.id.mobileID;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import alias.AliasIDNode;
import alias.AliasNode;
public class MINNode extends AliasIDNode
{
private static final long serialVersionUID = 1L;
public MINNode( Min min )
{
super( min );
}
@Override
public JPanel getEditor()
{
return new MINEditor( this );
}
public Min getMIN()
{
return (Min)getUserObject();
}
public String toString()
{
return "MIN " + getMIN().getMin();
}
public JPopupMenu getContextMenu()
{
JPopupMenu retVal = new JPopupMenu();
JMenuItem addSystemItem = new JMenuItem( "Delete" );
addSystemItem.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent e )
{
int n = JOptionPane.showConfirmDialog( getModel().getTree(),
"Are you sure you want to permanently delete this node?" );
if( n == JOptionPane.YES_OPTION )
{
AliasNode parent = (AliasNode)getParent();
parent.getAlias().removeAliasID( getMIN() );
save();
getModel().removeNodeFromParent( MINNode.this );
}
}
} );
retVal.add( addSystemItem );
return retVal;
}
}

View File

@@ -1,75 +0,0 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 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/>
******************************************************************************/
package alias.id.mobileID;
import javax.xml.bind.annotation.XmlAttribute;
import alias.AliasID;
import alias.AliasIDType;
/**
* Mobile ID Number
*/
public class Min extends AliasID
{
private String mMin;
public Min()
{
}
@XmlAttribute
public String getMin()
{
return mMin;
}
public void setMin( String min )
{
mMin = min;
}
public String toString()
{
return "MIN: " + mMin;
}
@Override
public boolean matches( AliasID id )
{
boolean retVal = false;
if( mMin != null && id instanceof Min )
{
Min min = (Min)id;
//Create a pattern - replace * wildcards with regex single-char wildcard
String pattern = mMin.replace( "*", ".?" );
retVal = min.getMin().matches( pattern );
}
return retVal;
}
@Override
public AliasIDType getType()
{
return AliasIDType.MIN;
}
}

View File

@@ -1,72 +0,0 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 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/>
******************************************************************************/
package alias.id.mpt1327;
import javax.xml.bind.annotation.XmlAttribute;
import alias.AliasID;
import alias.AliasIDType;
public class MPT1327ID extends AliasID
{
private String mID;
public MPT1327ID()
{
}
@XmlAttribute
public String getIdent()
{
return mID;
}
public void setIdent( String ident )
{
mID = ident;
}
public String toString()
{
return "MPT-1327: " + mID;
}
@Override
public boolean matches( AliasID id )
{
boolean retVal = false;
if( mID != null && id instanceof MPT1327ID )
{
MPT1327ID tgid = (MPT1327ID)id;
//Create a pattern - replace * wildcards with regex single-char wildcard
String pattern = mID.replace( "*", ".?" );
retVal = tgid.getIdent().matches( pattern );
}
return retVal;
}
@Override
public AliasIDType getType()
{
return AliasIDType.MPT1327;
}
}

View File

@@ -1,96 +0,0 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 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/>
******************************************************************************/
package alias.id.mpt1327;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
import net.miginfocom.swing.MigLayout;
import controller.ConfigurableNode;
public class MPT1327IDEditor extends JPanel implements ActionListener
{
private static final long serialVersionUID = 1L;
private MPT1327IDNode mMPT1327IDNode;
private JTextField mTextIdent;
public MPT1327IDEditor( MPT1327IDNode fsNode )
{
mMPT1327IDNode = fsNode;
initGUI();
}
private void initGUI()
{
setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][][][grow]" ) );
add( new JLabel( "MPT-1327 Radio or Group ID" ), "span,align center" );
add( new JLabel( "ID:" ) );
mTextIdent = new JTextField( mMPT1327IDNode.getMPT1327ID().getIdent() );
add( mTextIdent, "growx,push" );
JButton btnSave = new JButton( "Save" );
btnSave.addActionListener( MPT1327IDEditor.this );
add( btnSave, "growx,push" );
JButton btnReset = new JButton( "Reset" );
btnReset.addActionListener( MPT1327IDEditor.this );
add( btnReset, "growx,push" );
}
@Override
public void actionPerformed( ActionEvent e )
{
String command = e.getActionCommand();
if( command.contentEquals( "Save" ) )
{
String ident = mTextIdent.getText();
if( ident != null )
{
mMPT1327IDNode.getMPT1327ID().setIdent( ident );
((ConfigurableNode)mMPT1327IDNode.getParent()).sort();
mMPT1327IDNode.save();
mMPT1327IDNode.show();
}
else
{
JOptionPane.showMessageDialog( MPT1327IDEditor.this, "Please enter a MPT1327 unit ID" );
}
}
else if( command.contentEquals( "Reset" ) )
{
mTextIdent.setText( mMPT1327IDNode.getMPT1327ID().getIdent() );
}
mMPT1327IDNode.refresh();
}
}

View File

@@ -1,91 +0,0 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 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/>
******************************************************************************/
package alias.id.mpt1327;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import alias.AliasIDNode;
import alias.AliasNode;
public class MPT1327IDNode extends AliasIDNode
{
private static final long serialVersionUID = 1L;
public MPT1327IDNode( MPT1327ID id )
{
super( id );
}
@Override
public JPanel getEditor()
{
return new MPT1327IDEditor( this );
}
public MPT1327ID getMPT1327ID()
{
return (MPT1327ID)getUserObject();
}
public String toString()
{
StringBuilder sb = new StringBuilder();
sb.append( "MPT-1327 " );
sb.append( getMPT1327ID().getIdent() );
return sb.toString();
}
public JPopupMenu getContextMenu()
{
JPopupMenu retVal = new JPopupMenu();
JMenuItem deleteItem = new JMenuItem( "Delete" );
deleteItem.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent e )
{
int n = JOptionPane.showConfirmDialog( getModel().getTree(),
"Are you sure you want to permanently delete this node?" );
if( n == JOptionPane.YES_OPTION )
{
AliasNode parent = (AliasNode)getParent();
parent.getAlias().removeAliasID( getMPT1327ID() );
save();
getModel().removeNodeFromParent( MPT1327IDNode.this );
}
}
} );
retVal.add( deleteItem );
return retVal;
}
}

View File

@@ -1,62 +0,0 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 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/>
******************************************************************************/
package alias.id.siteID;
import javax.xml.bind.annotation.XmlAttribute;
import alias.AliasID;
import alias.AliasIDType;
public class SiteID extends AliasID
{
private String mSite;
public SiteID()
{
}
@XmlAttribute
public String getSite()
{
return mSite;
}
public void setSite( String site )
{
mSite = site;
}
public String toString()
{
return "Site: " + mSite;
}
@Override
public boolean matches( AliasID otherID )
{
return otherID != null &&
otherID instanceof SiteID &&
getSite().contentEquals( ( (SiteID)otherID).getSite() );
}
@Override
public AliasIDType getType()
{
return AliasIDType.Site;
}
}

View File

@@ -1,111 +0,0 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 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/>
******************************************************************************/
package alias.id.siteID;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import net.miginfocom.swing.MigLayout;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class SiteIDEditor extends JPanel implements ActionListener
{
private static final long serialVersionUID = 1L;
private final static Logger mLog =
LoggerFactory.getLogger( SiteIDEditor.class );
private SiteIDNode mSiteIDNode;
private JTextField mTextSiteID;
public SiteIDEditor( SiteIDNode siteIDNode )
{
mSiteIDNode = siteIDNode;
initGUI();
}
private void initGUI()
{
setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][][][][grow]" ) );
add( new JLabel( "Site ID" ), "span,align center" );
add( new JLabel( "Site:" ) );
mTextSiteID = new JTextField(
String.valueOf( mSiteIDNode.getSiteID().getSite() ) );
add( mTextSiteID, "growx,push" );
JTextArea description = new JTextArea( "Enter a site number. "
+ "For P25 systems, use the format RR-SS, where RR = RF "
+ "Subsystem and SS = Site Number. For example, RFSS 1 and "
+ "Site 3 would be: 01-03");
description.setLineWrap( true );
description.setBackground( getBackground() );
add( description, "growx,span" );
JButton btnSave = new JButton( "Save" );
btnSave.addActionListener( SiteIDEditor.this );
add( btnSave, "growx,push" );
JButton btnReset = new JButton( "Reset" );
btnReset.addActionListener( SiteIDEditor.this );
add( btnReset, "growx,push" );
}
@Override
public void actionPerformed( ActionEvent e )
{
String command = e.getActionCommand();
if( command.contentEquals( "Save" ) )
{
String siteIDString = mTextSiteID.getText();
if( siteIDString != null )
{
mSiteIDNode.getSiteID().setSite( siteIDString );
mSiteIDNode.save();
mSiteIDNode.show();
}
else
{
JOptionPane.showMessageDialog( SiteIDEditor.this,
"Please enter a site ID" );
}
}
else if( command.contentEquals( "Reset" ) )
{
mTextSiteID.setText( mSiteIDNode.getSiteID().getSite() );
}
mSiteIDNode.refresh();
}
}

View File

@@ -1,86 +0,0 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 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/>
******************************************************************************/
package alias.id.siteID;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import alias.AliasIDNode;
import alias.AliasNode;
public class SiteIDNode extends AliasIDNode
{
private static final long serialVersionUID = 1L;
public SiteIDNode( SiteID id )
{
super( id );
}
@Override
public JPanel getEditor()
{
return new SiteIDEditor( this );
}
public SiteID getSiteID()
{
return (SiteID)getUserObject();
}
public String toString()
{
return "Site " + getSiteID().getSite();
}
public JPopupMenu getContextMenu()
{
JPopupMenu retVal = new JPopupMenu();
JMenuItem addSystemItem = new JMenuItem( "Delete" );
addSystemItem.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent e )
{
int n = JOptionPane.showConfirmDialog( getModel().getTree(),
"Are you sure you want to permanently delete this node?" );
if( n == JOptionPane.YES_OPTION )
{
AliasNode parent = (AliasNode)getParent();
parent.getAlias().removeAliasID( getSiteID() );
save();
getModel().removeNodeFromParent( SiteIDNode.this );
}
}
} );
retVal.add( addSystemItem );
return retVal;
}
}

Some files were not shown because too many files have changed in this diff Show More