[ADIF] Added support for version 3.1.6

This commit is contained in:
Andreas Kristiansen
2025-09-28 10:37:05 +02:00
parent ed822e78e9
commit 3fb510e5a7
7 changed files with 97 additions and 6 deletions

View File

@@ -22,7 +22,7 @@ $config['migration_enabled'] = TRUE;
|
*/
$config['migration_version'] = 257;
$config['migration_version'] = 258;
/*
|--------------------------------------------------------------------------

View File

@@ -0,0 +1,91 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class Migration_adif_3_1_6 extends CI_Migration {
public function up() {
// Adds new modes from ADIF 3.1.6 specification
$modes = array(
array('mode' => "FSK", 'submode' => "SCAMP_FAST", 'qrgmode' => "DATA", 'active' => 1),
array('mode' => "FSK", 'submode' => "SCAMP_SLOW", 'qrgmode' => "DATA", 'active' => 1),
array('mode' => "FSK", 'submode' => "SCAMP_VSLOW", 'qrgmode' => "DATA", 'active' => 1),
array('mode' => "MTONE", 'submode' => "SCAMP_OO", 'qrgmode' => "DATA", 'active' => 1),
array('mode' => "MTONE", 'submode' => "SCAMP_OO_SLW", 'qrgmode' => "DATA", 'active' => 1),
);
foreach ($modes as $mode) {
$exists = $this->db->where('submode', $mode['submode'])
->get('adif_modes')
->num_rows() > 0;
if (!$exists) {
$this->db->insert('adif_modes', $mode);
}
}
// Add new contests from ADIF 3.1.6 specification
$contests = array(
array('name' => 'DARC CW Trainee Contest', 'adifname' => 'DARC-CWA', 'active' => 1),
array('name' => 'DARC 10m Contest', 'adifname' => 'DARC-10', 'active' => 1),
array('name' => 'DARC Trainee Contest', 'adifname' => 'DARC-TRAINEE', 'active' => 1),
array('name' => 'DARC Hell Contest', 'adifname' => 'DARC-HELL', 'active' => 1),
array('name' => 'DARC Microwave Contest', 'adifname' => 'DARC-MICROWAVE', 'active' => 1),
array('name' => 'DARC RTTY Short Contest', 'adifname' => 'ShortRY', 'active' => 1),
array('name' => 'DARC UKW Spring Contest', 'adifname' => 'DARC-UKW-SPRING', 'active' => 1),
array('name' => 'DARC UKW Field Day Contests', 'adifname' => 'DARC-UKW-FIELD-DAY', 'active' => 1),
array('name' => 'DARC VHF-, UHF-, Microwave Contest', 'adifname' => 'DARC-VHF-UHF-MICROWAVE', 'active' => 1),
array('name' => 'DARC Easter Contest', 'adifname' => 'EASTER', 'active' => 1),
array('name' => 'International Naval Contest (INC)', 'adifname' => 'NAVAL', 'active' => 1),
array('name' => 'ORARI Banggai DX Contest', 'adifname' => 'BANGGAI-DX', 'active' => 1),
array('name' => 'ORARI Bekasi Merdeka Contest', 'adifname' => 'BEKASI-MERDEKA-CONTEST', 'active' => 1),
array('name' => 'ORARI DX Contest', 'adifname' => 'ORARI-DX', 'active' => 1),
);
foreach ($contests as $contest) {
$exists = $this->db->where('adifname', $contest['adifname'])
->get('contest')
->num_rows() > 0;
if (!$exists) {
$this->db->insert('contest', $contest);
}
}
}
public function down() {
// remove the modes that were added in this migration
$mode_names = array(
'SCAMP_FAST',
'SCAMP_SLOW',
'SCAMP_VSLOW',
'SCAMP_OO',
'SCAMP_OO_SLW'
);
$this->db->where_in('submode', $mode_names);
$this->db->delete('adif_modes');
// Remove the contests added in this migration
$contest_names = array(
'DARC-CWA',
'DARC-10',
'DARC-TRAINEE',
'DARC-HELL',
'DARC-MICROWAVE',
'ShortRY',
'DARC-UKW-SPRING',
'DARC-UKW-FIELD-DAY',
'DARC-VHF-UHF-MICROWAVE',
'EASTER',
'NAVAL',
'BANGGAI-DX',
'BEKASI-MERDEKA-CONTEST',
'ORARI-DX'
);
$this->db->where_in('adifname', $contest_names);
$this->db->delete('contest');
}
}

View File

@@ -1,5 +1,5 @@
Wavelog ADIF export
<ADIF_VER:5>3.1.5
<ADIF_VER:5>3.1.6
<PROGRAMID:<?php echo strlen($this->config->item('app_name')); ?>><?php echo $this->config->item('app_name')."\r\n"; ?>
<PROGRAMVERSION:<?php echo strlen($this->optionslib->get_option('version')); ?>><?php echo $this->optionslib->get_option('version')."\r\n"; ?>
<EOH>

View File

@@ -1,5 +1,5 @@
Wavelog ADIF export
<ADIF_VER:5>3.1.5
<ADIF_VER:5>3.1.6
<PROGRAMID:<?php echo strlen($this->config->item('app_name')); ?>><?php echo $this->config->item('app_name')."\r\n"; ?>
<PROGRAMVERSION:<?php echo strlen($this->optionslib->get_option('version')); ?>><?php echo $this->optionslib->get_option('version')."\r\n"; ?>
<EOH>

View File

@@ -7,7 +7,7 @@
}
?>
Wavelog ADIF export
<ADIF_VER:5>3.1.5
<ADIF_VER:5>3.1.6
<PROGRAMID:<?php echo strlen($this->config->item('app_name')); ?>><?php echo $this->config->item('app_name')."\r\n"; ?>
<PROGRAMVERSION:<?php echo strlen($this->optionslib->get_option('version')); ?>><?php echo $this->optionslib->get_option('version')."\r\n"; ?>
<EOH>

View File

@@ -3,7 +3,7 @@
header('Content-Disposition: attachment; filename="'.$this->session->userdata('user_callsign').'-'.date('Ymd-Hi').'.adi"')
?>
Wavelog ADIF export
<ADIF_VER:5>3.1.5
<ADIF_VER:5>3.1.6
<PROGRAMID:<?php echo strlen($this->config->item('app_name')); ?>><?php echo $this->config->item('app_name')."\r\n"; ?>
<PROGRAMVERSION:<?php echo strlen($this->optionslib->get_option('version')); ?>><?php echo $this->optionslib->get_option('version')."\r\n"; ?>
<EOH>

View File

@@ -1,5 +1,5 @@
Wavelog ADIF export
<ADIF_VER:5>3.1.5
<ADIF_VER:5>3.1.6
<PROGRAMID:<?php echo strlen($this->config->item('app_name')); ?>><?php echo $this->config->item('app_name')."\n"; ?>
<PROGRAMVERSION:<?php echo strlen($this->optionslib->get_option('version')); ?>><?php echo $this->optionslib->get_option('version')."\r\n"; ?>
<EOH>