Skip to content

Commit

Permalink
support all gunma contest
Browse files Browse the repository at this point in the history
  • Loading branch information
JG1VPP committed Jun 11, 2024
1 parent 3c899ad commit 11310f0
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 6 deletions.
3 changes: 1 addition & 2 deletions conf/rules/1am.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ def getDeadLine(year)

class Section1AM < SectionATS
def initialize(name)
super(name, Band.new(50_000), Mode.new('AM'), ZDAT)
@hour = (10..12).to_a
super(name, Band.new(50_000), Mode.new('AM'), 10..12, ZDAT)
end

def points(item)
Expand Down
95 changes: 95 additions & 0 deletions conf/rules/agc.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# AREA-1 AM CONTEST DEFINED by ATS-4

require 'rules/ats'

NAME = 'オール群馬コンテスト'
HOST = 'JARL群馬県支部'
MAIL = '[email protected]'
LINK = 'www.jarl.com/gunma/'
ZDAT = 'http://ja6ycu.in.coocan.jp/ZLOG/gunma.dat'

HOUR = Array(20..23) + Array(6..11)

AREAS = {'県内' => 2, '県外' => 4}

ALL = 'マルチバンド'
QRP = 'QRP'

HF = 'HF'
VU = 'V/UHF'

CW = '電信'
PH = '電話'
AM = '電信電話'

BANDS_HF = [
Band.new( 1_900),
Band.new( 3_500),
Band.new( 7_000),
Band.new(14_000),
Band.new(21_000),
Band.new(28_000),
]

BANDS_LO = [
Band.new( 50_000),
Band.new(144_000),
Band.new(430_000),
]

BANDS_UP = [
Band.new(1200_000),
]

BANDS_MB = [
*BANDS_HF,
*BANDS_LO,
*BANDS_UP,
]

BANDS_VU = [
*BANDS_LO,
*BANDS_UP,
]

BANDS = {}
BANDS.store(ALL + '', BANDS_MB)
BANDS.store(ALL + HF, BANDS_HF)
BANDS.store(ALL + VU, BANDS_VU)
BANDS.store(QRP + HF, BANDS_HF)
BANDS.store(QRP + VU, BANDS_LO)
BANDS.update(BANDS_MB.map{|b| [b.to_s, b]}.to_h)

MODES = {}
MODES.store(CW, ['CW'])
MODES.store(PH, ['PH', 'AM', 'FM', 'SSB'])
MODES.store(AM, MODES.values.flatten)

class ProgramAGC < ProgramATS
def initialize()
super(NAME, HOST, MAIL, LINK, 5, 3, DayOfWeek::SATURDAY)
end

def getDeadLine(year)
getStartDay(year).plusMonths(1).plusDays(1)
end
end

class SectionAGC < SectionATS
def initialize(name, area, mode, band)
super(name, BANDS[band], MODES[mode], HOUR, ZDAT)
@mult = @mult.select{|c| c.size >= AREAS[area]}
end

def points(item)
MODES[CW].include?(item.getRcvd.value(Qxsl::MODE).to_s) ? 2 : 1
end
end

RULE = ProgramAGC.new

AREAS.keys.product(MODES.keys, BANDS.keys) do |area, mode, band|
RULE.add(SectionAGC.new([area, mode, band].join(' '), area, mode, band))
end

RULE
4 changes: 2 additions & 2 deletions conf/rules/ats.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ def code()
end

class SectionATS < Section
def initialize(name, band, mode, zdat = nil)
def initialize(name, band, mode, hour = 0..23, zdat = nil)
super()
@name = name
@band = Array(band)
@mode = Array(mode)
@hour = (0..23).to_a
@hour = Array(hour)
@base = loadDAT(zdat).toList
@mult = @base.map{|c| c.code}
end
Expand Down
3 changes: 1 addition & 2 deletions conf/rules/uec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ def conflict(entries)

class SectionUEC < SectionATS
def initialize(band)
super(band.to_s, band, Mode.new('CW'), ZDAT)
@hour = (17..20).to_a
super(band.to_s, band, Mode.new('CW'), 17..20, ZDAT)
end

def code()
Expand Down

0 comments on commit 11310f0

Please sign in to comment.