init
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
---
|
||||
source_files:
|
||||
- DataPRO/Modules/DatabaseImporter/DatabaseImport/Controls/SensorsAndModels/ImportSensorsImportControl.cs
|
||||
generated_at: "2026-04-17T15:59:41.103394+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "a1d05ecf81eb6d1b"
|
||||
---
|
||||
|
||||
# Documentation: ImportSensorsImportControl.cs
|
||||
|
||||
## 1. Purpose
|
||||
|
||||
This module provides database cleanup functionality for the DatabaseImporter system, specifically for clearing application data tables during TDM export operations. It serves as a WPF UserControl that orchestrates the deletion of test templates, test objects, sensors, sensor models, calibrations, customer details, and various database entities. The module supports two modes: a basic clear operation and an extended database import mode that also removes users, tags, UI items, locked items, and historical database versions.
|
||||
|
||||
---
|
||||
|
||||
## 2. Public Interface
|
||||
|
||||
### `public static void ClearAllTables(bool clearForDbImport)`
|
||||
|
||||
Clears all major application data tables. When `clearForDbImport` is `true`, performs additional cleanup including DAS tables, locked items, users, tags, UI items, and old database versions. When `false`, only clears the core application collections.
|
||||
|
||||
**Signature:**
|
||||
```csharp
|
||||
public static void ClearAllTables(bool clearForDbImport)
|
||||
```
|
||||
|
||||
### `public static List<string[]> GetAllUsers()`
|
||||
|
||||
Retrieves all users from the database using the `sp_UserGet` stored procedure. Returns a list of string arrays, each containing user fields: ID, UserName, DisplayName, Password, Role, LastModified, LastModifiedBy, and LocalOnly.
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
---
|
||||
source_files:
|
||||
- DataPRO/Modules/DatabaseImporter/DatabaseImport/Controls/TestSetups/ImportTestSetup.cs
|
||||
generated_at: "2026-04-17T16:00:10.803585+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "fc36fa53e2d8d797"
|
||||
---
|
||||
|
||||
# Documentation: ImportTestSetup.cs
|
||||
|
||||
## 1. Purpose
|
||||
|
||||
`ImportTestSetup` is a WPF `UserControl` that handles importing test setup configuration data from XML into a SQL Server database. It serves as the import orchestrator for the DatabaseImport module, parsing XML elements and routing them to appropriate stored procedures. The module maintains static collections of imported entities (sensors, calibrations, customers, labs, test setups, etc.) and supports versioned import logic to handle different file format versions.
|
||||
|
||||
## 2. Public Interface
|
||||
|
||||
### Public Static Methods
|
||||
|
||||
| Method | Signature | Description |
|
||||
|--------|-----------|-------------|
|
||||
| `ProcessRootNode` | `void ProcessRootNode(string name, string outerXML, DbImporter.SetStatusDelegate SetStatus)` | Routes XML root elements to appropriate import handlers based on element name. Dispatches to `ImportElement` with corresponding stored procedure names. |
|
||||
|
||||
### Public Static Collections (Read-only Fields)
|
||||
|
||||
| Field | Type | Description |
|
||||
|-------|------|-------------|
|
||||
| `Directions` | `List<MMEDirections>` | Custom ISO direction fields |
|
||||
| `FilterClasses` | `List<MMEFilterClasses>` | Custom filter class fields |
|
||||
| `FineLoc1s` | `List<MMEFineLocations1>` | Fine location 1 fields |
|
||||
| `FineLoc2s` | `List<MMEFineLocations2>` | Fine location 2 fields |
|
||||
| `FineLoc3s` | `List<MMEFineLocations3>` | Fine location 3 fields |
|
||||
| `MainLocs` | `List<MMETransducerMainLocation>` | Transducer main location fields |
|
||||
| `TestObjects` | `List<MMETestObjects>` | Test object fields |
|
||||
| `PhysicalDimensions` | `List<MMEPhysicalDimensions>` | Physical dimension fields |
|
||||
| `Positions` | `List<MMEPositions>` | Position fields |
|
||||
| `Calibrations` | `List<SensorCalibration>` | Sensor calibration histories |
|
||||
| `CustomerDetails` | `List<ISO.CustomerDetails>` | Customer detail records |
|
||||
| `LabDetails` | `List<ISO.LabratoryDetails>` | Laboratory detail records |
|
||||
| `Sensors` | `List<SensorData>` | Sensor data records |
|
||||
| `_testSetups` | `List<TestTemplate>` | Test setup templates (public despite underscore prefix) |
|
||||
|
||||
### Public Enum
|
||||
|
||||
```csharp
|
||||
public enum PossibleStatus
|
||||
{
|
||||
Waiting,
|
||||
Working,
|
||||
Done,
|
||||
Failed
|
||||
}
|
||||
```
|
||||
|
||||
## 3. Invariants
|
||||
|
||||
- **Version Constant**: `CurrentVersion` is always `2.0D`.
|
||||
- **Command Timeout**: All stored procedure executions use a 60-second command timeout.
|
||||
- **XML Wrapping**: All XML passed to stored procedures is wrapped with outer element tags: `"<" + outerElementName + ">" + outerXML + "</" + outerElementName + ">"`.
|
||||
- **Collection State**: All static collections must be
|
||||
Reference in New Issue
Block a user