4.8 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | ||
|---|---|---|---|---|---|---|
|
2026-04-16T04:30:25.113253+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | ae1921064164fa41 |
Properties
Documentation: DatabaseImport Module
1. Purpose
This module (DatabaseImport) is a .NET assembly responsible for managing database import functionality within the DataPRO system. It provides configuration-driven behavior for import operations, including specifying where downloaded data is stored (DownloadFolder), controlling whether automatic arming of systems is permitted (AllowAutoArm), defining calibration warning thresholds (CalWarningPeriodDays), selecting the target database type (DBType), and enforcing compatibility requirements for ISO export generation (RequireXCrashCompatibilityForISOExports). Its role is to encapsulate and expose application-level settings used during database import workflows.
2. Public Interface
The module exposes only one public type:
-
DatabaseImport.Properties.Settings(internal sealed class, but accessible viaSettings.Defaultstatic property)
A strongly-typed settings class derived fromSystem.Configuration.ApplicationSettingsBase. Provides read/write access to application and user-scoped configuration values.-
public static Settings Default { get; }
Returns the singleton instance of theSettingsclass, synchronized for thread safety. -
public string DownloadFolder { get; }
Application-scoped. Returns the default path for downloaded data files. Default value:"..\Data". -
public bool AllowAutoArm { get; }
Application-scoped. Controls whether automatic arming (likely of measurement or acquisition systems) is permitted during import. Default value:false. -
public int CalWarningPeriodDays { get; set; }
User-scoped. Specifies the number of days before calibration expiry at which a warning should be issued. Default value:7. Supports runtime modification (setter present). -
public int DBType { get; }
Application-scoped. Encodes the type of database to target for import (e.g., enum-like integer). Default value:1. Interpretation of values is not defined in this file. -
public bool RequireXCrashCompatibilityForISOExports { get; }
Application-scoped. Enforces compatibility with "XCrash" format when exporting ISO data. Default value:true.
-
3. Invariants
Settings.Defaultis a singleton and thread-safe (viaApplicationSettingsBase.Synchronized).DownloadFolder,AllowAutoArm,DBType, andRequireXCrashCompatibilityForISOExportsare application-scoped and immutable at runtime (read-only properties).CalWarningPeriodDaysis user-scoped and mutable at runtime (has a public setter).- All settings have explicitly defined default values via
[DefaultSettingValueAttribute]. - No runtime validation of setting values (e.g.,
DBTypevalues,CalWarningPeriodDayssign) is present in this file.
4. Dependencies
- Dependencies of this module:
System.Configuration(forApplicationSettingsBase, attributes likeApplicationScopedSettingAttribute,UserScopedSettingAttribute)System.Runtime.CompilerServices,System.CodeDom.Compiler,System.Diagnostics(for attributes)System(core types)
- Depended upon by:
- Other modules in the
DataPRO.Modules.DatabaseImportersolution (e.g., import logic that consumesSettings.Default.DownloadFolder,Settings.Default.DBType, etc.). - UI layers (e.g., settings dialogs) that bind to
Settings.Defaultfor user-modifiable values likeCalWarningPeriodDays.
- Other modules in the
5. Gotchas
DBTypesemantics are opaque: The integer value has no documented meaning (e.g., 1 = SQLite? SQL Server? Custom DB?). Consumers must infer or document externally.DownloadFolderis relative: Path"..\Data"is relative to the application’s base directory; behavior may vary if the app is launched from a different working directory.- No schema versioning: Settings are not versioned or migrated; changing defaults (e.g.,
DBType) may break existing user configurations if not handled by a higher-level updater. AllowAutoArmdefault isfalse: If auto-arm is expected to be enabled by default in production, this may indicate legacy or safety-conscious design.- User-scoped settings persist per-user: Changes to
CalWarningPeriodDaysare saved per-user profile; may cause inconsistent behavior in shared environments (e.g., terminals, kiosks). - Auto-generated file:
Settings.Designer.csis generated by Visual Studio’s Settings Designer; manual edits risk being overwritten.
None identified beyond the above.