Development
This part contains information on software development
This part contains information on software development
When designing a Windows Forms application, you have several architectural patterns to choose from. The common ones are:
In .NET 8, when a migration attempts to create a table that already exists in the database, the behavior depends on the state of the migration history and the existing database schema:
When you apply the initial migration, Entity Framework Core (EF Core) creates the specified tables based on your model. If the table already exists in the database, EF Core will not re-create it. It only creates tables that are not present.
For subsequent migrations (e.g., adding columns, modifying schema), EF Core generates migration scripts based on the difference between the current model and the previous migration’s snapshot. If a table is already in the database and corresponds to the model, EF Core will not attempt to create it again. However, if the table structure differs from the model (e.g., missing columns), EF Core will generate migration scripts to update the schema.
EF Core maintains a special table called __EFMigrationsHistory (or __migrations_History in some databases). This table tracks which migrations have been applied to the database. If a migration has already been applied (recorded in this table), EF Core will skip creating the corresponding tables.
The Down method in a migration handles rolling back changes. If you need to undo a migration, the Down method drops the corresponding tables. For example, if you remove a column in a migration, the Down method will drop that column.
Be cautious when manually truncating or deleting tables (including the __EFMigrationsHistory table). If the migration history is lost, EF Core may treat subsequent migrations as initial migrations, leading to re-creation of existing tables. In summary, EF Core is designed to be aware of the existing database schema and avoid unnecessary table creation. Ensure that the migration history is intact, and avoid manual truncation of the migration history table to prevent unexpected behavior during migrations
AMPLI-SYNC is a framework for synchronizing data between a SQLite database and an MS SQL/MySQL/Oracle/PostgreSQL database.
It allows your application to work offline (Airplane Mode) and then perform automated bidirectional synchronization when an internet connection becomes available.
Der mobile Client wird als Testprojekt mit AspNetCore für REST und Webassembly für den Client aufgesetzt
Ein Video dazu. Werd DTN für IPM fertig machen und dann ein entsprechendes Projekt fuer die weitere Diskussion als Beispiel aufsetzen. Ist allerdings erst in preview … das sollte man evtl. abwarten
Zurückgestellt Mit dem Avalonia framework könnte man einfache Clients wie e.g. die Spreadsheets für die Module bereitstellen. Das waere vorallem für Desktop Apps. Ansonsten würde Blazor wohl die einfachere Herangehensweise sein weil es über den Browser alles abdeckt. Sollte auf jeden Fall in separatem Verzeichnis entwickelt werden weil es Einstellungen vornimmt die mit anderen Frameworks nicht kompatibel sind. Ist allerdings noch auf .Net 7. Wird wohl noch ein bisschen dauern bis das fuer .Net 8 nachgezogen ist.
Für CLI Clients
for demo only - dates are not valid
timeline
title Diversity Workbench - timeline
2023-11-15 : Einstieg in Version 8
2023-12-15 : IPM
: WinForm Client 2023-11-15
: WASM-Client 2023-12-15
2023-12-20 : WASM-Client
: Preview 2024-01-20
: Workshop 2014-03-22
2024-02-15 : WASM-Client for DC
gantt
dateFormat YYYY-MM-DD
title IPM
section IPM Winforms Client
Completed task :done, des1, 2024-01-06,2024-01-08
Active task :active, des2, 2024-01-09, 3d
Future task : des3, after des2, 5d
Future task2 : des4, after des3, 5d
section IPM WASM Client
Completed task in the critical line :crit, done, 2024-01-06,24h
Implement parser and jison :crit, done, after des1, 2d
Create tests for parser :crit, active, 3d
Future task in critical line :crit, 5d
Create tests for renderer :2d
Add to Mermaid :1d
gitGraph
commit
commit
branch develop
checkout develop
commit
commit
checkout main
merge develop
commit
commit
The DiversityWorkbench provides several applications addressing every IPM related task:
(!!! Heisst des wiklich so?, ist das nicht DTN? Der Kurz-Name ist doch schon TaxRef_SNSB_NHC-Pests? Es ist nicht klug Synonyme zu erzeugen.) -> das sind alles Platzhalter fuer Projekte in C#. TaxRef_SNSB_NHC-Pests ist nix was man als Projektbezeichner verwenden würde. Das ist ein internes Kürzel.
Taxonomic backbone providing 3 lists of taxa related to IPM:
The data include the taxonomic hierarchy, synonoyms, common names, life stages, links to information and thumbnails of the taxa for inclusion in e.g. tabular lists used for monitoring. Data are provided via a JSON API. For details see IPM
(Gibt es das schon?) -> nein - Platzhalter
Identification key for taxa provided by IPMtaxa
(ongoing project) -> klar - aber das sollte bis September fertig sein. Ongoing ist bei uns alles
Mobile application for collecting taxon observations in traps etc. You can import existing data to ensure continuity and build upon historical information. Data are stored in a local SQLite database and synchronized via an API with the main database to enable offline inspection of the traps, specimen etc.
es können alte Daten eingelesen und neue Daten geschrieben werden. Ändern und Löschen nach dem Speichern ist nicht vorgesehen.
Auswahl der Taxa die für die Erfassung berücksichtigt werden sollen
lesend
schreibend
Sensors collecting room temperature and moisture values communicate via Bluetooth LE with IPMhubs. IPMhubs communicate with IPMserver via LoRa IPMserver collects sensor data provided by the IPMhubs and stores these data in a Prometheus timeseries database. These data are then provided for import in the main database via LAN.
git submodule add https://github.com/McShelby/hugo-theme-relearn.git themes/relearnum das Theme auf die letzte Version zu bringen kann man den Befehl
git submodule update --remote --merge themes/relearn
verwenden
---
title: Installation
---  in 
[](http://media.snsb.info/Tutorials/dwb/Editing/OeffentlicheKontaktdaten.webm)
zu
[](http://media.snsb.info/Tutorials/dwb/Editing/OeffentlicheKontaktdaten.webm)
[Contact](Contact.htm)[Contact](/manual/dwb/editingdata/contact)baseURL = "http://www.diversityworkbench.de/manual/dwb/" dann muss diese auch für Verweise innerhalb der Files verwendet werden.
[Anmelden](/manual/dwb/database)### Table **AgentResource** über die Adresse /manual/dwb/database/database/#table-agentresource erreichen. Ein Index Eintrag dafür wäre e.g. [AgentResource](/manual/dwb/database/database/#table-agentresource). ACHTUNG - Case sensitiv: ### Table **AgentResource** wird in #table-agentresource übersetztYou can change the frontmatter to a default using the documentation tool
--- oben und unten abgegrenzt, e.g.
---
title: Login administration
linktitle: Logins
weight: 5
menuPre: <img src="/manual/dwb/img/Documentation.svg" height="20">
alwaysopen: false
---draft: true im Frontmatter markieren. Diese werden dann nicht in die Ausgabe übernommentitle: Login administration angegeben. Dieser erscheint dann auch in der Seite als Überschriftlinktitle: Logins. Ansonsten erscheit der Titel im Menüweight: 5 angegeben werden. Ansonsten wird alphabetisch sortiertmenuPre: <img src="/manual/dwb/img/LinkedServer.svg" height="20"> hinzufügen. Das Bild sollte *.svg seinalwaysopen: falseYou can adapt the images to a default using the documentation tool
mit px wird das Bild mitgezoomt, bei vw bleibt es gleich gross
mit der Angabe ...lightbox=false wird verhindert, dass ein Bild beim Anklicken mit der Maus geöffnet wird. Dies sollte bei Bildern die nicht nach svg konvertiert wurden und nicht im Fliesstext erscheinen nicht verwendet werden, damit der User bei kleinen Bildern diese in Originalauflösung betrachten kann. Unten 2 Beispiele


Für Links innerhalb des Manuals kann man shortcodes verwenden. Dafür entweder auf den Namen der Datei oder auf Links von Überschriften (ab ##) verwenden. Diese müssen innerhalb des Manuals eindeutig sein. Für Header als erstes Zeichen # dann Überschrift und alles lower case und Leerzeichen werden durch - ersetzt. Beispiel:
## Main form of diversityexsiccatae
wird zu sofern es sich in der gleichen Datei befindet:
{{ % relref "#main-form-of-diversityexsiccatae" % }}
Für Links ausserhalb der Datei werden Verweise unter Einschluss des Dateinamens verwendet:
Verweis auf ein Kapitel innerhalb einer Datei
{{ < relref "diversityexsiccatae#main-form-of-diversityexsiccatae" > }}
bzw. nur auf die Datei
{{ < relref "diversityexsiccatae" > }}
Leerzeichen zwischen {{ % und % }} entfernen
Von ausserhalb kann e.g. eine Überschrift mit
https://www.diversityworkbench.de/manual/dwb/modules/diversityexsiccatae/index.html#main-form-of-diversityexsiccatae
aufgerufen werden. Diese können direkt aus dem Manual kopiert werden.
<h4><b>DiversityAgents</b></h4>
<img src="/DA_4D.svg">Im Ordner static den Ordner images anlegen Datei favicon.ico in der Ordner static/images kopieren
Das Verzeichnis templates enthält Dateien die in andere Dateien über eine shortcode eingeschlossen werden können, e.g.:
{{% include file="templates/template_workbench.md" %}}
Diese Dateien dürfen kein frontmatter enthalten. Shortcodes müssen überprüft werden, da diese in der Regel nicht ausgewertet werden.
dieses kann als Mermaid eingebaut werden, e.g.
---
title: ER-Diagram
---
graph LR;
A[Agent] --> B[AgentContact<br/>Kontaktdaten der Agents]
A --> C[AgentReference]
A --> D[AgentIdentifier]
A --> E[AgentResource]
A --> F[AgentExternalID]
G[AgentExternalDatabase] --> F[AgentExternalID]soll das Diagramm zoombar sein wird die Version 5.23 des Themes benoetigt. Ausserdem kann der Parameter nur für die Shortcode Version angegeben werden, nicht für die Codefences:
{{ < mermaid align="center" zoom="true" > }}
...
(remove space between {{ and < resp > and }} in header and footer for correct code)
...
{{ < /mermaid > }}es werden 2 eigene Themes bereitgestellt
diese an DWB Anforderungen anpassen
#body img.inline {
display: inline !important;
margin: 0 !important;
vertical-align: middle;
/* vertical-align: bottom; */
}/*--MENU-HEADER-BG-color: rgba( 28, 144, 243, 1 );*/ /* Background color of menu header */
--MENU-HEADER-BG-color: rgba( 220, 220, 220, 1 ); /* Background color of menu header */
--MENU-HEADER-BORDER-color: rgba( 51, 161, 255, 1 ); /*Color of menu header border */
--MENU-SEARCH-color: rgba( 255, 255, 255, 1 ); /* Color of search field text */
/*--MENU-SEARCH-BG-color: rgba( 22, 122, 208, 1 );*/ /* Search field background color (by default borders + icons) */
--MENU-SEARCH-BG-color: rgba( 90, 90, 90, 1 ); /* Search field background color (by default borders + icons) */
/*--MENU-SEARCH-BORDER-color: rgba( 51, 161, 255, 1 );*/ /* Override search field border color */
--MENU-SEARCH-BORDER-color: rgba( 0, 0, 0, 1 ); /* Override search field border color */```native
baseURL = "http://www.diversityworkbench.de/manual/dwb/"
languageCode = "en-us"
title = "DiversityAgents"
theme = "relearn"
[outputs]
home = ["HTML", "RSS", "SEARCH", "SEARCHPAGE"]
section = ["HTML", "RSS", "PRINT"]
page = ["HTML", "RSS", "PRINT"]
[params]
themeVariant = [ "auto", "dwb", "dwb-dark" ]
```
hugo server eingeben.
localhost:1313baseURL = "http://www.diversityworkbench.de/manual/dwb/" dann muss die passende Adresse eingeben werden also e.g. localhost:1313/manual/dwb/In the HUGO / HTML tab you generate markdown files according to HUGO and the relearn theme.
The conversion and adaptions are explained in a short tutorial:
For enumeration tables the content can be exported as explained in a short tutorial:
In the tab you can fix links in markdown files according to HUGO shortcodes.
The fixes for broken links are explained in a short tutorial:
The adaptions for links for HUGO as related references are explained in a short tutorial:
To map the files in the original links to new files in the documentation follow the steps shown in a short tutorial:
To use this option you may have to install OpenSSH for Windows
To change the authentication mechanism to SSH keys in Visual Studio Code and GitHub, you need to follow these steps:
cd %USERPROFILE%ssh-keygen -a3 -t ed25519 -C "your_email@example.com" -f .ssh/id_github.
id_github. Make shure not to overwrite existing keys.+--[ED25519 256]--+
| .. .+=.o |
| .+ . o+* |
| . +.. ooo.o |
| +.B.+= =.o |
| =+S=o* = o |
| . oo*= o o |
| . . |
| . . o E |
| o . |
+----[SHA256]-----+Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa