Skip to content

Commit

Permalink
Add new min/max tx settings for 70cm band.
Browse files Browse the repository at this point in the history
  • Loading branch information
VanceVagell committed Jan 25, 2025
1 parent 5764d94 commit 1c6dec8
Show file tree
Hide file tree
Showing 8 changed files with 996 additions and 381 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,240 @@
{
"formatVersion": 1,
"database": {
"version": 5,
"identityHash": "dec26530dc03388f407594df90dea48c",
"entities": [
{
"tableName": "app_settings",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`name` TEXT NOT NULL, `value` TEXT, PRIMARY KEY(`name`))",
"fields": [
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "value",
"columnName": "value",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"autoGenerate": false,
"columnNames": [
"name"
]
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "channel_memories",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`memoryId` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `name` TEXT, `frequency` TEXT, `offset` INTEGER NOT NULL, `tx_tone` TEXT, `group` TEXT, `rx_tone` TEXT DEFAULT 'None', `offset_khz` INTEGER NOT NULL DEFAULT 600, `skip_during_scan` INTEGER NOT NULL DEFAULT 0)",
"fields": [
{
"fieldPath": "memoryId",
"columnName": "memoryId",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "frequency",
"columnName": "frequency",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "offset",
"columnName": "offset",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "txTone",
"columnName": "tx_tone",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "group",
"columnName": "group",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "rxTone",
"columnName": "rx_tone",
"affinity": "TEXT",
"notNull": false,
"defaultValue": "'None'"
},
{
"fieldPath": "offsetKhz",
"columnName": "offset_khz",
"affinity": "INTEGER",
"notNull": true,
"defaultValue": "600"
},
{
"fieldPath": "skipDuringScan",
"columnName": "skip_during_scan",
"affinity": "INTEGER",
"notNull": true,
"defaultValue": "0"
}
],
"primaryKey": {
"autoGenerate": true,
"columnNames": [
"memoryId"
]
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "aprs_messages",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `type` INTEGER NOT NULL DEFAULT 0, `from_callsign` TEXT, `to_callsign` TEXT, `timestamp` INTEGER NOT NULL, `position_lat` REAL NOT NULL, `position_long` REAL NOT NULL, `comment` TEXT, `obj_name` TEXT, `ack` INTEGER NOT NULL, `message_num` INTEGER NOT NULL, `msg_body` TEXT, `temperature` REAL NOT NULL, `humidity` REAL NOT NULL, `pressure` REAL NOT NULL, `rain` REAL NOT NULL, `snow` REAL NOT NULL, `wind_force` INTEGER NOT NULL, `wind_dir` TEXT)",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "type",
"columnName": "type",
"affinity": "INTEGER",
"notNull": true,
"defaultValue": "0"
},
{
"fieldPath": "fromCallsign",
"columnName": "from_callsign",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "toCallsign",
"columnName": "to_callsign",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "timestamp",
"columnName": "timestamp",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "positionLat",
"columnName": "position_lat",
"affinity": "REAL",
"notNull": true
},
{
"fieldPath": "positionLong",
"columnName": "position_long",
"affinity": "REAL",
"notNull": true
},
{
"fieldPath": "comment",
"columnName": "comment",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "objName",
"columnName": "obj_name",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "wasAcknowledged",
"columnName": "ack",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "msgNum",
"columnName": "message_num",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "msgBody",
"columnName": "msg_body",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "temperature",
"columnName": "temperature",
"affinity": "REAL",
"notNull": true
},
{
"fieldPath": "humidity",
"columnName": "humidity",
"affinity": "REAL",
"notNull": true
},
{
"fieldPath": "pressure",
"columnName": "pressure",
"affinity": "REAL",
"notNull": true
},
{
"fieldPath": "rain",
"columnName": "rain",
"affinity": "REAL",
"notNull": true
},
{
"fieldPath": "snow",
"columnName": "snow",
"affinity": "REAL",
"notNull": true
},
{
"fieldPath": "windForce",
"columnName": "wind_force",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "windDir",
"columnName": "wind_dir",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"autoGenerate": true,
"columnNames": [
"id"
]
},
"indices": [],
"foreignKeys": []
}
],
"views": [],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'dec26530dc03388f407594df90dea48c')"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ kv4p HT (see http://kv4p.com)
import com.vagell.kv4pht.data.migrations.MigrationFrom1To2;
import com.vagell.kv4pht.data.migrations.MigrationFrom2To3;
import com.vagell.kv4pht.data.migrations.MigrationFrom3To4;
import com.vagell.kv4pht.data.migrations.MigrationFrom4To5;

@Database(
version = 4,
version = 5,
entities = {AppSetting.class, ChannelMemory.class, APRSMessage.class})
public abstract class AppDatabase extends RoomDatabase {
public abstract AppSettingDao appSettingDao();
Expand All @@ -40,12 +41,14 @@ public abstract class AppDatabase extends RoomDatabase {
public static final Migration MIGRATION_1_2 = new MigrationFrom1To2();
public static final Migration MIGRATION_2_3 = new MigrationFrom2To3();
public static final Migration MIGRATION_3_4 = new MigrationFrom3To4();
public static final Migration MIGRATION_4_5 = new MigrationFrom4To5();

public static AppDatabase getInstance(Context context) {
return Room.databaseBuilder(context.getApplicationContext(), AppDatabase.class, "kv4pht-db")
.addMigrations(MIGRATION_1_2)
.addMigrations(MIGRATION_2_3)
.addMigrations(MIGRATION_3_4)
.addMigrations(MIGRATION_4_5)
.fallbackToDestructiveMigration()
.build();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
kv4p HT (see http://kv4p.com)
Copyright (C) 2024 Vance Vagell
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package com.vagell.kv4pht.data.migrations;

import androidx.room.migration.Migration;
import androidx.sqlite.db.SupportSQLiteDatabase;

public class MigrationFrom4To5 extends Migration {
public MigrationFrom4To5() {
super(4, 5);
}

@Override
public void migrate(SupportSQLiteDatabase database) {
// Rename setting maxFreq to max2mTxFreq (we now have 70cm support)
database.execSQL("UPDATE app_settings SET name = 'max2mTxFreq' WHERE name = 'maxFreq'");
}
}
Loading

0 comments on commit 1c6dec8

Please sign in to comment.