Initial commit: Wonderware / System Platform tools and reference

Five tools under one repo, all docs organized per DOCS-GUIDE.md:

- aalogcli: .NET 4.8 / x86 CliFx CLI for reading System Platform binary
  logs (*.aaLGX) for LLM debugging, built on aaOpenSource/aaLog. Commands:
  last, tail, range, unread, fields. Stable JSON envelope under --llm-json.
  Build template under lib/build/ for rebuilding aaLogReader.dll.

- aot: ArchestrA Object Toolkit 2014 v4.0 reference material. Dev guide
  (Markdown converted from CHM), API reference for the ArchestrA.Toolkit
  namespace, and the Monitor / Watchdog VS sample solutions.

- graccesscli: .NET 4.8 / x86 CliFx CLI that automates Galaxy
  configuration via the ArchestrA GRAccess COM interop. Includes session
  daemon, IPC protocol, and llm-json envelope contract.

- grdb: SQL/DDL exploration of the Galaxy Repository database. DDL
  captures, reusable queries, hierarchy / contained-name <-> tag-name
  translation notes.

- histdb: LLM-oriented reference for AVEVA Historian retrieval. INSQL
  linked-server, extension tables, every wwXxx time-domain extension,
  every retrieval mode, alarm/event SQL recipes, REST API. Distilled
  from the 243-page Historian Retrieval Guide.

Root contains:
- CLAUDE.md: thin index pointing into each tool's README.
- DOCS-GUIDE.md: doctrine for organizing docs for LLM consumption.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Joseph Doherty
2026-05-03 18:22:20 -04:00
commit 32f26272ae
411 changed files with 69973 additions and 0 deletions
@@ -0,0 +1,44 @@
//------------------------------------------------------------------------------
// Copyright (C) 2008 Invensys Systems Inc. All rights reserved.
//
// THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//------------------------------------------------------------------------------
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("StatsConfigtime")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("ArchestrA")]
[assembly: AssemblyProduct("Configtime")]
[assembly: AssemblyCopyright("Copyright © Wonderware 2006")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(true)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("f413d64a-8d99-4e96-ac2b-77a673299ac5")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.1.0.0")]
@@ -0,0 +1,302 @@
//------------------------------------------------------------------------------
// Copyright (C) 2008 Invensys Systems Inc. All rights reserved.
//
// THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//------------------------------------------------------------------------------
using System;
using System.Runtime.InteropServices;
using ArchestrA.Core;
using ArchestrA.Toolkit;
namespace ArchestrA.Toolkit.Watchdog
{
[Guid("057251b9-4dfa-4216-80ae-0981f7bc63e9")]
/// <summary>
/// Summary description for WatchdogConfigtime
/// </summary>
public class StatsConfigtime : ConfigtimeBase
{
#region Attributes - Toolkit generated code
// The following C# properties have been defined to simplify access to
// attribute values - do not modify the contents of this region with
// the code editor.
private bool TimeoutCnt_Historized
{
get { return GetValue("TimeoutCnt.Historized"); }
set { SetValue("TimeoutCnt.Historized", (value)); }
}
#endregion Attributes
#region Internal Reference Only
//Toolkit code required to access the attributes declared in the Object Class
private Stats InternalReferenceOnly = null;
#endregion Internal Reference Only
#region Declarations
//Declare Configtime Class Variables here.
//Variables declared in this region are available to all methods
//in the Configtime Class.
#endregion Declarations
public StatsConfigtime()
{
InternalReferenceOnly = new Stats();
this.AObjectInstance = InternalReferenceOnly;
#region Configuration Event Registration - Toolkit generated code
// Required region for Configuration Events - do not modify
// the contents of this region with the code editor.
this.ConfigtimeInitialize += new ConfigtimeInitializeDelegate(StatsConfigtime_ConfigtimeInitialize);
this.ConfigtimeValidate += new ConfigtimeValidateDelegate(StatsConfigtime_ConfigtimeValidate);
this.ConfigtimeMigrate += new MigrateDelegate(StatsConfigtime_ConfigtimeMigrate);
this.ConfigtimeDynamic += new ConfigtimeDynamicSetHandlerDelegate(StatsConfigtime_ConfigtimeDynamic);
this.PreValidate += new ObjectEventDelegate(StatsConfigtime_PreValidate);
this.PostCreate += new ObjectEventDelegate(StatsConfigtime_PostCreate);
#endregion Configuration Event Registration
#region Configtime Set Handler Registration Toolkit generated code
// Required method for Configtime SetHandlers.
// Changes made using the code editor will appear in the Toolkit Editor.
//
// WARNING: Changes made to this region will result in a Shape Change.
// TODO: Configtime SetHandler registration
// this.RegisterConfigtimeSetHandler("Example_001", new ConfigtimeSetHandlerDelegate(Example_001SetHandler));
this.RegisterConfigtimeSetHandler("TimeoutCnt.Historized", new ConfigtimeSetHandlerDelegate(TimeoutCnt_HistorizedSetHandler));
#endregion Configtime Set Handler Registration
#region Primitive Wrapper Initialization - Toolkit generated code
#endregion Primitive Wrapper Initialization
}
private void StatsConfigtime_ConfigtimeInitialize(object sender)
{
//------------------------------------------------------------------------------
// TODO: Configtime Event - Initialize
//
// Any custom initialization can be done here, including caching of attribute
// values, primitive IDs etc.
//------------------------------------------------------------------------------
}
private void StatsConfigtime_ConfigtimeMigrate(object sender, ref MigrateHandler migrate)
{
//------------------------------------------------------------------------------
// TODO: Configtime Event - Migrate
//
// Migrate executes when importing a template into a Galaxy that contains
// a previous version (major) of the template. The template must be derived or
// instantiated for migrate to execute.
//
// Migrate provides access to the previous versions attribute information.
// A typical application for migrate code is to preserve attribute values
// when an attribute name has changed (refer to the Example code below).
//
// To enable this event the migrate option must be configured via the Toolkit
// Editor or in code (i.e. [ObjectAttributes.AMigrate("1","2")]).
//
// If no implementation is provided, the system will copy all attribute values
// from the old object to the new one by matching the attribute names.
//------------------------------------------------------------------------------
#region Example code
// //Check major version of previous template
// if (migrate.MajorVersion() == 1)
// {
// //Attribute "Eg_001" has been renamed to "Example_001".
// //Transfer attribute value, lock and security classification
// Example_001 = migrate.GetValue("Eg_001"); //Gets value
// Example_001.Locked = migrate.GetLocked("Eg_001"); //Gets lock status
// Example_001.Security = migrate.GetSecurity("Eg_001"); //Gets Security Classification
//
// //Transfer primitive values
// SetValue("Example_001.TrendHi", migrate.GetValue("Eg_001.TrendHi"));
// SetValue("Example_001.TrendHi", EATTRIBUTEPROPERTY.idxAttribPropLocked, migrate.GetLocked("Eg_001.TrendHi"));
//
// //Automatically migrate all child primitives
// migrate.AutoMigrateChildPrimitives = true;
// }
#endregion
}
private void StatsConfigtime_ConfigtimeValidate(object sender, ref EPACKAGESTATUS status)
{
//------------------------------------------------------------------------------
// TODO: Configtime Event - Validate
//
// Validate sets the warning or error text for the object.
// It is used to check conditions that would not be checked using
// a SetHandler, such as reporting that an object was not
// configured, or that combinations of attributes are illegal.
//
// Other than calling AddWarningMessage or AddErrorMessage, Validate
// should never modify the state of the object.
//------------------------------------------------------------------------------
#region Example code
// if (MyTestDefaultState)
// {
// //Add a warning message using the dictionay phrase ID "ObjectStillInDefaultState"
// AddWarningMessage(GetText("ObjectStillInDefaultState"));
//
// //Change the status to Warning if the current status is Good
// if (status == EPACKAGESTATUS.ePackageGood)
// {
// status = EPACKAGESTATUS.ePackageWarning;
// }
// }
//
// if (MyTestAttributeCombinationValid)
// {
// //Add a warning message using the dictionay phrase ID "AttributeCombinationInvalid"
// AddWarningMessage(GetText("AttributeCombinationInvalid"));
//
// // Change the status to Warning if the current status is Good
// if (status == EPACKAGESTATUS.ePackageGood)
// {
// status = EPACKAGESTATUS.ePackageWarning;
// }
// }
#endregion
// By default set the object status to Good
status = EPACKAGESTATUS.ePackageGood;
// The following statement will exit validate when validating templates.
// Place code that should be validated in templates and instances before this
// statement. Code placed after this statement will execute in instances only.
if (IsTemplate)
{
return;
}
}
private void StatsConfigtime_ConfigtimeDynamic(object sender, ref ConfigtimeSetHandlerEventArgs e)
{
string attrName = Get(e.attributeHandle.shAttributeId, e.attributeHandle.shPrimitiveId, EATTRIBUTEPROPERTY.idxAttribPropName);
//------------------------------------------------------------------------------
// TODO: Configtime Event - Dynamic Set Handler
//
// Implement set handler code for any dynamic attributes you create with set handlers
//------------------------------------------------------------------------------
#region Example
// if (attrName == "MyDynamic")
// {
// if (e.Value > 10)
// {
// LogWarning(string.Format("value for {0} must be less or equal to 10", attrName));
// }
// else
// {
// SetValue(attrName, e.Value);
// }
//
//
// return;
// }
#endregion
// if unhandled a warning is shown as a reminder
SetValue(e.attributeHandle.shAttributeId, e.attributeHandle.shPrimitiveId, e.Value);
LogWarning(string.Format("Uknown set handler for attribute '{0}'", attrName));
}
private void StatsConfigtime_PostCreate(object sender, object optionalParameter)
{
//------------------------------------------------------------------------------
// TODO: Configtime Event - PostCreate
//
// OnPostCreate is called when an object is first created.
//
// One purpose for implementing this method is to insure that the initial
// state of the primitive is valid.
//
// This method can be used by a Resuable Primitive to correct invalid initial
// states that can arise when an attribute value has been overridden. If the
// attribute has a SetHandler with validation or side effects the SetHandler
// does not execute as overrides do not trigger SetHandlers.
//------------------------------------------------------------------------------
#region Example code
// // If statistics are enabled, add the Statistics virtual primitive
// // the way the SetHandler would have done it.
// if (StatsEnable)
// {
// AddPrimitive("Statistics", "Statistics1", "Statistics1");
// }
#endregion
}
private void StatsConfigtime_PreValidate(object sender, object optionalParameter)
{
//------------------------------------------------------------------------------
// TODO: Configtime Event - PreValidate
//
// PreValidate is called when the object is about to be validated (e.g. when
// an edit session is ending and the object is about to be saved.)
//
// A primitive can modify attributes within this method.
//
// Note: It is often not necessary to perform any actions in OnPreValidate.
//------------------------------------------------------------------------------
}
private void TimeoutCnt_HistorizedSetHandler(object sender, ref ConfigtimeSetHandlerEventArgs e)
{
// Required Set Handler for Virtual History Primtive.
// Do not modify this Set Handler via the code editor.
//
// WARNING: Changes made to this Set Handler will be overwritten by the code generator.
if (TimeoutCnt_Historized == e.Value)
{
return;
}
if (e.Value)
{
if (!AddPrimitive("TimeoutCntHistory", "TimeoutCntHistory1", "TimeoutCnt"))
{
e.Message = PrimitiveResult.message;
return; // Add failed
}
}
else
{
if (!DeletePrimitive("TimeoutCntHistory1"))
{
e.Message = PrimitiveResult.message;
return; // Remove Failed failed
}
}
TimeoutCnt_Historized = e.Value;
}
//TODO: Configtime SetHandler declaration
//private void Example_001SetHandler(object sender, ref ConfigtimeSetHandlerEventArgs e)
//{
// Example_001 = e.Value;
//}
}
}
@@ -0,0 +1,132 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{63437254-FEDA-404A-8FCB-B2036ED949CB}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ArchestrA.Toolkit.Watchdog</RootNamespace>
<AssemblyName>WatchDogStatsConfigtime1</AssemblyName>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\Watchdog.snk</AssemblyOriginatorKeyFile>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<IsWebBootstrapper>false</IsWebBootstrapper>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<Reference Include="ArchestrA.Toolkit.ArchestrAObjectSupport, Version=4.0.0.0, Culture=neutral, PublicKeyToken=f787e550f2f530ee, processorArchitecture=MSI">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files\Archestra\Toolkits\AOT\bin\ArchestrA.Toolkit.ArchestrAObjectSupport.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="ArchestrA.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=23106a86e706d0ae">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files\Archestra\Toolkits\AOT\bin\ArchestrA.Core.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="StatsConfigtime.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Service Include="{94E38DFF-614B-4cbd-B67C-F211BB35CE8B}" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Statsobj\Statsobj.csproj">
<Project>{A7BA2304-935A-4DDD-80CC-E6387B2980E6}</Project>
<Name>Statsobj</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="..\..\Watchdog.snk">
<Link>Watchdog.snk</Link>
</None>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
<Visible>False</Visible>
<ProductName>.NET Framework 2.0 %28x86%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
<Visible>False</Visible>
<ProductName>.NET Framework 3.0 %28x86%29</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
<PreBuildEvent>
</PreBuildEvent>
</PropertyGroup>
</Project>