TellmePdmsPluging/AGENTS.md

2.5 KiB

Repository Guidelines

Project Structure & Module Organization

  • TellmePdmsPluging.sln contains a single plugin project targeting .NET Framework 3.5.
  • Class1.cs is the PDMS addin entry (IAddin) and lifecycle hook.
  • Commands/ contains command objects implementing Core/ICommand.cs (e.g., OpenProjectCommand, ExportIfcCommand).
  • Core/ holds shared runtime infrastructure (queueing, PDMS manager, main-thread invocation, API response models).
  • Network/ contains the local HTTP server and callback integration used by external clients.
  • Models/ stores request/response DTOs for API endpoints.
  • Documentation/ and NetInterfaceReferenceFiles/ provide design notes and AVEVA reference docs.

Build, Test, and Development Commands

Run commands in Windows terminal with UTF-8 code page:

chcp 65001
msbuild TellmePdmsPluging.sln /p:Configuration=Debug /p:Platform=x86
msbuild TellmePdmsPluging.sln /p:Configuration=Release /p:Platform=x86
  • Debug|x86: local validation and troubleshooting.
  • Release|x86: deployment artifact for PDMS host.

Smoke-check after loading the plugin in PDMS:

Invoke-WebRequest http://localhost:9001/health

Coding Style & Naming Conventions

  • Use 4-space indentation and K&R-style braces as in existing C# files.
  • Use PascalCase for public types/methods/properties, camelCase for locals/parameters, and _camelCase for private fields.
  • Keep command classes focused: parse/validate input in Network/, execute PDMS logic via Core/PdmsManager.
  • Preserve compatibility with .NET 3.5 and PDMS x86 runtime (avoid newer language/runtime features).

Testing Guidelines

  • There is currently no dedicated test project in this repository.
  • Validate changes with targeted endpoint checks (/health, /api/...) and PDMS integration scenarios.
  • If adding tests, place them in a separate *.Tests project and keep test names descriptive (MethodName_State_ExpectedResult).

Commit & Pull Request Guidelines

  • Follow existing commit style: concise, action-oriented summaries; current history mainly uses Chinese imperative verbs (implement/fix/add/improve equivalents).
  • Keep each commit focused on one functional change.
  • PRs should include: change summary, affected endpoints/modules, manual validation steps, and sample request/response payloads when APIs change.

Encoding & Environment Requirements

  • All text/code files must be UTF-8 without BOM.
  • Always run chcp 65001 before Windows command-line operations.
  • Do not save source files in GBK/GB2312/GB18030.