Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class WheelCircumference(private val scontext: ServiceContext, private val revol
if (newLocation != null) {
currentLocation = newLocation
if (currentLocation.getAccuracy() <= MIN_ACCURACY && revolution.isInitialized) {
val previousLocation = previousLocation
if (previousLocation == null) {
reset(currentLocation)
} else {
Expand Down
28 changes: 0 additions & 28 deletions aat-gtk/src/main/java/ch/bailu/aat_gtk/lib/GResource.java

This file was deleted.

53 changes: 0 additions & 53 deletions aat-gtk/src/main/java/ch/bailu/aat_gtk/lib/RuntimeInfo.java

This file was deleted.

2 changes: 1 addition & 1 deletion aat-gtk/src/main/kotlin/ch/bailu/aat_gtk/app/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package ch.bailu.aat_gtk.app

import ch.bailu.aat_gtk.config.Environment
import ch.bailu.aat_gtk.config.Strings
import ch.bailu.aat_gtk.lib.GResource
import ch.bailu.aat_gtk.lib.RuntimeInfo
import ch.bailu.aat_gtk.preferences.GtkStorage
import ch.bailu.aat_gtk.preferences.PreferenceLoadDefaults
Expand All @@ -17,6 +16,7 @@ import ch.bailu.aat_lib.logger.BroadcastLoggerFactory
import ch.bailu.aat_lib.logger.PrintLnLoggerFactory
import ch.bailu.gtk.adw.Application
import ch.bailu.gtk.gio.ApplicationFlags
import ch.bailu.gtk.lib.bridge.GResource
import ch.bailu.gtk.type.Strs
import org.mapsforge.map.gtk.graphics.GtkGraphicFactory
import kotlin.system.exitProcess
Expand Down
54 changes: 54 additions & 0 deletions aat-gtk/src/main/kotlin/ch/bailu/aat_gtk/lib/RuntimeInfo.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package ch.bailu.aat_gtk.lib

import ch.bailu.aat_lib.util.MemSize
import ch.bailu.gtk.lib.util.SizeLog

class RuntimeInfo : Runnable {
override fun run() {
val max = SizeLog(getIdentifier("Max"))
val total = SizeLog(getIdentifier("Total"))
val free = SizeLog(getIdentifier("Free"))
val used = SizeLog(getIdentifier("Used"))
val processors = SizeLog(getIdentifier("Processors"))

val runtime = Runtime.getRuntime()

try {
Thread.sleep(TIMEOUT)
processors.log(runtime.availableProcessors().toLong())
free.log(runtime.freeMemory() / MemSize.MB)

while (on) {
max.log(runtime.maxMemory() / MemSize.MB)
total.log(runtime.totalMemory() / MemSize.MB)
used.log((runtime.totalMemory() - runtime.freeMemory()) / MemSize.MB)
Thread.sleep(TIMEOUT)
}
} catch (e: InterruptedException) {
on = false
System.err.println(e.message)
}
}

companion object {
private const val TIMEOUT: Long = 5000
private var on = false

private fun getIdentifier(name: String): String {
return Runtime::class.java.simpleName + ":" + name
}

@Synchronized
fun startLogging() {
if (!on) {
on = true
Thread(RuntimeInfo()).start()
}
}

@Synchronized
fun stopLogging() {
on = false
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class GtkCanvas (private val context: Context) : GraphCanvas {
context.restore()
}

override fun drawBitmap(pa: Point?, color: Int) {
override fun drawBitmap(pa: Point, color: Int) {
}

override fun getTextSize(): Int {
Expand Down Expand Up @@ -68,4 +68,4 @@ class GtkCanvas (private val context: Context) : GraphCanvas {
layout.unref()
strText.destroy()
}
}
}
1 change: 1 addition & 0 deletions aat-lib/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ dependencies {
implementation("com.google.guava:guava:33.5.0-jre")

implementation("com.github.MaxKellermann:beacon:v0.1")
testImplementation(kotlin("test"))
}

testing {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class BrouterApi(overlay: SolidOverlayInterface) : Api(overlay) {
val builder = StringBuilder()
var del = ""
while (iterator.nextPoint()) {
builder.append("$del${iterator.point.getLongitude()},${iterator.point.getLatitude()}")
builder.append("$del${iterator.getPoint().getLongitude()},${iterator.getPoint().getLatitude()}")
del = "|"
}
return builder.toString()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class GpxListWriter(track: GpxList, file: Foc) : Closeable {
writer.writeSegment()
}
}
writer.writeTrackPoint(iterator.point)
writer.writeTrackPoint(iterator.getPoint())
}
}
}
169 changes: 0 additions & 169 deletions aat-lib/src/main/java/ch/bailu/aat_lib/gpx/GpxBigDelta.java

This file was deleted.

Loading