Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working on Subdivions #728

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
242 changes: 239 additions & 3 deletions src/database/db_adif_primary_subdvisions_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
DB_ADIF_Primary_Subdvisions_data::DB_ADIF_Primary_Subdvisions_data(const QString &_parentClass)
{
Q_UNUSED(_parentClass);
qDebug() << Q_FUNC_INFO << _parentClass ;
//qDebug() << Q_FUNC_INFO << _parentClass ;
}

bool DB_ADIF_Primary_Subdvisions_data::addData()
Expand Down Expand Up @@ -60,6 +60,20 @@ bool DB_ADIF_Primary_Subdvisions_data::addValues(const QString &rows, const QStr
return true;
}

bool DB_ADIF_Primary_Subdvisions_data::add_USA_6()
{
// This function contains the Primary Subdivision data for Alaska
// Source of data is https://www.adif.org (version 3.1.4)
// Last modification 20240620

QString rows = QString("dxcc, name, shortname, prefix, cqz, ituz, regionalgroup, regionalid, start_date, end_date, deleted");
QStringList values;
values.clear();
values << "'6', 'Alaska', 'AK', '', '1', '1', '', '-1', '', '', 'N'";

return addValues(rows, values);
}

bool DB_ADIF_Primary_Subdvisions_data::add_EA6_21()
{
// This function contains the Primary Subdivision data for Balearic is
Expand All @@ -74,6 +88,119 @@ bool DB_ADIF_Primary_Subdvisions_data::add_EA6_21()
return addValues(rows, values);
}

bool DB_ADIF_Primary_Subdvisions_data::add_EA6_29()
{
// This function contains the Primary Subdivision data for Canary island
// Source of data is https://www.adif.org (version 3.1.4)
// Last modification 20240620

QString rows = QString("dxcc, name, shortname, prefix, cqz, ituz, regionalgroup, regionalid, start_date, end_date, deleted");
QStringList values;
values.clear();
values
<< "'29', 'Las Palmas', 'GC', 'EA8', '33', '36', 'Islas Canarias', '-1', '', '', 'N'"
<< "'29', 'Tenerife', 'TF', 'EA8', '33', '36', 'Islas Canarias', '-1', '', '', 'N'"
;

return addValues(rows, values);
}

bool DB_ADIF_Primary_Subdvisions_data::add_EA6_32()
{
// This function contains the Primary Subdivision data for Ceuta & Melilla
// Source of data is https://www.adif.org (version 3.1.4)
// Last modification 20240620

QString rows = QString("dxcc, name, shortname, prefix, cqz, ituz, regionalgroup, regionalid, start_date, end_date, deleted");
QStringList values;
values.clear();
values
<< "'32', 'Ceuta', 'CE', 'EA9', '33', '37', 'Ceuta Y Melilla', '-1', '', '', 'N'"
<< "'32', 'Melilla', 'ML', 'EA9', '33', '37', 'Ceuta y Melilla', '-1', '', '', 'N'"
;

return addValues(rows, values);
}

bool DB_ADIF_Primary_Subdvisions_data::add_USA_110()
{
// This function contains the Primary Subdivision data for Hawaii
// Source of data is https://www.adif.org (version 3.1.4)
// Last modification 20240620

QString rows = QString("dxcc, name, shortname, prefix, cqz, ituz, regionalgroup, regionalid, start_date, end_date, deleted");
QStringList values;
values.clear();
values << "'110', 'Hawaii', 'HI', '', '31', '61', '', '-1', '', '', 'N'";

return addValues(rows, values);
}

bool DB_ADIF_Primary_Subdvisions_data::add_CT_149()
{
// This function contains the Primary Subdivision data for Azores Is.
// Source of data is https://www.adif.org (version 3.1.4)
// Last modification 20240620

QString rows = QString("dxcc, name, shortname, prefix, cqz, ituz, regionalgroup, regionalid, start_date, end_date, deleted");
QStringList values;
values.clear();
values
<< "'149', 'Açores', 'AC', 'CU', '14', '36', '', '-1', '', '', 'N'"
;

return addValues(rows, values);
}

bool DB_ADIF_Primary_Subdvisions_data::add_CT_256()
{
// This function contains the Primary Subdivision data for Madeira Is.
// Source of data is https://www.adif.org (version 3.1.4)
// Last modification 20240620

QString rows = QString("dxcc, name, shortname, prefix, cqz, ituz, regionalgroup, regionalid, start_date, end_date, deleted");
QStringList values;
values.clear();
values
<< "'256', 'Madeira', 'MD', 'CT9', '33', '36', '', '-1', '', '', 'N'"
;

return addValues(rows, values);
}

bool DB_ADIF_Primary_Subdvisions_data::add_CT_272()
{
// This function contains the Primary Subdivision data for Portugal
// Source of data is https://www.adif.org (version 3.1.4)
// Last modification 20240620

QString rows = QString("dxcc, name, shortname, prefix, cqz, ituz, regionalgroup, regionalid, start_date, end_date, deleted");
QStringList values;
values.clear();
values
<< "'272', 'Aveiro', 'AV', 'CT', '14', '37', '', '-1', '', '', 'N'"
<< "'272', 'Beja', 'BJ', 'CT', '14', '37', '', '-1', '', '', 'N'"
<< "'272', 'Braga', 'BR', 'CT', '14', '37', '', '-1', '', '', 'N'"
<< "'272', 'Bragança', 'BG', 'CT', '14', '37', '', '-1', '', '', 'N'"
<< "'272', 'Castelo Branco', 'CB', 'CT', '14', '37', '', '-1', '', '', 'N'"
<< "'272', 'Coimbra', 'CO', 'CT', '14', '37', '', '-1', '', '', 'N'"
<< "'272', 'Evora', 'EV', 'CT', '14', '37', '', '-1', '', '', 'N'"
<< "'272', 'Faro', 'FR', 'CT', '14', '37', '', '-1', '', '', 'N'"
<< "'272', 'Guarda', 'GD', 'CT', '14', '37', '', '-1', '', '', 'N'"
<< "'272', 'Leiria', 'LR', 'CT', '14', '37', '', '-1', '', '', 'N'"
<< "'272', 'Lisboa', 'LX', 'CT', '14', '37', '', '-1', '', '', 'N'"
<< "'272', 'Portoalegre', 'PG', 'CT', '14', '37', '', '-1', '', '', 'N'"
<< "'272', 'Porto', 'PT', 'CT', '14', '37', '', '-1', '', '', 'N'"
<< "'272', 'Santarem', 'SR', 'CT', '14', '37', '', '-1', '', '', 'N'"
<< "'272', 'Setubal', 'ST', 'CT', '14', '37', '', '-1', '', '', 'N'"
<< "'272', 'Viana do Castelo', 'VC', 'CT', '14', '37', '', '-1', '', '', 'N'"
<< "'272', 'Vila Real', 'VR', 'CT', '14', '37', '', '-1', '', '', 'N'"
<< "'272', 'Viseu', 'VS', 'CT', '14', '37', '', '-1', '', '', 'N'"
;

return addValues(rows, values);
}


bool DB_ADIF_Primary_Subdvisions_data::add_EA_281()
{
Expand All @@ -84,10 +211,119 @@ bool DB_ADIF_Primary_Subdvisions_data::add_EA_281()
QString rows = QString("dxcc, name, shortname, prefix, cqz, ituz, regionalgroup, regionalid, start_date, end_date, deleted");
QStringList values;
values.clear();
values << "'281', 'Madrid', 'M', 'EA4', '14', '37', 'Madrid', '-1', '', '', 'N'"
values
<< "'281', 'Avila', 'AV', 'EA1', '14', '37', 'Castilla y León', '-1', '', '', 'N'"
<< "'281', 'Burgos', 'BU', 'EA1', '14', '37', 'Castilla y León', '-1', '', '', 'N'"
<< "'281', 'A Coruña', 'C', 'EA1', '14', '37', 'Galicia', '-1', '', '', 'N'"
<< "'281', 'Leon', 'LE', 'EA1', '14', '37', 'Castilla y León', '-1', '', '', 'N'"
<< "'281', 'La Rioja', 'LO', 'EA1', '14', '37', 'La Rioja', '-1', '', '', 'N'"
<< "'281', 'Lugo', LU', 'EA1', '14', '37', 'Galicia', '-1', '', '', 'N'"
<< "'281', 'Asturias', 'O', 'EA1', '14', '37', 'Asturias', '-1', '', '', 'N'"
<< "'281', 'Avila', 'AV', 'EA1', '14', '37', 'Castilla y León', '-1', '', '', 'N'";
<< "'281', 'Ourense', 'OU', 'EA1', '14', '37', 'Galicia', '-1', '', '', 'N'"
<< "'281', 'Palencia', 'P', 'EA1', '14', '37', 'Castilla y León', '-1', '', '', 'N'"
<< "'281', 'Pontevedra', 'PO', 'EA1', '14', '37', 'Galicia', '-1', '', '', 'N'"
<< "'281', 'Cantabria', 'S', 'EA1', '14', '37', 'Cantabria', '-1', '', '', 'N'"
<< "'281', 'Salamanca', 'SA', 'EA1', '14', '37', 'Castilla y León', '-1', '', '', 'N'"
<< "'281', 'Segovia', 'SG', 'EA1', '14', '37', 'Castilla y León', '-1', '', '', 'N'"
<< "'281', 'Soria', 'SO', 'EA1', '14', '37', 'Castilla y León', '-1', '', '', 'N'"
<< "'281', 'Valladolid', 'VA', 'EA1', '14', '37', 'Castilla y León', '-1', '', '', 'N'"
<< "'281', 'Zamora', 'ZA', 'EA1', '14', '37', 'Castilla y León', '-1', '', '', 'N'"
<< "'281', 'Vizcaya', 'BI', 'EA2', '14', '37', 'Pais Vasco', '-1', '', '', 'N'"
<< "'281', 'Huesca', 'HU', 'EA2', '14', '37', 'Aragon', '-1', '', '', 'N'"
<< "'281', 'Navarra', 'NA', 'EA2', '14', '37', 'Navarra', '-1', '', '', 'N'"
<< "'281', 'Guipuzcoa', 'SS', 'EA2', '14', '37', 'Pais Vasco', '-1', '', '', 'N'"
<< "'281', 'Teruel', 'TE', 'EA2', '14', '37', 'Aragon', '-1', '', '', 'N'"
<< "'281', 'Alava', 'VI', 'EA2', '14', '37', 'Pais Vasco', '-1', '', '', 'N'"
<< "'281', 'Zaragoza', 'Z', 'EA2', '14', '37', 'Aragon', '-1', '', '', 'N'"
<< "'281', 'Barcelona', 'B', 'EA3', '14', '37', 'Cataluña', '-1', '', '', 'N'"
<< "'281', 'Girona', 'GI', 'EA3', '14', '37', 'Cataluña', '-1', '', '', 'N'"
<< "'281', 'Lleida', 'L', 'EA3', '14', '37', 'Cataluña', '-1', '', '', 'N'"
<< "'281', 'Tarragona', 'T', 'EA3', '14', '37', 'Cataluña', '-1', '', '', 'N'"
<< "'281', 'Badajoz', 'BA', 'EA4', '14', '37', 'Extremadura', '-1', '', '', 'N'"
<< "'281', 'Caceres', 'CC', 'EA4', '14', '37', 'Extremadura', '-1', '', '', 'N'"
<< "'281', 'Ciudad Real', 'CR', 'EA4', '14', '37', 'Castilla La Mancha', '-1', '', '', 'N'"
<< "'281', 'Cuenca', 'CU', 'EA4', '14', '37', 'Castilla La Mancha', '-1', '', '', 'N'"
<< "'281', 'Guadalajara', 'GU', 'EA4', '14', '37', 'Castilla La Mancha', '-1', '', '', 'N'"
<< "'281', 'Madrid', 'M', 'EA4', '14', '37', 'Madrid', '-1', '', '', 'N'"
<< "'281', 'Toledo', 'TO', 'EA4', '14', '37', 'Castilla La Mancha', '-1', '', '', 'N'"
<< "'281', 'Alicante', 'A', 'EA5', '14', '37', 'Comunidad Valenciana', '-1', '', '', 'N'"
<< "'281', 'Albacete', 'AB', 'EA5', '14', '37', 'Castilla La Mancha', '-1', '', '', 'N'"
<< "'281', 'Castellon', 'CS', 'EA5', '14', '37', 'Comunidad Valenciana', '-1', '', '', 'N'"
<< "'281', 'Valencia', 'V', 'EA5', '14', '37', 'Comunidad Valenciana', '-1', '', '', 'N'"
<< "'281', 'Murcia', 'MU', 'EA5', '14', '37', 'Region de Murcia ', '-1', '', '', 'N'"
<< "'281', 'Almeria', 'AL', 'EA7', '14', '37', 'Andalucia', '-1', '', '', 'N'"
<< "'281', 'Cadiz', 'CA', 'EA7', '14', '37', 'Andalucia', '-1', '', '', 'N'"
<< "'281', 'Cordoba', 'CO', 'EA7', '14', '37', 'Andalucia', '-1', '', '', 'N'"
<< "'281', 'Granada', 'GR', 'EA7', '14', '37', 'Andalucia', '-1', '', '', 'N'"
<< "'281', 'Huelva', 'H', 'EA7', '14', '37', 'Andalucia', '-1', '', '', 'N'"
<< "'281', 'Jaen', 'J', 'EA7', '14', '37', 'Andalucia', '-1', '', '', 'N'"
<< "'281', 'Malaga', 'MA', 'EA7', '14', '37', 'Andalucia', '-1', '', '', 'N'"
<< "'281', 'Sevilla', 'SE', 'EA7', '14', '37', 'Andalucia', '-1', '', '', 'N'"
;

return addValues(rows, values);
}

bool DB_ADIF_Primary_Subdvisions_data::add_USA_291()
{
// This function contains the Primary Subdivision data for United States of America
// Source of data is https://www.adif.org (version 3.1.4)
// Last modification 20240620

QString rows = QString("dxcc, name, shortname, prefix, cqz, ituz, regionalgroup, regionalid, start_date, end_date, deleted");
QStringList values;
values.clear();
values
<< "'291', 'Connecticut', 'CT', '', '05', '08', '', '-1', '', '', 'N'"
<< "'291', 'Maine', 'ME', '', '05', '08', '', '-1', '', '', 'N'"
<< "'291', 'Massachusetts', 'MA', '', '05', '08', '', '-1', '', '', 'N'"
<< "'291', 'New Hampshire', 'NH', '', '05', '08', '', '-1', '', '', 'N'"
<< "'291', 'Rhode Island', 'RI', '', '05', '08', '', '-1', '', '', 'N'"
<< "'291', 'Vermont', 'VT', '', '05', '08', '', '-1', '', '', 'N'"
<< "'291', 'New Jersey', 'NJ', '', '05', '08', '', '-1', '', '', 'N'"
<< "'291', 'New York', 'NY', '', '05', '08', '', '-1', '', '', 'N'"
<< "'291', 'Delaware', 'DE', '', '05', '08', '', '-1', '', '', 'N'"
<< "'291', 'District of Columbia', 'DC', '', '05', '08', '', '-1', '', '', 'N'"
<< "'291', 'Maryland', 'MD', '', '05', '08', '', '-1', '', '', 'N'"
<< "'291', 'Pennsylvania', 'PA', '', '05', '08', '', '-1', '', '', 'N'"
<< "'291', 'Alabama', 'AL', '', '04', '08', '', '-1', '', '', 'N'"
<< "'291', 'Florida', 'FL', '', '05', '08', '', '-1', '', '', 'N'"
<< "'291', 'Georgia', 'GA', '', '05', '08', '', '-1', '', '', 'N'"
<< "'291', 'Kentucky', 'KY', '', '04', '08', '', '-1', '', '', 'N'"
<< "'291', 'North Carolina', 'NC', '', '04', '08', '', '-1', '', '', 'N'"
<< "'291', 'South Carolina', 'SC', '', '05', '08', '', '-1', '', '', 'N'"
<< "'291', 'Tennessee', 'TN', '', '04', '08', '', '-1', '', '', 'N'"
<< "'291', 'Virginia', 'VA', '', '05', '08', '', '-1', '', '', 'N'"
<< "'291', 'Arkansas', 'AR', '', '04', '08', '', '-1', '', '', 'N'"
<< "'291', 'Lousiana', 'LA', '', '04', '08', '', '-1', '', '', 'N'"
<< "'291', 'Mississippi', 'MS', '', '04', '08', '', '-1', '', '', 'N'"
<< "'291', 'New Mexico', 'NM', '', '04', '07', '', '-1', '', '', 'N'"
<< "'291', 'Oklahoma', 'OK', '', '04', '07', '', '-1', '', '', 'N'"
<< "'291', 'Texas', 'TX', '', '04', '07', '', '-1', '', '', 'N'"
<< "'291', 'California', 'CA', '', '03', '06', '', '-1', '', '', 'N'"
<< "'291', 'Arizona', 'AZ', '', '03', '06', '', '-1', '', '', 'N'"
<< "'291', 'Idaho', 'ID', '', '03', '06', '', '-1', '', '', 'N'"
<< "'291', 'Montana', 'MT', '', '04', '06', '', '-1', '', '', 'N'"
<< "'291', 'Nevada', 'NV', '', '03', '06', '', '-1', '', '', 'N'"
<< "'291', 'Oregon', 'OR', '', '03', '06', '', '-1', '', '', 'N'"
<< "'291', 'Utah', 'UT', '', '03', '06', '', '-1', '', '', 'N'"
<< "'291', 'Washington', 'WA', '', '03', '06', '', '-1', '', '', 'N'"
<< "'291', 'Wyoming', 'WY', '', '04', '07', '', '-1', '', '', 'N'"
<< "'291', 'Michigan', 'MI', '', '04', '07', '', '-1', '', '', 'N'"
<< "'291', 'Ohio', 'OH', '', '04', '08', '', '-1', '', '', 'N'"
<< "'291', 'West Virginia', 'WV', '', '05', '08', '', '-1', '', '', 'N'"
<< "'291', 'Illinois', 'IL', '', '04', '07', '', '-1', '', '', 'N'"
<< "'291', 'Indiana', 'IN', '', '04', '08', '', '-1', '', '', 'N'"
<< "'291', 'Wisconsin', 'WI', '', '04', '08', '', '-1', '', '', 'N'"
<< "'291', 'Colorado', 'CO', '', '04', '07', '', '-1', '', '', 'N'"
<< "'291', 'Iowa', 'IA', '', '04', '07', '', '-1', '', '', 'N'"
<< "'291', 'Kansas', 'KS', '', '04', '07', '', '-1', '', '', 'N'"
<< "'291', 'Minnesota', 'MN', '', '04', '07', '', '-1', '', '', 'N'"
<< "'291', 'Missouri', 'MO', '', '04', '07', '', '-1', '', '', 'N'"
<< "'291', 'Nebraska', 'NE', '', '04', '07', '', '-1', '', '', 'N'"
<< "'291', 'North dakota', 'ND', '', '04', '07', '', '-1', '', '', 'N'"
<< "'291', 'South Dakota', 'SD', '', '04', '07', '', '-1', '', '', 'N'"
;

return addValues(rows, values);
}
8 changes: 8 additions & 0 deletions src/database/db_adif_primary_subdvisions_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,16 @@ class DB_ADIF_Primary_Subdvisions_data : public QObject
QueryExecutor *exe;
bool isDBCreated(); // This function checks if the DB is created.
bool addValues(const QString &rows, const QStringList &values);
bool add_USA_6(); // Adds the data for Alaska
bool add_EA6_21(); // Adds the data for Balearic Is
bool add_EA6_29(); // Adds the data for Canary Is
bool add_EA6_32(); // Adds the data for Ceuta y Melilla
bool add_EA_281(); // Adds the data for Spain
bool add_USA_110(); // Adds the data for Hawaii
bool add_CT_149(); // Adds the data for Azores
bool add_CT_256(); // Adds the data for Madeira
bool add_CT_272(); // Adds the data for Portugal
bool add_USA_291(); // Adds the data for United States of America


};
Expand Down
Loading