Skip to content

Commit 1963fd0

Browse files
Merge branch 'feature/lsfindex-clean'
2 parents 99e2747 + 2d4b51d commit 1963fd0

File tree

16 files changed

+315
-170
lines changed

16 files changed

+315
-170
lines changed

build.gradle

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id "com.gorylenko.gradle-git-properties" version "2.4.2"
2+
id "com.gorylenko.gradle-git-properties" version "2.5.3"
33
}
44

55
description = "An IMC Java with bindings and generator for IMC."
@@ -14,7 +14,7 @@ ext {
1414
}
1515

1616
allprojects {
17-
version = '5.90.7'
17+
version = '5.90.8'
1818
repositories {
1919
mavenCentral()
2020
}
@@ -45,12 +45,13 @@ allprojects {
4545
}
4646

4747
jar {
48+
def projectExt = project.ext
4849
manifest {
4950
attributes( 'Specification-Title': rootProject.name
5051
,'Specification-Version': project.version
5152
,'Implementation-Title': project.name
5253
,'Implementation-Version': project.version
53-
,'Build-Revision': "${rootProject.name}-${project.version}-git#${-> project.ext.gitProps['git.commit.id.describe']}"
54+
,'Build-Revision': "${rootProject.name}-${project.version}-git#${-> projectExt.gitProps['git.commit.id.describe']}"
5455
,'Automatic-Module-Name': "${rootProject.ext.automaticModuleNameBase}.${project.name}"
5556
,'Build-Jdk': System.properties['java.version']
5657
)
@@ -111,6 +112,9 @@ def jarTask(proj, taskName, jarBaseName, destFolder, mainClass, otherProjectsToP
111112
// Must be a better way to get the core jar here and filter out of the classpath for jar creation
112113
dependsOn project(":core").getTasksByName("dist", true)
113114

115+
def projectExt = project.ext
116+
def projectCoreJarArchiveFle = project(':core').dist.archiveFile
117+
114118
if (otherProjectsToPackToDistList != null)
115119
dependsOn otherProjectsToPackToDistList.collect { it.jar }
116120
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
@@ -123,7 +127,7 @@ def jarTask(proj, taskName, jarBaseName, destFolder, mainClass, otherProjectsToP
123127
m.getAttributes().put 'Specification-Version', project.version
124128
m.getAttributes().put 'Implementation-Title', "$project.name, ${jarBaseName ?: taskName}"
125129
m.getAttributes().put 'Implementation-Version', project.version
126-
m.getAttributes().put 'Build-Revision', "${rootProject.name}-${project.version}-git#${-> project.ext.gitProps['git.commit.id.describe']}"
130+
m.getAttributes().put 'Build-Revision', "${rootProject.name}-${project.version}-git#${-> projectExt.gitProps['git.commit.id.describe']}"
127131
m.getAttributes().put 'Automatic-Module-Name', "${rootProject.ext.automaticModuleNameBase}.$taskName"
128132
m.getAttributes().put 'Build-Jdk', System.properties['java.version']
129133
}
@@ -137,8 +141,9 @@ def jarTask(proj, taskName, jarBaseName, destFolder, mainClass, otherProjectsToP
137141

138142
// Adding runtime jars into the jar
139143
def coreConf = configurations.runtimeClasspath - project(':core').sourceSets.main.runtimeClasspath
144+
def jarArchiveFile = project(':core').jar.archiveFile.get().getAsFile()
140145
coreConf = coreConf.filter { File file ->
141-
file.absolutePath ==~ "${project(':core').jar.archiveFile.get().getAsFile().getAbsolutePath().replaceAll('\\\\', '\\\\\\\\')}" ? false : true
146+
(!(file.absolutePath ==~ "${jarArchiveFile.getAbsolutePath().replaceAll('\\\\', '\\\\\\\\')}"))
142147
}
143148
from { coreConf.collect { it.isDirectory() ? it : zipTree(it).matching {
144149
exclude "module-info.class"
@@ -148,7 +153,7 @@ def jarTask(proj, taskName, jarBaseName, destFolder, mainClass, otherProjectsToP
148153
exclude "module-info.class"
149154
} } }
150155
if (excludeCore != null && !excludeCore)
151-
from { zipTree(project(':core').dist.archivePath) }
156+
from { zipTree(projectCoreJarArchiveFle.get().getAsFile()) }
152157
with jar
153158
archiveBaseName = jarBaseName ?: taskName
154159
//archiveVersion = ''
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.4-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Set this for the GitHub IMC definition repo
44
gradle.ext.imcGitHubRepo = 'LSTS/imc'
55
// Set this for the branch of the GitHub IMC definition repo
6-
gradle.ext.imcGitHubBranch = 'b51f3dd'
6+
gradle.ext.imcGitHubBranch = '73ce349'
77
// Set if you want to use the IMC_Addresses.xml or not
88
gradle.ext.imcDownloadIMCAddresses = 'true'
99
// Set this for the folder IMC definition repo

src-generated/java/pt/lsts/imc/AcousticOperation.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ public enum OP {
5656
MSG_FAILURE(15),
5757
MSG_SHORT(16),
5858
REVERSE_RANGE(17),
59-
FORCED_ABORT(18);
59+
FORCED_ABORT(18),
60+
MSG_FRAGMENT(19);
6061

6162
protected long value;
6263

src-generated/java/pt/lsts/imc/ImcStringDefs.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131

3232
public class ImcStringDefs {
3333

34-
public static final String IMC_SHA = "b51f3dd340b7a22d875f9420d7edd786d2b2e49c";
35-
public static final String IMC_BRANCH = "b51f3dd";
36-
public static final String IMC_COMMIT = "Paulo Dias (paulo.sousa.dias@gmail.com), 2025-06-16T14:36:33Z, https://github.com/LSTS/imc/commit/b51f3dd340b7a22d875f9420d7edd786d2b2e49c, Change current U and V to North ans East (because in meteorology U is East and V is North).";
34+
public static final String IMC_SHA = "73ce3498262dd3f94614983b7418e961bd49152e";
35+
public static final String IMC_BRANCH = "master";
36+
public static final String IMC_COMMIT = "Pedro Gonçalves (pedro@lsts.pt), 2025-08-26T13:48:13Z, https://github.com/LSTS/imc/commit/73ce3498262dd3f94614983b7418e961bd49152e, Add autonaut-01 address to IMC_Addresses.xml";
3737

3838
public static java.util.Map<String, Integer> IMC_ADDRESSES = new java.util.LinkedHashMap<String, Integer>();
3939

@@ -59,6 +59,9 @@ public class ImcStringDefs {
5959
IMC_ADDRESSES.put("lauv-xplore-4", 33);
6060
IMC_ADDRESSES.put("lauv-xplore-5", 34);
6161
IMC_ADDRESSES.put("lauv-nemo-1", 35);
62+
IMC_ADDRESSES.put("lauv-xplore-6", 36);
63+
IMC_ADDRESSES.put("lauv-xplore-7", 37);
64+
IMC_ADDRESSES.put("lauv-xplore-8", 38);
6265
IMC_ADDRESSES.put("lauv-simulator-1", 209);
6366
IMC_ADDRESSES.put("apdr-1", 210);
6467
IMC_ADDRESSES.put("rov-ies", 1025);
@@ -68,10 +71,13 @@ public class ImcStringDefs {
6871
IMC_ADDRESSES.put("caravela", 2050);
6972
IMC_ADDRESSES.put("otter", 2051);
7073
IMC_ADDRESSES.put("caravel", 2052);
74+
IMC_ADDRESSES.put("autonaut-01", 2053);
7175
IMC_ADDRESSES.put("hermes", 2241);
7276
IMC_ADDRESSES.put("hermes-desired", 2242);
7377
IMC_ADDRESSES.put("hermes-target", 2243);
7478
IMC_ADDRESSES.put("tex-wg", 2244);
79+
IMC_ADDRESSES.put("waverider-1", 2250);
80+
IMC_ADDRESSES.put("waverider-2", 2251);
7581
IMC_ADDRESSES.put("pixhawk-testbed", 3072);
7682
IMC_ADDRESSES.put("lusitania", 3073);
7783
IMC_ADDRESSES.put("sedona", 3074);
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
b51f3dd340b7a22d875f9420d7edd786d2b2e49c
2-
b51f3dd
3-
url: https://api.github.com/repos/LSTS/imc/commits/b51f3dd
1+
73ce3498262dd3f94614983b7418e961bd49152e
2+
73ce349
3+
url: https://api.github.com/repos/LSTS/imc/commits/73ce349

src-generated/resources/xml/IMC.xml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4-
+ Copyright (C) 2007-2023 Laboratório de Sistemas e Tecnologia Subaquática +
4+
+ Copyright (C) 2007-2025 Laboratório de Sistemas e Tecnologia Subaquática +
55
+ Departamento de Engenharia Electrotécnica e de Computadores +
66
+ Rua Dr. Roberto Frias, 4200-465 Porto, Portugal +
77
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -1437,7 +1437,7 @@
14371437
<field name="Longitude" abbrev="lon" type="fp64_t" unit="°" >
14381438
<description>
14391439
Longitude where the profile was calculated.
1440-
</description>
1440+
</description>
14411441
</field>
14421442
</message>
14431443

@@ -2301,6 +2301,13 @@
23012301
as "transducer not connected".
23022302
</description>
23032303
</value>
2304+
<value id="19" name="Fragment Message" abbrev="MSG_FRAGMENT">
2305+
<description>
2306+
Request to fragment message over acoustic channel. The message to send
2307+
is specified by the 'msg' field. Size of fragment is specified in the
2308+
'range' field.
2309+
</description>
2310+
</value>
23042311
</field>
23052312
<field name="System" abbrev="system" type="plaintext">
23062313
<description>
@@ -7541,7 +7548,7 @@
75417548
</field>
75427549
</message>
75437550

7544-
<message id="489" name="Sample Maneuver" abbrev="Sample" source="ccu" category="Maneuvering">
7551+
<message id="489" name="Sample Maneuver" abbrev="Sample" source="ccu" category="Maneuvering">
75457552
<description>
75467553
A "Sample" is a maneuver specifying a movement of the vehicle to a
75477554
target waypoint. The waypoint is described by the WGS-84
@@ -11385,7 +11392,7 @@
1138511392
Amplitude of returning ping for the beam.
1138611393
</description>
1138711394
</field>
11388-
<field name="Correlation" abbrev="cor" type="uint8_t" unit="%" max="100" min="0">
11395+
<field name="Correlation" abbrev="cor" type="uint8_t" unit="%" min="0" max="100">
1138911396
<description>
1139011397
Autocorrelation of returning ping for the beam.
1139111398
</description>

src-generated/resources/xml/IMC_Addresses.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
<address id="0x0021" name="lauv-xplore-4"/>
3131
<address id="0x0022" name="lauv-xplore-5"/>
3232
<address id="0x0023" name="lauv-nemo-1"/>
33+
<address id="0x0024" name="lauv-xplore-6"/>
34+
<address id="0x0025" name="lauv-xplore-7"/>
35+
<address id="0x0026" name="lauv-xplore-8"/>
3336
<address id="0x00D1" name="lauv-simulator-1"/>
3437
<address id="0x00D2" name="apdr-1"/>
3538
<!-- ROVs (LSTS) -->
@@ -41,10 +44,13 @@
4144
<address id="0x0802" name="caravela"/>
4245
<address id="0x0803" name="otter"/>
4346
<address id="0x0804" name="caravel"/>
47+
<address id="0x0805" name="autonaut-01"/>
4448
<address id="0x08c1" name="hermes"/>
4549
<address id="0x08c2" name="hermes-desired"/>
4650
<address id="0x08c3" name="hermes-target"/>
4751
<address id="0x08c4" name="tex-wg"/>
52+
<address id="0x08ca" name="waverider-1"/>
53+
<address id="0x08cb" name="waverider-2"/>
4854
<!-- UAVs (LSTS) -->
4955
<address id="0x0c00" name="pixhawk-testbed"/>
5056
<address id="0x0c01" name="lusitania"/>

src-generator/build.gradle

Lines changed: 41 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,17 @@ dependencies {
1212

1313
task generateMessages(type: JavaExec) {
1414
classpath = sourceSets.main.runtimeClasspath
15-
main = 'pt.lsts.imc.generator.ClassGenerator'
15+
mainClass = 'pt.lsts.imc.generator.ClassGenerator'
1616
workingDir = "$parent.rootDir"
17+
18+
def projectExt = project.ext
19+
1720
// arguments to pass to the application
18-
args = ["${-> project.ext.imcXmlPath}"]
19-
21+
args = ["${-> projectExt.imcXmlPath}"]
22+
2023
doFirst {
21-
if (project.ext.has("imcXmlSha"))
22-
args = ["${-> project.ext.imcXmlPath}", "${-> project.ext.imcXmlSha}", "${-> project.ext.imcXmlBranch}", "${-> project.ext.imcXmlCommitNote}"]
24+
if (projectExt.has("imcXmlSha"))
25+
args = ["${-> projectExt.imcXmlPath}", "${-> projectExt.imcXmlSha}", "${-> projectExt.imcXmlBranch}", "${-> projectExt.imcXmlCommitNote}"]
2326
}
2427

2528
doLast {
@@ -34,6 +37,8 @@ task downloadImc(type: Download) {
3437
src "https://github.com/${gradle.ext.imcGitHubRepo}/raw/${gradle.ext.imcGitHubBranch}/IMC.xml"
3538
dest "${parent.rootDir}/src-generated/resources/xml/IMC.xml"
3639

40+
def projectExt = project.ext
41+
3742
doLast {
3843
println("IMC.xml downloaded to '$dest'.")
3944
def sourceGitHub = "https://api.github.com/repos/${gradle.ext.imcGitHubRepo}/commits/${gradle.ext.imcGitHubBranch}";
@@ -44,14 +49,14 @@ task downloadImc(type: Download) {
4449
"\n" + "$gradle.ext.imcGitHubBranch" +
4550
"\n" + "url: $sourceGitHub";
4651
println("IMC SHA: ${commitInfo.sha}")
47-
project.ext.imcXmlSha = "$commitInfo.sha"
52+
projectExt.imcXmlSha = "$commitInfo.sha"
4853
def branchName = getBranchFromCommit()
49-
project.ext.imcXmlBranch = branchName == null ? "$gradle.ext.imcGitHubBranch" : branchName
50-
project.ext.imcXmlCommitNote = "${commitInfo.commit.author.name} (${commitInfo.commit.author.email}), " +
54+
projectExt.imcXmlBranch = branchName == null ? "$gradle.ext.imcGitHubBranch" : branchName
55+
projectExt.imcXmlCommitNote = "${commitInfo.commit.author.name} (${commitInfo.commit.author.email}), " +
5156
"${commitInfo.commit.author.date}, " +
5257
"${commitInfo.html_url}, " +
5358
"${commitInfo.commit.message}"
54-
project.ext.imcXmlPath = "${parent.rootDir}/src-generated/resources/xml"
59+
projectExt.imcXmlPath = "${parent.rootDir}/src-generated/resources/xml"
5560
}
5661
}
5762

@@ -99,24 +104,25 @@ task prepImcFolderEnv {
99104
}
100105

101106
task checkIMCFolderGit {
107+
def projectExt = project.ext
102108
doFirst {
103-
if (!file("${project.ext.imcXmlPath}/IMC.xml").exists())
104-
throw new FileNotFoundException("No IMC.xml on '${project.ext.imcXmlPath}'")
109+
if (!file("${projectExt.imcXmlPath}/IMC.xml").exists())
110+
throw new FileNotFoundException("No IMC.xml on '${projectExt.imcXmlPath}'")
105111

106112
copy {
107-
from "${project.ext.imcXmlPath}/IMC.xml"
113+
from "${projectExt.imcXmlPath}/IMC.xml"
108114
into "${parent.rootDir}/src-generated/resources/xml"
109115
}
110116

111-
def folder = new File("${project.ext.imcXmlPath}/.git")
117+
def folder = new File("${projectExt.imcXmlPath}/.git")
112118
if (!folder.exists()) {
113-
project.ext.imcXmlSha = "unknown sha"
114-
project.ext.imcXmlBranch = "unknown branch"
115-
project.ext.imcXmlCommitNote = "unknown commit notes"
119+
projectExt.imcXmlSha = "unknown sha"
120+
projectExt.imcXmlBranch = "unknown branch"
121+
projectExt.imcXmlCommitNote = "unknown commit notes"
116122

117123
File shaFile = new File("${parent.rootDir}/src-generated/resources/xml/IMC.sha")
118-
shaFile.text = "$project.ext.imcXmlSha" +
119-
"\n" + "$project.ext.imcXmlBranch" +
124+
shaFile.text = "$projectExt.imcXmlSha" +
125+
"\n" + "$projectExt.imcXmlBranch" +
120126
"\n" + "From local folder not on Git";
121127

122128
getGitPropsFromFolder.enabled = false
@@ -173,10 +179,25 @@ task updateImc {
173179
group = 'Generator'
174180
dependsOn = [deleteImcAddr]
175181
dependsOn += downloadImc
176-
if (gradle.ext.imcDownloadIMCAddresses == 'true')
182+
183+
def updateImcRequested = gradle.startParameter.taskNames.any { it?.toLowerCase() == 'updateimc' || it?.toLowerCase()?.endsWith(':updateimc') }
184+
if (updateImcRequested) {
185+
project(':core').processResources.configure {
186+
dependsOn += downloadImc
187+
}
188+
}
189+
190+
if (gradle.ext.imcDownloadIMCAddresses == 'true') {
177191
dependsOn += downloadImcAddr
178-
else
192+
if (updateImcRequested) {
193+
project(':core').processResources.configure {
194+
dependsOn += downloadImcAddr
195+
}
196+
}
197+
}
198+
else {
179199
dependsOn += deleteImcAddr
200+
}
180201
dependsOn += generateMessages
181202
}
182203

src-sender/java/com/jhe/hexed/JHexEditorASCII.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public void paint(Graphics g) {
7878
g.setColor(Color.black);
7979
}
8080

81-
String s = "" + new Character((char) he.buff[n]);
81+
String s = "" + Character.valueOf((char) he.buff[n]);
8282
if ((he.buff[n] < 20) || (he.buff[n] > 126))
8383
s = "" + (char) 16;
8484
he.printString(g, s, (x++), y);

0 commit comments

Comments
 (0)