Skip to content

Conversation

@richardklasens
Copy link
Contributor

@richardklasens richardklasens commented Dec 18, 2025

Pull Request: Task Architecture

Summary

This PR introduces a comprehensive Task-based workflow for AgOpenGPS, allowing operators to track work sessions (tasks) within fields. Tasks store coverage data separately, enabling multiple work sessions on the same field without overwriting previous data.

Key features:

  • Create, resume, close, and finish tasks within fields
  • Coverage data (sections, contour, recorded path) stored per task
  • Backward compatibility: import legacy coverage when creating first task
  • View-Only mode when no task is active (field open without writing coverage)
  • Modern all-in-one UI for task and field management
  • GPS fix quality indicators in status bar
  • Field import from ISO-XML and KML files
  • Enhanced field selection with distance and area display

Changes by Commit

1. 98a839aa - Add Job data model and file I/O for job-based work sessions

  • Add CJob class with properties for job metadata (id, name, field, profile, work type, timestamps)
  • Add JobFiles.cs with Load/Save/List operations for job directories
  • Add CreateEmpty methods to ContourFiles and FlagsFiles for job initialization
  • Jobs stored in Fields/{FieldName}/Jobs/{JobName}/ folders

2. 8200345b - Add CWorkType for customizable work types

  • Add CWorkType class for work type definitions (id, name, icon)
  • Add WorkTypes static manager with Load/Save/Add/Remove operations
  • Default work types: Spraying, Seeding, Tillage, Harvest, Mowing, Fertilizing, Other
  • Work types stored in WorkTypes.json in settings directory

3. c3822ced - Add job management forms

  • FormStartWork: Main entry point with Resume/New/Open/Close buttons
  • FormJobWizard: 3-step wizard for creating new jobs (Profile → Field → WorkType)
  • FormResumeJob: List of active jobs to resume

4. bb19d3e4 - Refactor FormStartWork to all-in-one form

  • Replace multi-form approach with single 1000x700 form containing switchable panels
  • Main menu, Wizard Steps 1-3, Resume job list as embedded panels
  • ViewMode enum for state management and panel visibility

5. 82caf59a - Remove obsolete FormJobWizard and FormResumeJob

  • All functionality consolidated in FormStartWork

6. e153a6d9 - Add currentJob property to FormGPS

  • Track the currently active job (work session) within a field

7. caded8ea - Add job-aware file operations

  • Add GetJobDir() method to return job directory when currentJob is set
  • Update file save/create operations to use job directory
  • Add FileLoadJobData() to load job-specific coverage data
  • Fallback to field directory when no job active (backward compatibility)

8. db22ec02 - Add HasLegacyCoverageData() for backward compatibility

  • Detect legacy coverage data (Sections.txt in field root without Jobs folder)
  • Enable UI to handle migration of legacy fields to job-based system

9. b87835f9 - Wire up FormStartWork to btnJobMenu_Click

  • Replace FormJob with FormStartWork in job menu button handler

10. be2c9b57 - Restyle FormStartWork: borderless with modern UI

  • Borderless form with colored border and draggable header
  • Buttons with hover effects and subtle shadows
  • Modern color scheme with styled section headers
  • AgShare buttons with accent border styling

11. cf5eabff - Add Close Job and Finish Job buttons

  • Close Job: saves job, clears currentJob, job stays in active list
  • Finish Job: marks job as completed, won't appear in resume list
  • Update button states based on currentJob
  • Skip wizard steps when field already open

12. 3f32a652 - Update FormGPS resources

13. 2c6ab8f1 - Restructures field and job management UI

  • Dedicated panel for opening fields (Local Storage / AgShare Cloud)
  • Reorganized layout with separate tables for jobs and fields

14. ac7877ce - Add View-Only mode and job-aware coverage saving

  • Coverage only saves when a job is active
  • View-Only mode: field open without writing coverage
  • Flags load from field level (shared across all jobs)

15. 62a6cade - Improve job management with coverage import

  • CheckForExistingCoverage() detects legacy coverage in field root
  • ShowImportDialog() for user choice on import
  • ImportCoverageToJob() copies coverage to new job directory
  • DeleteLegacyCoverage() cleans up after import
  • Proper async saving with await on Close/Finish Job

16. bcf69e4f - Add GPS fix quality icons and improve UI

  • GPS fix quality icons (0-4, 8) on btnGPSData
  • Age display in FormGPSData
  • Replace lblFix with lblJobStatus for job status display
  • Profile loading in wizard Step 1

17. 2b997917 - Refactor FormStartWork UI and add JobManager class

  • tableJobs (3x2): Resume Last Job, Resume Job (List), Finish Job, New Job, Close Job, Export Jobs
  • tableFields (2x2): Open Field, New Field, Close Field
  • Add JobManager class for job lifecycle management
  • Resume Last Job directly opens last job
  • Hide Field section when job is active
  • Form stays open after Close/Finish actions
  • "+ New Field" button in wizard Step 2
  • Auto-select last opened field
  • FormKeyboard support with CenterParent positioning

18. 0e7e895d - Rename Job to Task throughout codebase

  • Classes: CJobCTask, JobManagerTaskManager, JobFilesTaskFiles
  • Properties: currentJobcurrentTask, jobManagertaskManager
  • UI elements: All buttons and labels renamed from "Job" to "Task"
  • File structure: Jobs folder → Tasks folder
  • 10 files changed, 770 insertions(+), 770 deletions(-)

19. 8400b01a - Close active task during application shutdown

  • Add task closing logic to ShowSavingFormAndShutdown()
  • Ensures current task is properly saved when application exits
  • Calls CloseCurrentTask() after field data is saved
  • Updates task metadata (end time, status) before app closes

20. 72023617 - Add Field panel and enhanced field list in FormStartWork

  • Add Field panel with three options:
    • Create New Field (FormFieldDir)
    • From ISO-XML (FormFieldIsoXml)
    • From KML (FormFieldKML)
  • Enhanced field selection in wizard Step 2:
    • Replace ListBox with ListView showing Field Name, Distance, Area columns
    • Bold header row with column labels
    • Sort by Name, Distance, or Area via Sort button
    • Distance calculated from current GPS position
    • Area calculated from boundary using shoelace algorithm
  • UI improvements: Fixed column widths (520/200/150), 20pt font, auto-select last opened field

21. c24fcd80 - Fix race condition when saving field data before switching tasks/fields

  • Fix P1 race condition bug in FileSaveEverythingBeforeClosingField()
  • Three methods were calling save fire-and-forget, allowing concurrent execution with operations that change currentTask/currentFieldDirectory
  • Could cause coverage data to be saved to wrong folder or not saved at all
  • Changed btnOpenFieldLocal_Click, btnAddFieldNew_Click, and DoResumeTask to properly await save operation

File Structure

Fields/
└── {FieldName}/
    ├── Field.txt
    ├── Boundary.txt
    ├── Flags.txt          (shared across tasks)
    ├── Elevation.txt
    └── Tasks/
        └── {TaskName}/
            ├── Task.txt       (task metadata)
            ├── Sections.txt   (coverage)
            ├── Contour.txt
            └── RecPath.txt

New Classes

Class Purpose
CTask Task data model with metadata
TaskFiles Task file I/O operations
CWorkType Work type definition
WorkTypes Work type manager
TaskManager Task lifecycle management

UI Changes

  • FormStartWork: All-in-one task management form with:
    • Task management: Resume Last Task, Resume Task, New Task, Close Task, Finish Task, Export Tasks
    • Field management: Open Field, Add Field (New/ISO-XML/KML), Close Field
    • Enhanced field selection with ListView showing distance and area
    • Sort fields by Name, Distance, or Area
  • GPS Fix Icons: Visual indicator of GPS quality (0-4, 8)
  • Task Status Label: Shows current task in top bar
  • FormKeyboard: Now opens centered on parent

Test Plan

Task Management

  • Create new task in existing field
  • Create new field + task in one flow
  • Resume last task with Resume Last button
  • Resume task from list with Resume Task button
  • Close task (should stay in active list)
  • Finish task (should not appear in resume list)
  • Import legacy coverage when creating first task
  • Verify coverage saves to task directory
  • Verify View-Only mode (no coverage save when no task)
  • Test task closes properly on application shutdown

Field Management

  • Add field via "Create New Field" option
  • Import field from ISO-XML file
  • Import field from KML file
  • Sort field list by Name, Distance, and Area
  • Verify distance calculation from GPS position
  • Verify area calculation from boundary polygon
  • Auto-select last opened field in wizard

Bug Fixes

  • Verify no race condition when switching tasks/fields (coverage saves to correct folder)
  • Test save completion before opening different field
  • Test save completion before resuming different task

UI

  • Verify GPS fix icons display correctly (0-4, 8)
  • Test FormKeyboard centering on parent
  • Verify Field section hides when task is active
  • Form stays open after Close/Finish actions

@richardklasens
Copy link
Contributor Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@gunicsba
Copy link
Contributor

Did we remove intentionally the Open from ISO-XML and KML options?
If the field is read-only (i.e. we always need a Task) then I think it would be better to call it "Add Field".

Not quite sure why the Open Local field is good, maybe n case we don't have AgShare the fact that we need 2 steps to open local fields is a bit excessive but it's a good way to advertise AgShare.

Btw It would be great to be able to mass import KML files later (i.e. if we organize them inside Google Earth then we should be able to import all the fields together in a loop. I have made a couple tools for farmers to download files for boundaries.)

ISOXML already contains multiple fields / AB lines / etc we should be able to generate all the fields from that

Add Task:
Bring back the Field Size and Distance columns? (And also the Sort by toggle button)

Task page:
here we could really use the ICONs it would make the translation a breeze.

Notes:
For the Operation it would be necessary (at least for us) to add some notes. For spraying we MUST document the chemicals used. Same is true for seeding / planting. So if we could add notes that would be great. It should remember the last note we had and offer that. So it could be next-next finish.
One more thing that I've encountered is when you have over 70 fields it's hard to remember what did you seed in them. So maybe we could have some kind of notes that are managed at the main folder and could be modified from the Task field?
How do I see this in practice:
During planting we decide to go with Wheat and Barley for example. I could add a Task: Planting (seeding) + notes: Syngenta
Falado 220kg/ha
For the Field Notes of Season 2026 I could add barley

This way in AgShare too we could have a quick and easy overview of what was planted for a given season. (and also the tasks for that plant)

Grandpa Option: Just create a New Field with the date + time + profile , and automatically display the A-B line picker (in fact if we have no AB lines we should probably have that menu opened it would save us a few phone calls)

This is a much better place to choose a profile. IMHO we should offer the option to pick a profile and create a new from the Machine selection screen. (and if we do this then after that profile is created we should open the settings page with the nozzles so they can easily modify the width)

I like that we no longer have the reception bars.

@gunicsba
Copy link
Contributor

Would this also bring us the possibility to have the coverage displayed from a previous task? (or a task currently managed by another tractor that would appear as a flag moving once a minute or so)

@gunicsba
Copy link
Contributor

gunicsba commented Dec 19, 2025

Extra feedback from a hungarian tester:
Could we somehow list all the previous tasks for a given field? Currently it's not possible to see the previous operations.

Maybe it could fit under the Work Type Selection where the previous operations could be displayed (if they exists)
Also this could likely solve the "What did I plant there?" question if we could see the last 5 operations. ordered by date descending.

@richardklasens
Copy link
Contributor Author

Extra feedback from a hungarian tester: Could we somehow list all the previous tasks for a given field? Currently it's not possible to see the previous operations.

Maybe it could fit under the Work Type Selection where the previous operations could be displayed (if they exists) Also this could likely solve the "What did I plant there?" question if we could see the last 5 operations. ordered by date descending.

Yes that is the Export Function which is disabled because it isnt implemented yet.

@richardklasens
Copy link
Contributor Author

Would this also bring us the possibility to have the coverage displayed from a previous task? (or a task currently managed by another tractor that would appear as a flag moving once a minute or so)

Running jobs are active.. finished jobs are finished and unable to Unfinish since they are finished. Other then that it can be possible to put it under the current Job as a layer, just for visualization.

@richardklasens richardklasens force-pushed the JobTaskArchitecture branch 2 times, most recently from 9ec4690 to 7202361 Compare December 20, 2025 01:18
@richardklasens
Copy link
Contributor Author

@codex please review again

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Pat-I
Copy link
Contributor

Pat-I commented Dec 21, 2025

About the file structure:

I wonder if it would be better to make an elevation.txt for each task. They are still only made if the user enable the option in the profile?

If you want an elevation profile you most likely want to know from which task it comes from anyway. Not counting be bad pts it could collect from multiple pass with different vehicles.

@richardklasens
Copy link
Contributor Author

I wonder if it would be better to make an elevation.txt for each task. They are still only made if the user enable the option in the profile?

why should a elevation file belong to a task? Its field related?

@gunicsba
Copy link
Contributor

Its field related?

Yes and no. I think we should log it both places.
Reason:
Elevation log is basically the raw GPS data points (I'm not even sure if we try to do roll correction there)
so doing a tillage at 87 degrees with a 3m different VS a 92 degree planting with a 6m wide implement will give you different data. If it's not roll corrected or you have a 10cm error in your antenna height between tractors that also shows.
Ideally if you merge multiple operations you can get a decimeter precision height map and the grid would become 1x1m or less.

Do we have a use-case for this? No.
Could we have later? Maybe.
would it hurt us to have copies of elevation log? No.

Should we upload this to AgShare? I'd say No. (lets keep the storage there minimal)

@gunicsba
Copy link
Contributor

Testing review of the latest published version:

Many of the Input fields don't do the keyboard popup

Go Mode does nothing currently

If we switch profiles while in sim we end up with a field open where there's no way to enable sim. So we need to exit from AgOpenGPS, start it again, enable SIM then resume task.
Or we could switch the profile, hit cancel on the form and then reopen the task creation.

I think the Notes could be part of every operation.

Maybe the crop type should be from a list?

Sprayer operation we'll likely add the 250l/ha water + list of chemicals and their dosage in a note.

Previous Operations could display the profile maybe?
Or we should add the tool name in the notes for example we have like 6 tools to do Tillage? (shallow / deep / seedbed preparation, etc)

image

I found a list in isobus.net that might help us too:

0 - Non-specific system
1 - Tractor
2 - Primary Soil Tillage
3 - Secondary Soil Tillage
4 - Planters /Seeders
5 - Fertilizer
6 - Sprayers
7 - Harvesters
8 - Root Harvester
9 - Forage harvester
10 - Irrigation
11 - Transport / Trailers
12 - Farmyard Work
13 - Powered Auxilary Units
14 - Special Crops
15 - Municipal Work

For me the order of these would also make sense in this order:
Most of us seed / harvest at least once a year.
But we spray multiple times, do some kind of fertilizer application and tillage more than once.

So Spraying , Fertilizer, Tillage, Mowing/Harvest, Seeding/Planting, Other

If we shoot for 6 then it could be a nice 2x3 grid.
ChatGPT Image 2025  dec  21  15_29_17

@richardklasens
Copy link
Contributor Author

richardklasens commented Dec 21, 2025

Many of the Input fields don't do the keyboard popup

Correct, it isn’t connected yet.

Go Mode does nothing currently

correct, it’s a place holder.

If we switch profiles while in sim we end up with a field open where there's no way to enable sim. So we need to exit from AgOpenGPS, start it again, enable SIM then resume task.
Or we could switch the profile, hit cancel on the form and then reopen the task creation.

I think we need to change the SIM enable to registry instead of settings.

@Pat-I
Copy link
Contributor

Pat-I commented Dec 25, 2025

why should a elevation file belong to a task? Its field related?

It's related to the task (It's related to the vehicle used).

If you keep it field related It's almost guaranteed to be a mess and unusable after some numbers of tasks:
How would you manage the multiple vehicle passes?
You would have no idea which pt come from which task.
Some with maybe incorrect height values?

If you eventually need elevation for some function in AOG, I would say take this from the task you select for "visual previous task" layer.

richardklasens and others added 11 commits January 2, 2026 20:04
- Add CJob class with properties for job metadata (id, name, field, profile, work type, timestamps)
- Add JobFiles.cs with Load/Save/List operations for job directories
- Add CreateEmpty methods to ContourFiles and FlagsFiles for job initialization
- Jobs will be stored in Fields/{FieldName}/Jobs/{JobName}/ folders

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
- Add CWorkType class for work type definitions (id, name, icon)
- Add WorkTypes static manager with Load/Save/Add/Remove operations
- Include default work types (Spraying, Seeding, Tillage, Harvest, Mowing, Fertilizing, Other)
- Work types stored in WorkTypes.json in settings directory

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
- FormStartWork: Main entry point for job-based workflow with Resume/New/Open/Close buttons
- FormJobWizard: 3-step wizard for creating new jobs (Profile -> Field -> WorkType)
- FormResumeJob: List of active jobs to resume work sessions

All forms follow existing design patterns (borderless, flat buttons, Tahoma font).
Forms are created but not yet integrated into main flow - next step will wire them up.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Replace multi-form approach with single form containing switchable panels:
- Main menu panel (Resume/New/Open/Close buttons + AgShare)
- Wizard Step 1: Profile selection
- Wizard Step 2: Field selection
- Wizard Step 3: Work type & job name
- Resume job list panel

Uses ViewMode enum for state management and panel visibility switching.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
All functionality is now consolidated in FormStartWork with embedded panels.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Track the currently active job (work session) within a field.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
- Add GetJobDir() method to return job directory when currentJob is set
- Update FileSaveSections, FileSaveContour, FileSaveFlags, FileSaveRecPath to use job directory
- Update FileCreateSections, FileCreateContour, FileCreateFlags, FileCreateRecPath to use job directory
- Add FileLoadJobData() method to load job-specific coverage data after setting currentJob

When no job is active, operations fall back to field directory for backward compatibility.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Check if field has legacy coverage data (Sections.txt in field root without Jobs folder).
This enables UI to detect and handle migration of legacy fields to job-based system.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Replace FormJob with FormStartWork in the job menu button click handler.
FormStartWork handles all job operations internally (new job, resume, open field, etc.)
so the complex DialogResult handling is no longer needed.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
- Form is now borderless (FormBorderStyle.None) with colored border
- Added draggable header panel for moving the form
- Buttons have depth with hover effects and subtle shadows
- Modern color scheme with softer backgrounds
- Better visual hierarchy with styled section headers
- AgShare buttons have accent border styling
- Cancel button in red for clear visual distinction

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
- Add btnCloseJob and btnFinishJob buttons to main view (3x2 grid)
- Close Job: saves job and clears currentJob, job stays in active list
- Finish Job: marks job as completed, won't appear in resume list
- Update button states based on currentJob:
  - Resume/New Job disabled when job is active
  - Close/Finish Job enabled only when job is active
- Set mf.currentJob when creating or resuming jobs
- Skip wizard steps 1-2 when field is already open (direct to step 3)
- Fix Resume Job crash: properly close field before opening different one
- Improve Resume Job list layout: FieldName prominent on same line as JobName
- Remove drag functionality (form is always CenterParent)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
richardklasens and others added 12 commits January 2, 2026 20:05
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Refactors the FormStartWork form to improve the user
experience for field and job management.

Introduces a dedicated panel for opening fields,
allowing users to select from local storage or AgShare
cloud.

Reorganizes the layout of job-related actions into a
separate table for better clarity.
- Coverage only saves when a job is active (not in View-Only mode)
- FileSaveSections(), FileSaveContour(), FileSaveRecPath() check currentJob != null
- patchSaveList/contourSaveList still cleared to prevent memory buildup
- Flags now load from field level (shared across all jobs)
- Added debug output for troubleshooting coverage saves
- Updated GetJobDir() comments for clarity

🤖 Generated with [Claude Code](https://claude.ai/claude-code)

Co-Authored-By: Claude <[email protected]>
Coverage Import (Backward Compatibility):
- CheckForExistingCoverage() detects legacy Sections.txt in field root
- ShowImportDialog() using FormDialog for user choice
- ImportCoverageToJob() copies coverage files to new job directory
- DeleteLegacyCoverage() cleans up field-root coverage after choice

Job Close/Finish:
- Use await instead of fire-and-forget for FileSaveEverythingBeforeClosingField()
- Close Job and Finish Job now also close the field via mf.JobClose()
- Job metadata saved before clearing currentJob

Resume Job:
- Properly saves and closes current job before switching
- FileLoadJobData() called after setting currentJob

UI Improvements:
- Added OpenField panel with separate Local Storage and AgShare sections
- Fixed field list in wizard step 2 to show all fields correctly

🤖 Generated with [Claude Code](https://claude.ai/claude-code)

Co-Authored-By: Claude <[email protected]>
- Replace lblFix with lblJobStatus for job status display in top bar
- Add FixQuality icons (0-4, 8) to show GPS fix status on btnGPSData
- Add Age display to FormGPSData (between HDOP and Frame)
- Remove scrolling text behavior from top bar labels
- Load profile when selected in wizard Step 1
- Fix AgShare snapshot creation timing (create on menu click)
- Handle invalid AgShare GUID format with user-friendly error
Main panel improvements:
- Add tableJobs (3x2): Resume Last Job, Resume Job (List), Finish Job,
  New Job, Close Job, Export Jobs (placeholder)
- Add tableFields (2x2): Open Field, New Field, Close Field
- Add lblLastJobInfo below tableJobs showing last job details
- Add lblCurrentField below tableFields showing current/last field
- Hide Field section when a job is active
- Keep form open after Close Job, Finish Job, Close Field actions

Job management:
- Add JobManager class to handle job lifecycle (create, resume, close,
  finish) and coverage import/migration
- Resume Last Job directly opens the last job
- Resume Job (List) always shows the job selection list
- Disable Resume/New Job buttons when a job is already open
- Disable Close Field when a job is active (must close job first)

Wizard improvements:
- Add "+ New Field" button in Step 2 between Back and Next
- Auto-select last opened field in the field list
- Support creating new field + job in a single flow (Step 3)

Other changes:
- Add FormKeyboard support for text inputs (txtFieldName, txtJobName)
- Set FormKeyboard StartPosition to CenterParent
- Use BeginInvoke for focus to ensure UI updates before keyboard opens

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Rename all Job-related classes, properties, and UI elements to Task:

Classes:
- CJob → CTask
- JobManager → TaskManager
- JobFiles → TaskFiles

Properties:
- currentJob → currentTask
- jobManager → taskManager

UI elements:
- tableJobs → tableTasks
- btnResumeLastJob → btnResumeLastTask
- btnResumeJob → btnResumeTask
- btnNewJob → btnNewTask
- btnCloseJob → btnCloseTask
- btnFinishJob → btnFinishTask
- btnExportJobs → btnExportTasks
- lblLastJobInfo → lblLastTaskInfo
- lblJobStatus → lblTaskStatus
- txtJobName → txtTaskName
- flpJobList → flpTaskList

Button text updated to use "Task" instead of "Job"

File structure:
- Jobs folder → Tasks folder

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Add task closing logic to ShowSavingFormAndShutdown() to ensure
the current task is properly saved when the application exits.
This calls CloseCurrentTask() after field data is saved, which
updates task metadata (end time, status) before the app closes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Rename "New Field" button to "Add Field" with sub-panel options:
  - Create New Field (FormFieldDir)
  - From ISO-XML (FormFieldIsoXml)
  - From KML (FormFieldKML)

- Replace ListBox with ListView for field selection in wizard Step 2:
  - Show field name, distance (km/mi), and area (ha/ac)
  - Bold header row with column labels
  - Sort by Name, Distance, or Area via Sort button
  - Distance calculated from current GPS position
  - Area calculated from boundary using shoelace algorithm

- UI improvements:
  - Fixed column widths (no user resize)
  - Larger font (20pt) for better readability
  - Auto-select last opened field
FileSaveEverythingBeforeClosingField() was being called fire-and-forget
in three methods, allowing the save to run concurrently with operations
that change currentJob/currentFieldDirectory. This could cause coverage
data to be saved to the wrong folder or not saved at all.

Changed btnOpenFieldLocal_Click, btnAddFieldNew_Click, and DoResumeTask
to properly await the save operation before proceeding.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
InitializeTaskFiles now checks if a task directory already exists before
creating files. If a task with the same name exists, it throws an
InvalidOperationException instead of silently overwriting coverage data.

TaskManager catches this exception and shows a user-friendly error message,
preventing operators from accidentally erasing existing task data by reusing
the same task name (e.g., default name yyyy-MM-dd_Work_Profile on the same day).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Implemented template-based task notes system with WorkType-specific fields:

**New Features:**
- Template-based notes with dynamic fields per WorkType (Spraying, Seeding, Fertilizing, etc.)
- Previous Tasks panel showing last 10 tasks for selected field with notes preview
- Auto-load notes from selected previous task
- Notes displayed in Resume Task List and Last Task info
- Last-used values saved and auto-filled per WorkType
- WorkType selection UI improvement - hide buttons after selection, show selected type with back button

**New Files:**
- WorkTypeTemplate.cs - Template definition classes (WorkTypeTemplate, TemplateField)
- WorkTypeTemplates.cs - Template management with case-insensitive WorkType matching

**Modified Files:**
- CTask.cs - Added Notes and NoteFields properties
- TaskFiles.cs - Added ListAllTasksForField() method
- FormStartWork.cs - Added LoadNotesTemplate(), CreateNoteField(), SaveNotesToTask(), LoadPreviousTasks()
- FormStartWork.Designer.cs - Added panelNotes, flpNoteFields, panelPreviousTasks, lvPreviousTasks UI components

**Technical Details:**
- Dynamic UI generation using FlowLayoutPanel with Panel containers
- ListView with SelectedIndexChanged event for auto-loading notes
- Case-insensitive WorkType matching using ToLowerInvariant()
- Template storage in {fieldsDirectory}/note_templates.json
- Dropdown fields for units (L/ha, kg/ha, etc.)
- Text fields for Product, Rate, Crop, Variety, etc.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Update FormAgShareUploader instantiation to pass required AgShareClient parameter.
This aligns with the refactoring where AgShare components were moved to AgOpenGPS.Core/AgShare.

**Changes:**
- Pass mf.agShareClient to FormAgShareUploader constructor in FormStartWork.cs
- Consistent with existing pattern in FormJob.cs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
@gunicsba
Copy link
Contributor

gunicsba commented Jan 2, 2026

@richardklasens from the ISOBUS/ RATE controller perspective we could easily send the actual flow (seed etc) values and those could be stored alongside the job data. (Which means our isoxml exports will likely need changes too.)

The planter monitoring data could also be stored in a map.

Is this something we could do in the future?
Nothing blocks that right?

@richardklasens
Copy link
Contributor Author

@richardklasens from the ISOBUS/ RATE controller perspective we could easily send the actual flow (seed etc) values and those could be stored alongside the job data. (Which means our isoxml exports will likely need changes too.)

The planter monitoring data could also be stored in a map.

Is this something we could do in the future? Nothing blocks that right?

Everything is possible yes, but lets finish this addition first. GOt a lot more work to do for AgShare to get rid of your 800+ fields ;-)

Improves the task creation flow by prompting the user to
create a task immediately after creating a new field.

This streamlines the workflow and encourages users to define
tasks for newly created fields, ensuring that work is properly
tracked and managed.

Adds work type icons to the task selection screen.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants