How kessity/test works
Project Type and Purpose
• A monolithic, desktop‐based engineering/test application built with NI LabWindows/CVI.
• Key roles: user interface, hardware/instrument control, lightweight database storage, and a custom build pipeline.
File Structure Analysis
• Top‐level artifacts:
• UI resource files: MAIN.uir, splash.uir
• Application logic: MAIN.c, mainTdm.c, special0.c, common.c, splash.c
• Headers: MAIN.h, common.h, splash.h, cvi_db.h
• Instrument config: special0.icd … special5.icd, common.icd
• Database files: cvi_db.fp
• Project file: main.prj
• Build folder: cvibuild.main/Release (scripts, Jamfile, .obj, .res, manifest.xml)
• Patterns:
• Layered separation: UI, business logic, data access, instrument control
• Custom build automation with batch files and Jamfile
Key Architectural Components
a. UI Layer
– Panels defined in .uir files
– Callback implementations in MAIN.c and splash.c
b. Business Logic Layer
– mainTdm.c: orchestration of test modules
– specialX.c + .icd files: instrument‐specific routines
– common.c: shared utilities
c. Data Access Layer
– cvi_db.fp + cvi_db.h: file‐based DB read/write
d. Instrument Control Subsystem
– .icd definitions loaded by CVI runtime
– Initialization, data acquisition, cleanup in special*.c
e. Build & Deployment
– cvibuild.main scripts (.bat, Jamfile)
– Compiler/linker options, resource compilation
– Outputs: executable, .res, manifest
Component Relationships
• UI → Business Logic: user actions invoke logic functions
• Logic → Data Access: configuration/results persistence
• Logic → Instrument Control: hardware I/O calls
• All source & resources → Build System → final EXE + artifacts
Architectural Patterns & Principles
• Layered architecture for separation of concerns
• Modularity: distinct modules for UI, logic, data, hardware control
• Lightweight persistence via flat‐file DB