Read-only export of DEV vd03 and QA vq03 (2026-11-12): the only
Children["DelmiaRecv"] user is CvdReactor.ProcessRecipeDownload (script 4,
identical on both envs; DEV 3 / QA 9 instances), and the only ScriptAlarm
.Severity reader is DEV TestMesMachine.AlarmStatus (script 42, SBTEST01/02).
QA has no #131 work.
Adds the original (rollback) and fixed bodies, a guarded check/apply/rollback
script that re-sends every script field, and the apply plan: #52 any time,
#131 with or after the dd4f1c2a binary. The old #131 body still compiles on
main but returns banded values; the fixed body is what fails to compile on the
deployed binaries. Rig evidence for both gates is in the README.
Refs #52 #131
Claude-Session: https://claude.ai/code/session_01GT67ACmpMR7b9LGRPLijMi
This commit is contained in:
+26
@@ -0,0 +1,26 @@
|
||||
// Generic DELMIA recipe-download — performed DIRECTLY on the composed DelmiaReceiver child
|
||||
// (mirrors how MesMoveIn writes the MESReceiver child) instead of delegating via CallScript.
|
||||
// No side logic; the receiver's own DelmiaReceiver.Download method holds the same handshake.
|
||||
var recv = Children["DelmiaReceiver"];
|
||||
System.Func<object,bool> IsTrue = v => { var s=v?.ToString(); return (v is bool b && b)||s=="1"||string.Equals(s,"true",System.StringComparison.OrdinalIgnoreCase); };
|
||||
System.Func<string,object?> P = k => Parameters.ContainsKey(k) ? Parameters[k] : null;
|
||||
if (!IsTrue(recv.Attributes["ReadyFlag"]))
|
||||
return new { Result=false, ResultText="Receiver ready flag not set to true" };
|
||||
try {
|
||||
recv.Attributes["RecipeProcessedFlag"] = false;
|
||||
var data = new System.Collections.Generic.Dictionary<string, object?> {
|
||||
{ "DownloadPath", P("DownloadPath") },
|
||||
{ "WorkOrderNumber", P("WorkOrderNumber") },
|
||||
{ "PartNumber", P("PartNumber") },
|
||||
{ "JobStepNumber", P("JobStepNumber") },
|
||||
{ "Username", P("Username") },
|
||||
};
|
||||
if (!await recv.Attributes.WriteBatchAndWaitAsync(data, "RecipeDownloadFlag", true, "RecipeProcessedFlag", true, System.TimeSpan.FromSeconds(25)))
|
||||
return new { Result=false, ResultText="Timeout waiting for recipe to be processed" };
|
||||
return new {
|
||||
Result = IsTrue(recv.Attributes["RecipeProcessResult"]),
|
||||
ResultText = recv.Attributes["RecipeProcessResultText"]?.ToString() ?? ""
|
||||
};
|
||||
} catch (Exception ex) {
|
||||
return new { Result=false, ResultText="RecipeDownload failed: " + ex.Message };
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
var code = Parameters["MachineCode"]?.ToString() ?? "";
|
||||
var flaggedOnly = Parameters.Get<bool?>("FlaggedOnly") ?? false;
|
||||
var includeAck = Parameters.Get<bool?>("IncludeAcked") ?? true;
|
||||
var minSev = Parameters.Get<int?>("MinSeverity");
|
||||
var maxSev = Parameters.Get<int?>("MaxSeverity");
|
||||
var nameFilter = Parameters.ContainsKey("NameFilter") ? Parameters["NameFilter"]?.ToString() : null;
|
||||
try {
|
||||
var alarms = flaggedOnly ? await Alarms.MesReportableAsync() : await Alarms.CurrentAsync();
|
||||
var infos = alarms
|
||||
.Where(a => a.Active && !a.IsConfiguredPlaceholder)
|
||||
.Where(a => minSev == null || a.Priority >= minSev)
|
||||
.Where(a => maxSev == null || a.Priority <= maxSev)
|
||||
.Where(a => string.IsNullOrEmpty(nameFilter) || a.Name.Contains(nameFilter, StringComparison.OrdinalIgnoreCase))
|
||||
.Where(a => includeAck || !a.Acknowledged)
|
||||
.Select(a => new {
|
||||
Name = a.Name,
|
||||
HierarchicalName = code + "." + a.Name,
|
||||
Description = !string.IsNullOrEmpty(a.Message) ? a.Message : !string.IsNullOrEmpty(a.AlarmTypeName) ? a.AlarmTypeName : a.Name,
|
||||
IsFlaggedForMES = a.IsMesReportable,
|
||||
Severity = a.Priority, // MES Severity = the raw 0-999 priority (ScriptAlarm.Priority, #129)
|
||||
StatusCode = a.Acknowledged ? "Triggered.Acked" : "Triggered",
|
||||
TriggeredDT = (a.OriginalRaiseTime ?? a.Timestamp).ToString("o"),
|
||||
AckDT = a.AckTime?.ToString("o"),
|
||||
AckComment = a.OperatorComment })
|
||||
.ToList();
|
||||
return new { WasSuccessful = true, ErrorText = (string)null, Alarms = infos };
|
||||
} catch (Exception ex) {
|
||||
return new { WasSuccessful = false, ErrorText = "AlarmStatus failed: " + ex.Message, Alarms = Array.Empty<object>() };
|
||||
}
|
||||
Reference in New Issue
Block a user