Skip to content

Commit 1c6dec8

Browse files
committed
Add new min/max tx settings for 70cm band.
1 parent 5764d94 commit 1c6dec8

File tree

8 files changed

+996
-381
lines changed

8 files changed

+996
-381
lines changed
Lines changed: 240 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,240 @@
1+
{
2+
"formatVersion": 1,
3+
"database": {
4+
"version": 5,
5+
"identityHash": "dec26530dc03388f407594df90dea48c",
6+
"entities": [
7+
{
8+
"tableName": "app_settings",
9+
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`name` TEXT NOT NULL, `value` TEXT, PRIMARY KEY(`name`))",
10+
"fields": [
11+
{
12+
"fieldPath": "name",
13+
"columnName": "name",
14+
"affinity": "TEXT",
15+
"notNull": true
16+
},
17+
{
18+
"fieldPath": "value",
19+
"columnName": "value",
20+
"affinity": "TEXT",
21+
"notNull": false
22+
}
23+
],
24+
"primaryKey": {
25+
"autoGenerate": false,
26+
"columnNames": [
27+
"name"
28+
]
29+
},
30+
"indices": [],
31+
"foreignKeys": []
32+
},
33+
{
34+
"tableName": "channel_memories",
35+
"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)",
36+
"fields": [
37+
{
38+
"fieldPath": "memoryId",
39+
"columnName": "memoryId",
40+
"affinity": "INTEGER",
41+
"notNull": true
42+
},
43+
{
44+
"fieldPath": "name",
45+
"columnName": "name",
46+
"affinity": "TEXT",
47+
"notNull": false
48+
},
49+
{
50+
"fieldPath": "frequency",
51+
"columnName": "frequency",
52+
"affinity": "TEXT",
53+
"notNull": false
54+
},
55+
{
56+
"fieldPath": "offset",
57+
"columnName": "offset",
58+
"affinity": "INTEGER",
59+
"notNull": true
60+
},
61+
{
62+
"fieldPath": "txTone",
63+
"columnName": "tx_tone",
64+
"affinity": "TEXT",
65+
"notNull": false
66+
},
67+
{
68+
"fieldPath": "group",
69+
"columnName": "group",
70+
"affinity": "TEXT",
71+
"notNull": false
72+
},
73+
{
74+
"fieldPath": "rxTone",
75+
"columnName": "rx_tone",
76+
"affinity": "TEXT",
77+
"notNull": false,
78+
"defaultValue": "'None'"
79+
},
80+
{
81+
"fieldPath": "offsetKhz",
82+
"columnName": "offset_khz",
83+
"affinity": "INTEGER",
84+
"notNull": true,
85+
"defaultValue": "600"
86+
},
87+
{
88+
"fieldPath": "skipDuringScan",
89+
"columnName": "skip_during_scan",
90+
"affinity": "INTEGER",
91+
"notNull": true,
92+
"defaultValue": "0"
93+
}
94+
],
95+
"primaryKey": {
96+
"autoGenerate": true,
97+
"columnNames": [
98+
"memoryId"
99+
]
100+
},
101+
"indices": [],
102+
"foreignKeys": []
103+
},
104+
{
105+
"tableName": "aprs_messages",
106+
"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)",
107+
"fields": [
108+
{
109+
"fieldPath": "id",
110+
"columnName": "id",
111+
"affinity": "INTEGER",
112+
"notNull": true
113+
},
114+
{
115+
"fieldPath": "type",
116+
"columnName": "type",
117+
"affinity": "INTEGER",
118+
"notNull": true,
119+
"defaultValue": "0"
120+
},
121+
{
122+
"fieldPath": "fromCallsign",
123+
"columnName": "from_callsign",
124+
"affinity": "TEXT",
125+
"notNull": false
126+
},
127+
{
128+
"fieldPath": "toCallsign",
129+
"columnName": "to_callsign",
130+
"affinity": "TEXT",
131+
"notNull": false
132+
},
133+
{
134+
"fieldPath": "timestamp",
135+
"columnName": "timestamp",
136+
"affinity": "INTEGER",
137+
"notNull": true
138+
},
139+
{
140+
"fieldPath": "positionLat",
141+
"columnName": "position_lat",
142+
"affinity": "REAL",
143+
"notNull": true
144+
},
145+
{
146+
"fieldPath": "positionLong",
147+
"columnName": "position_long",
148+
"affinity": "REAL",
149+
"notNull": true
150+
},
151+
{
152+
"fieldPath": "comment",
153+
"columnName": "comment",
154+
"affinity": "TEXT",
155+
"notNull": false
156+
},
157+
{
158+
"fieldPath": "objName",
159+
"columnName": "obj_name",
160+
"affinity": "TEXT",
161+
"notNull": false
162+
},
163+
{
164+
"fieldPath": "wasAcknowledged",
165+
"columnName": "ack",
166+
"affinity": "INTEGER",
167+
"notNull": true
168+
},
169+
{
170+
"fieldPath": "msgNum",
171+
"columnName": "message_num",
172+
"affinity": "INTEGER",
173+
"notNull": true
174+
},
175+
{
176+
"fieldPath": "msgBody",
177+
"columnName": "msg_body",
178+
"affinity": "TEXT",
179+
"notNull": false
180+
},
181+
{
182+
"fieldPath": "temperature",
183+
"columnName": "temperature",
184+
"affinity": "REAL",
185+
"notNull": true
186+
},
187+
{
188+
"fieldPath": "humidity",
189+
"columnName": "humidity",
190+
"affinity": "REAL",
191+
"notNull": true
192+
},
193+
{
194+
"fieldPath": "pressure",
195+
"columnName": "pressure",
196+
"affinity": "REAL",
197+
"notNull": true
198+
},
199+
{
200+
"fieldPath": "rain",
201+
"columnName": "rain",
202+
"affinity": "REAL",
203+
"notNull": true
204+
},
205+
{
206+
"fieldPath": "snow",
207+
"columnName": "snow",
208+
"affinity": "REAL",
209+
"notNull": true
210+
},
211+
{
212+
"fieldPath": "windForce",
213+
"columnName": "wind_force",
214+
"affinity": "INTEGER",
215+
"notNull": true
216+
},
217+
{
218+
"fieldPath": "windDir",
219+
"columnName": "wind_dir",
220+
"affinity": "TEXT",
221+
"notNull": false
222+
}
223+
],
224+
"primaryKey": {
225+
"autoGenerate": true,
226+
"columnNames": [
227+
"id"
228+
]
229+
},
230+
"indices": [],
231+
"foreignKeys": []
232+
}
233+
],
234+
"views": [],
235+
"setupQueries": [
236+
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
237+
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'dec26530dc03388f407594df90dea48c')"
238+
]
239+
}
240+
}

android-src/KV4PHT/app/src/main/java/com/vagell/kv4pht/data/AppDatabase.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ kv4p HT (see http://kv4p.com)
2828
import com.vagell.kv4pht.data.migrations.MigrationFrom1To2;
2929
import com.vagell.kv4pht.data.migrations.MigrationFrom2To3;
3030
import com.vagell.kv4pht.data.migrations.MigrationFrom3To4;
31+
import com.vagell.kv4pht.data.migrations.MigrationFrom4To5;
3132

3233
@Database(
33-
version = 4,
34+
version = 5,
3435
entities = {AppSetting.class, ChannelMemory.class, APRSMessage.class})
3536
public abstract class AppDatabase extends RoomDatabase {
3637
public abstract AppSettingDao appSettingDao();
@@ -40,12 +41,14 @@ public abstract class AppDatabase extends RoomDatabase {
4041
public static final Migration MIGRATION_1_2 = new MigrationFrom1To2();
4142
public static final Migration MIGRATION_2_3 = new MigrationFrom2To3();
4243
public static final Migration MIGRATION_3_4 = new MigrationFrom3To4();
44+
public static final Migration MIGRATION_4_5 = new MigrationFrom4To5();
4345

4446
public static AppDatabase getInstance(Context context) {
4547
return Room.databaseBuilder(context.getApplicationContext(), AppDatabase.class, "kv4pht-db")
4648
.addMigrations(MIGRATION_1_2)
4749
.addMigrations(MIGRATION_2_3)
4850
.addMigrations(MIGRATION_3_4)
51+
.addMigrations(MIGRATION_4_5)
4952
.fallbackToDestructiveMigration()
5053
.build();
5154
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
kv4p HT (see http://kv4p.com)
3+
Copyright (C) 2024 Vance Vagell
4+
5+
This program is free software: you can redistribute it and/or modify
6+
it under the terms of the GNU General Public License as published by
7+
the Free Software Foundation, either version 3 of the License, or
8+
(at your option) any later version.
9+
10+
This program is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
GNU General Public License for more details.
14+
15+
You should have received a copy of the GNU General Public License
16+
along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
*/
18+
19+
package com.vagell.kv4pht.data.migrations;
20+
21+
import androidx.room.migration.Migration;
22+
import androidx.sqlite.db.SupportSQLiteDatabase;
23+
24+
public class MigrationFrom4To5 extends Migration {
25+
public MigrationFrom4To5() {
26+
super(4, 5);
27+
}
28+
29+
@Override
30+
public void migrate(SupportSQLiteDatabase database) {
31+
// Rename setting maxFreq to max2mTxFreq (we now have 70cm support)
32+
database.execSQL("UPDATE app_settings SET name = 'max2mTxFreq' WHERE name = 'maxFreq'");
33+
}
34+
}

0 commit comments

Comments
 (0)