|
| 1 | +# UNIVERSITY QSO PARTY DEFINED for ATS-4 |
| 2 | + |
| 3 | +require 'rules/ats' |
| 4 | + |
| 5 | +NAME = '大学社団QSOパーティ' |
| 6 | +HOST = 'JA1ZLO' |
| 7 | +MAIL = 'allja1.info@gmail.com' |
| 8 | +LINK = 'ja1zlo.u-tokyo.org' |
| 9 | +ZDAT = 'http://ja6ycu.in.coocan.jp/ZLOG/acag.dat' |
| 10 | + |
| 11 | +BANDS = [ |
| 12 | + Band.new( 135), |
| 13 | + Band.new( 475), |
| 14 | + Band.new( 1_900), |
| 15 | + Band.new( 3_500), |
| 16 | + Band.new( 7_000), |
| 17 | + Band.new( 10_000), |
| 18 | + Band.new( 14_000), |
| 19 | + Band.new( 18_000), |
| 20 | + Band.new( 21_000), |
| 21 | + Band.new( 24_000), |
| 22 | + Band.new( 28_000), |
| 23 | + Band.new( 50_000), |
| 24 | + Band.new( 144_000), |
| 25 | + Band.new( 430_000), |
| 26 | + Band.new( 1_200_000), |
| 27 | + Band.new( 2_400_000), |
| 28 | + Band.new( 5_600_000), |
| 29 | + Band.new(10_000_000), |
| 30 | +] |
| 31 | + |
| 32 | +MODES_CW = [ |
| 33 | + Mode.new('CW'), |
| 34 | + Mode.new('A1A'), |
| 35 | + Mode.new('F2A'), |
| 36 | +] |
| 37 | + |
| 38 | +MODES_PH = [ |
| 39 | + Mode.new('PH'), |
| 40 | + Mode.new('AM'), |
| 41 | + Mode.new('FM'), |
| 42 | + Mode.new('SSB'), |
| 43 | + Mode.new('LSB'), |
| 44 | + Mode.new('USB'), |
| 45 | + Mode.new('DSB'), |
| 46 | +] |
| 47 | + |
| 48 | +MODES_WS = [ |
| 49 | + Mode.new("FT8"), |
| 50 | + Mode.new("FT4"), |
| 51 | + Mode.new("JT65"), |
| 52 | +] |
| 53 | + |
| 54 | +MODES_DG = [ |
| 55 | + Mode.new("RTTY"), |
| 56 | + Mode.new("SSTV"), |
| 57 | +] |
| 58 | + |
| 59 | +MODES = MODES_CW + MODES_PH + MODES_WS + MODES_DG |
| 60 | + |
| 61 | +class ProgramUNI < ProgramATS |
| 62 | + def initialize() |
| 63 | + super(NAME, HOST, MAIL, LINK, 11, 1) |
| 64 | + end |
| 65 | + |
| 66 | + def getFinalDay(year) |
| 67 | + LocalDate.of(year, 11, 30) |
| 68 | + end |
| 69 | + |
| 70 | + def getDeadLine(year) |
| 71 | + LocalDate.of(year, 12, 14) |
| 72 | + end |
| 73 | +end |
| 74 | + |
| 75 | +class SectionUNI_Base < SectionATS |
| 76 | + def initialize(name) |
| 77 | + super(name, BANDS, MODES, 0...24, ZDAT) |
| 78 | + setCode(name) |
| 79 | + end |
| 80 | + |
| 81 | + def points(item) |
| 82 | + mode = item.getBoth(Qxsl::MODE) |
| 83 | + |
| 84 | + return 3 if MODES_CW.include?(mode) |
| 85 | + return 3 if MODES_PH.include?(mode) |
| 86 | + return 1 if MODES_WS.include?(mode) |
| 87 | + return 3 if MODES_DG.include?(mode) |
| 88 | + end |
| 89 | + |
| 90 | + def unique(item) |
| 91 | + time = item.getBoth(Qxsl::TIME) |
| 92 | + call = item.getBoth(Qxsl::CALL) |
| 93 | + band = item.getBoth(Qxsl::BAND) |
| 94 | + mode = item.getBoth(Qxsl::MODE) |
| 95 | + |
| 96 | + date = time.value().toLocalDate() |
| 97 | + |
| 98 | + mode = "CW" if MODES_CW.include?(mode) |
| 99 | + mode = "PH" if MODES_PH.include?(mode) |
| 100 | + mode = "WS" if MODES_WS.include?(mode) |
| 101 | + mode = "DG" if MODES_DG.include?(mode) |
| 102 | + |
| 103 | + Element.new([date, call, band, mode]) |
| 104 | + end |
| 105 | + |
| 106 | + def entity(item) |
| 107 | + time = item.getBoth(Qxsl::TIME) |
| 108 | + Element.new([date.value.toLocalDate]) |
| 109 | + end |
| 110 | + |
| 111 | + def getAwardLimit(scores) |
| 112 | + return 1 |
| 113 | + end |
| 114 | +end |
| 115 | + |
| 116 | +class SectionUNI_Call < SectionUNI_Base |
| 117 | + def result(items) |
| 118 | + items.score |
| 119 | + end |
| 120 | +end |
| 121 | + |
| 122 | +class SectionUNI_Date < SectionUNI_Base |
| 123 | + def result(items) |
| 124 | + items.keys(0).size |
| 125 | + end |
| 126 | +end |
| 127 | + |
| 128 | +RULE = ProgramUNI.new |
| 129 | +RULE.add(SectionUNI_Call.new("局数部門")) |
| 130 | +RULE.add(SectionUNI_Date.new("運用日数部門")) |
| 131 | +RULE.add(SectionUNI_Base.new("総合部門")) |
| 132 | +RULE |
0 commit comments