Magfit updates#475
Merged
Merged
Conversation
The reactivity trigger passed the array itself as the index and null as the value (this.$set(this.newCorrections, this.newCorrections, null)), which created a bogus property keyed by the stringified array and never made the actual index assignment reactive. This is the source of the "weird data" that downloadParams() had to filter out. Set the correct index/value instead so the New table and post-calibration fitness update reactively. Co-authored-by: Cursor <cursoragent@cursor.com>
Matrix3.invert() returns null for a singular matrix instead of throwing, so the try/catch never caught it and correctionMatrix.times() would later crash on null. Check the return value explicitly and bail out instead. Co-authored-by: Cursor <cursoragent@cursor.com>
The generated MAGFIT message type used the misspelled key "multipiers", so it never matched the "multipliers" field used elsewhere by the parser and plotting code. Co-authored-by: Cursor <cursoragent@cursor.com>
Add a "Consistency" section to the Mag Fit tool that plots the absolute heading difference between two selectable compasses, both from the raw log and after fitting, e.g. abs(angle_diff(mag_heading_df(MAG[0], ATT), mag_heading_df(MAG[1], ATT))). Also fixes compassMessageNames, which was an empty computed: message types are added to state.messages non-reactively as they stream in, so the names are now derived in computeData() from a single shared candidate list (kept in sync with compassData and extended to cover MAG/MAG2/MAG3 older-log keys). Adds an abs() helper to mavextra for use in expressions. Co-authored-by: Cursor <cursoragent@cursor.com>
When the log has no GPS position, add a "Get from IP" button that fetches approximate coordinates from a geo-IP service (ipapi.co, falling back to ipwho.is) to populate the lat/lon used for the earth field estimate. Co-authored-by: Cursor <cursoragent@cursor.com>
Drop the fixed pixel width/height and size the pane to its content (width: max-content, height/overflow auto) so it no longer shows scrollbars. Disable resizing via the baseWidget resizeable prop and remove the now-unused resize handle. Also compact the tables/buttons (single line, matching font size) so the auto-sized box stays tight. Co-authored-by: Cursor <cursoragent@cursor.com>
The optimizer is async, so clicking a second Fit button mid-run made two fits interleave through shared state (optimizingData/oldCorrections) and produce garbage. Guard against re-entry while processing, disable the Fit buttons during a run, pass the fit data through a closure instead of instance state, and reset processing in a finally so a thrown optimizer no longer locks the UI. Co-authored-by: Cursor <cursoragent@cursor.com>
Restyle the Mag Fit tool: a proper header with a hover close button, card-style sections with underlined titles, consistent solid buttons with hover/disabled states, bordered inputs/selects, and right-aligned result tables. Colour-code the post-fit fitness green/red depending on whether the fit improved the error, and show a per-compass spinner on the Fit button (and a "Fitting..." footer) while optimizing. Co-authored-by: Cursor <cursoragent@cursor.com>
Disable the Fit buttons (and guard fitWmm) until the log has GPS or the user has entered valid lat/lon, since a fit needs a location to compute the expected earth field. Show a hint and tooltip explaining what's needed. Co-authored-by: Cursor <cursoragent@cursor.com>
Add an onProgress callback to the genetic optimizer and plot the best error per generation as a small inline SVG chart that animates while a fit runs and hides once it finishes. Also drop the per-evaluation console.log in wmmError that spammed the console. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.