Athletics Certificate Generator: Final Version plus summary
appdev ai powershell graphics certs wpf
Have now created on mega app that does everything wrt creating competitors’ certificates from an athletics event including configuring the certificates for a specific event editing results and sending them. —
The GitHub projects in this thread
- djaus2/AthleticsCertificateMaker
- PowerShell scripts for generating certificates
- djaus2/AthsCertificateEditors
- WPF app for generating certificates plus separate apps for configuring
- djaus2/AthsCertificatesCreator
- Generation and config in one app. Also added Edit->Result
As per the links above, there have been 3 projects:
We started with specifying that GitHub Copilot generate PowerShell scripts to generate the certificates using results as published in an Excel spreadsheet. As there is a background image to certificates there was a need in the scripts to be able to fine tune the location of labels and data so as to improve presentation as well as to position it carefully wrt the background where the background is a bit more to the forefront. Initially these, in particular vertical, positions were defined in the PowerShell script. Later they were extracted to another PowerShell script that is called at the start of the primary script. Eventually this data was migrated to a json file CertificateText.json where it could be directly edited. Finally it was decided to use a csv file for inputting results as this simplified the script’s requirements. That results file results.csv is now optionally a csv or tabbed data file. The main script here is GenerateCertificates.ps1. There is also a complimentary script ‘GenerateCertificatesTIME.ps1’ that generates certificates with a distance and a time. So the previous blog posts and the projects’ code for the reason for the differences.
All projects here use Outlook Classic for sending which would normally need to be installed.
The next phase was to create some WPF apps to directly edit the json config file. There are 3 versions:
- Raw text editor
- Folding Json editor
-
Form based editor
- Editors that produce json files, as Certificate Metadata, as consumed by
GenerateCertificatesLatestand by the original PS version
https://github.com/djaus2/AthleticsCertificateMaker. All three editors produce the same json metadata for the generator, just different UIs.
EditJason/FormEdit: Simplest to useEditJason/FoldingEditor: Complete structured Json folding editorEditJason/TextEditor: Raw Text Editor
The second part of this phase was to specify to AI a WPF app to replace the PowerShell scripts. This eventually achieved the desired outcome. An option was added to create one certificate from results (not sent) for viewing so that the metadata for certificates could be adjusted if required.
The third project here is essentially a combination of the WPF generator app from the second project along with the form version of the json editors. It also adds the ability to edit the results file.
- CreateAthleticsCertificatesApp (
GenerateCertificates/CreateAthleticsCertificatesApp)- WPF app that loads a certificate JSON config, a template PNG, and a results CSV, then generates certificates (view existing, select from results, generate and view). Can send via Classic Outlook (Save option available until ready to send).
- Includes a built-in form-based editor for the certificate JSON config
(File → Settings → Edit in Form Editor…). Provides UI grids to edit
CertificateTextandCertificateFields, plus common metadata (template file, CSV file, colors, flags). Saving there reloads the settings into the app. - Edit → Results… opens a separate editor for the results file (tab- or
comma-delimited), including
$heading lines. - Run:
dotnet run --project GenerateCertificates/CreateAthleticsCertificatesApp/CreateAthleticsCertificatesApp.csproj - Note: in dev mode you may need to turn off Smart App Control in Windows Security. See[Smart_App_Control-Some_issues_in_developer_mode])(https://davidjones.sportronics.com.au/appdev/Smart_App_Control-Some_issues_in_developer_mode-appdev.html)
All good now.
| Topic | Subtopic | |
| < Prev: | Smart App Control | Some issues in developer mode |
| This Category Links | ||
| Category: | Application Dev Index: | Application Dev |