+
+ We require a valid product_id to generate a FIT file for the targeted device.
+ Without a valid product_id , the resulting FIT file may not be recognized by other
+ platforms.
@@ -177,7 +178,8 @@ export default {
manufacturerId: m.id,
manufacturerName: m.name,
productId: p.id,
- productName: p.name
+ productName: p.name,
+ isManualInputProduct: false
})
)
)
@@ -203,16 +205,6 @@ export default {
})
return map
},
- isManufacturerHasProduct(): boolean {
- const m = this.manufacturerMap.get(this.selected.manufacturerId!)
- if (m == undefined) return true
- return m?.productMap.size > 0 ?? false
- },
- isManualInputProduct(): boolean {
- if (this.selected.manufacturerId == undefined) return false
- if (!this.isManufacturerHasProduct) return true
- return this.selected.isManualInputProduct ?? false
- },
deviceMappingForGpxTcx(): Map {
const map = new Map()
this.manufacturers.forEach((m) => {
@@ -220,11 +212,12 @@ export default {
map.set(
`${m.name} ${p.name}`.toLowerCase(),
new DeviceOption({
+ label: `${m.name} ${p.name}`,
manufacturerId: m.id,
manufacturerName: m.name,
productId: p.id,
productName: p.name,
- label: `${m.name} ${p.name}`
+ isManualInputProduct: false
})
)
})
@@ -233,6 +226,11 @@ export default {
}
},
watch: {
+ selectedFileType: {
+ handler(fileType: FileType) {
+ if (fileType == FileType.FIT) this.updateSelectedByDeviceName(this.deviceName)
+ }
+ },
deviceFromFitFile: {
handler(device: DeviceOption) {
this.selected = device
@@ -247,13 +245,9 @@ export default {
handler(device: DeviceOption) {
this.updateDeviceNameBySelected(device)
if (isNaN(parseInt(device?.productId as unknown as string))) device.productId = undefined
+ if (device.isManualInputProduct) device.productId = undefined
this.$emit('selectedDevice', device)
}
- },
- deviceName: {
- handler(name: string) {
- this.updateSelectedByDeviceName(name)
- }
}
},
methods: {
@@ -268,9 +262,7 @@ export default {
},
updateSelectedByDeviceName(deviceName: string) {
let device = this.deviceMappingForGpxTcx.get(deviceName.toLocaleLowerCase())
- if (device == undefined) {
- device = new DeviceOption({ label: deviceName })
- }
+ if (device == undefined) device = new DeviceOption()
this.selected = device
}
},
diff --git a/src/wasm/activity-service/activity/fit/wrapper.go b/src/wasm/activity-service/activity/fit/wrapper.go
index a96a830..b830f42 100644
--- a/src/wasm/activity-service/activity/fit/wrapper.go
+++ b/src/wasm/activity-service/activity/fit/wrapper.go
@@ -1,9 +1,9 @@
package fit
import (
- "github.com/muktihari/fit/factory"
"github.com/muktihari/fit/kit/datetime"
"github.com/muktihari/fit/profile/basetype"
+ "github.com/muktihari/fit/profile/factory"
"github.com/muktihari/fit/profile/filedef"
"github.com/muktihari/fit/profile/mesgdef"
"github.com/muktihari/fit/profile/untyped/fieldnum"
diff --git a/src/wasm/activity-service/go.mod b/src/wasm/activity-service/go.mod
index 68fb744..33a277c 100644
--- a/src/wasm/activity-service/go.mod
+++ b/src/wasm/activity-service/go.mod
@@ -1,16 +1,14 @@
module github.com/openivity/activity-service
-go 1.22.0
-
-toolchain go1.23.0
+go 1.24.4
require (
- github.com/muktihari/fit v0.24.3
+ github.com/muktihari/fit v0.25.0
github.com/muktihari/xmltokenizer v0.0.4
- golang.org/x/text v0.18.0
+ golang.org/x/text v0.26.0
)
require (
- github.com/google/go-cmp v0.6.0
+ github.com/google/go-cmp v0.7.0
golang.org/x/exp v0.0.0-20240909161429-701f63a606c0
)
diff --git a/src/wasm/activity-service/go.sum b/src/wasm/activity-service/go.sum
index 0f07f30..0df2de3 100644
--- a/src/wasm/activity-service/go.sum
+++ b/src/wasm/activity-service/go.sum
@@ -1,10 +1,10 @@
-github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
-github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
-github.com/muktihari/fit v0.24.3 h1:gNgPWyyzYMs5xWVBrSFZKmBbpfX9tnZOq7CEw+jsEfo=
-github.com/muktihari/fit v0.24.3/go.mod h1:99RXB2OVc87XhcQzgHfUtCVE3VCJ4BvgmyWQI08MM4w=
+github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
+github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
+github.com/muktihari/fit v0.25.0 h1:WLO/B1u0t5PV2EJtc5j8r02kUlze7TqOvdfeO2jpwdA=
+github.com/muktihari/fit v0.25.0/go.mod h1:BGtO4GkWLPmnKz9keHvbtGDp8Ydwe7Wh1YK9OO6By84=
github.com/muktihari/xmltokenizer v0.0.4 h1:x4DZWvfcEAJR+iBPb8XeiWL1J15SY21bCaem76wmmjw=
github.com/muktihari/xmltokenizer v0.0.4/go.mod h1:yTxhndrcpmZEPYqQGSN51MwkzPQgGSkRpqW5ZFBpdF0=
golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 h1:e66Fs6Z+fZTbFBAxKfP3PALWBtpfqks2bwGcexMxgtk=
golang.org/x/exp v0.0.0-20240909161429-701f63a606c0/go.mod h1:2TbTHSBQa924w8M6Xs1QcRcFwyucIwBGpK1p2f1YFFY=
-golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224=
-golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
+golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M=
+golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA=