forked from VE3NEA/MorseRunner
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- move Exchange definitions and tables to a new file, ExchFields.pas - Code was simply moved to new file, ExchFields.pas. No functional changes.
- Loading branch information
Showing
14 changed files
with
87 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,6 +52,7 @@ implementation | |
|
||
uses | ||
SysUtils, ARRL, CallLst, | ||
ExchFields, | ||
Ini, Main; | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,6 +85,7 @@ implementation | |
|
||
uses | ||
SysUtils, RndFunc, Math, DxOper, | ||
ExchFields, | ||
Main, CallLst, ARRL; | ||
|
||
{ TContest } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
interface | ||
|
||
uses | ||
ExchFields, | ||
Contest, Station, Ini; | ||
|
||
type | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
//------------------------------------------------------------------------------ | ||
//This Source Code Form is subject to the terms of the Mozilla Public | ||
//License, v. 2.0. If a copy of the MPL was not distributed with this | ||
//file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
//------------------------------------------------------------------------------ | ||
unit ExchFields; | ||
|
||
interface | ||
|
||
uses | ||
Classes | ||
; | ||
|
||
type | ||
// Exchange Field #1 types | ||
TExchange1Type = (etRST, etOpName, etFdClass); | ||
|
||
// Exchange Field #2 Types | ||
TExchange2Type = (etSerialNr, etGenericField, etArrlSection, etStateProv, | ||
etCqZone, etItuZone, etAge, etPower, etJaPref, etJaCity, | ||
etNaQpExch2, etNaQpNonNaExch2); | ||
|
||
{ | ||
Defines the characteristics and behaviors of an exchange field. | ||
Used to declare various exchange field behaviors. Field Definitions | ||
are indexed by a contest definition (e.g. ARRL FD uses etFdClass and | ||
etStateProv). As new contests are added, new field definition | ||
may be required. When adding a new exchange field definition, | ||
search for existing code usages to find areas that will require changes. | ||
} | ||
TFieldDefinition = record | ||
C: PChar; // Caption | ||
R: PChar; // Regular Expression | ||
L: smallint; // MaxLength | ||
T: smallint; // Type | ||
end; | ||
|
||
PFieldDefinition = ^TFieldDefinition; | ||
|
||
const | ||
// Adding a contest: define contest-specific field types | ||
// Exchange Field 1 settings/rules | ||
Exchange1Settings: array[TExchange1Type] of TFieldDefinition = ( | ||
(C: 'RST'; R: '[1-5E][1-9N][1-9N]'; L: 3; T:Ord(etRST)) | ||
,(C: 'Name'; R: '[A-Z][A-Z]*'; L: 10; T:Ord(etOpName)) | ||
,(C: 'Class'; R: '[1-9][0-9]*[A-F]'; L: 3; T:Ord(etFdClass)) | ||
); | ||
|
||
// Exchange Field 2 settings/rules | ||
Exchange2Settings: array[TExchange2Type] of TFieldDefinition = ( | ||
(C: 'Nr.'; R: '([0-9OTN]+)|(#)'; L: 4; T:Ord(etSerialNr)), | ||
(C: 'Exch'; R: '[0-9A-Z]*'; L: 12; T:Ord(etGenericField)), | ||
(C: 'Section'; R: '([A-Z][A-Z])|([A-Z][A-Z][A-Z])'; L: 3; T:Ord(etArrlSection)), | ||
(C: 'State/Prov'; R: '[ABCDFGHIKLMNOPQRSTUVWY][ABCDEFHIJKLMNORSTUVXYZ]'; | ||
L: 6; T:Ord(etStateProv)), | ||
(C: 'CQ-Zone'; R: '[0-9]*'; L: 2; T:Ord(etCqZone)), | ||
(C: 'Zone'; R: '[0-9]*'; L: 4; T:Ord(etItuZone)), | ||
(C: 'Age'; R: '[0-9][0-9]'; L: 2; T:Ord(etAge)), | ||
(C: 'Power'; R: '([0-9]*)|(K)|(KW)|([0-9A]*[OTN]*)'; L: 4; T:Ord(etPower)), | ||
(C: 'Number'; R: '([0-9AOTN]*)([LMHP])'; L: 4; T:Ord(etJaPref)), | ||
(C: 'Number'; R: '([0-9AOTN]*)([LMHP])'; L: 7; T:Ord(etJaCity)) | ||
// NAQP Contest: NA Stations send name and (state/prov/dxcc); | ||
// Non-NA stations send name only | ||
,(C: 'State'; R: '([0-9A-Z/]*)'; L: 6; T:Ord(etNaQpExch2)) | ||
,(C: 'State'; R: '()|([0-9A-Z/]*)'; L: 6; T:Ord(etNaQpNonNaExch2)) | ||
); | ||
|
||
implementation | ||
|
||
end. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,9 @@ | |
interface | ||
|
||
uses | ||
Classes, SndTypes, Ini; | ||
Classes, SndTypes, | ||
ExchFields, | ||
Ini; | ||
|
||
const | ||
NEVER = MAXINT; | ||
|