4.0 KiB
4.0 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |||||
|---|---|---|---|---|---|---|---|---|---|
|
2026-04-17T16:03:17.836512+00:00 | zai-org/GLM-5-FP8 | 1 | 75434fd7a99fb627 |
InputRangeAttributes
Purpose
This module provides a set of custom attributes used to annotate gain-related enum values with metadata controlling input range behavior for data acquisition hardware. The attributes allow fine-grained control over gain availability, disabled states, and input range boundaries (min/max/firmware values) in millivolts, supporting different hardware configurations including modified vs unmodified Gen 3 SPS devices.
Public Interface
GainDisabledAttribute : Attribute
GainDisabledAttribute(bool disabled)- Constructor; marks a gain as disabled whendisabledis true.static bool IsGainDisabled(object o)- Returns true if the object (typically an enum value) hasGainDisabledAttributewith_bDisabled = true. Returns false if null, no member found, or attribute not present.
MaxInputRangeAttribute : Attribute
MaxInputRangeAttribute(double maxInputRangemV)- Constructor; sets maximum input range in mV.static double GetMaxInputRangemV(object o)- Returns the maximum input range in mV for the given object. Returns 0D if null, no member found, or attribute not present.
GainAvailableUnmodifiedAttribute : Attribute
GainAvailableUnmodifiedAttribute(bool available)- Constructor; marks availability for unmodified Gen 3 SPS.static bool IsGainAvailableToUnmodified(object o)- Returns true if gain is available to unmodified Gen 3 SPS. Returns true by default (if attribute not present). Returns false only if attribute is present withavailable = false.
MinInputRangeAttribute : Attribute
MinInputRangeAttribute(double minInputRangemV)- Constructor; sets minimum input range in mV.static double GetMinInputRangemV(object o)- Returns the minimum input range in mV for the given object. Returns 0D if null, no member found, or attribute not present.
FirmwareInputRangeAttribute : Attribute
FirmwareInputRangeAttribute(double firmwareInputRangemV)- Constructor; sets the input range value to send to firmware.static double GetFirmwareInputRangemV(object o)- Returns the firmware input range in mV for the given object. Returns 0D if null, no member found, or attribute not present.
Invariants
- All static retrieval methods accept
object(intended for enum values) and use reflection viaGetMember(o.ToString()). - Default behaviors:
IsGainDisabled: returnsfalse(gains are enabled by default)IsGainAvailableToUnmodified: returnstrue(available by default)- Range getters: return
0Dif attribute not present
- All attributes are in namespace
DTS.DASLib.Servicedespite folder location suggesting otherwise.
Dependencies
- Depends on:
System(for Attribute and reflection APIs) - Depended on by: Unclear from source alone - likely gain-related enums in the data acquisition service layer.
Gotchas
- Namespace mismatch: The namespace
DTS.DASLib.Servicedoes not match the folder pathDataPRO/IService/Classes/InputRangeAttributes. A ReSharper comment suppresses namespace check. - FogBugz references: Comments reference internal bug tracker URLs (e.g.,
http://fogbugz/fogbugz/default.asp?10080) which are inaccessible externally. - Reflection assumption: The static methods assume
o.ToString()returns a valid member name; ifois not an enum or the string doesn't match a member, methods return default values silently. - Typo in field name:
FirmwareInputRangeAttribute._firmwareInputRangeAttribute- the field name repeats the class name rather than describing the value.