It would be better to use short form SCPI in enumeration to enable use of templates. For example:
public enum MeasurementFormatEnum
{
[Display("Lin Mag")]
MLINear,
[Display("Log Mag")]
MLOGarithmic,
[Display("Phase")]
PHASe,
[Display("Unwrapped Phase")]
UPHase,
[Display("Imaginary")]
IMAGinary,
[Display("Real")]
REAL,
[Display("Polar")]
POLar,
[Display("Smith")]
SMITh,
[Display("Inverted Smith")]
SADMittance,
[Display("SWR")]
SWR,
[Display("Group Delay")]
GDELay,
[Display("Kelvin")]
KELVin,
[Display("Fahrenheit")]
FAHRenheit,
[Display("Celsius")]
CELSius,
[Display("Positive Phase")]
PPHase,
[Display("Complex")]
COMPlex
}
This is causing the following to fail:
MeasurementFormatEnum measFormat = PNAX.ScpiQuery<MeasurementFormatEnum>($"CALCulate{channel}:MEASure{measurementNumber}:FORMat?");
with a System.Collections.Generic.KeyNotFoundException.
This would work:
public enum MeasurementFormatEnum
{
[Display("Lin Mag")]
MLIN,
[Display("Log Mag")]
MLOG,
[Display("Phase")]
PHAS,
[Display("Unwrapped Phase")]
UPH,
[Display("Imaginary")]
IMAG,
[Display("Real")]
REAL,
[Display("Polar")]
POL,
[Display("Smith")]
SMIT,
[Display("Inverted Smith")]
SADM,
[Display("SWR")]
SWR,
[Display("Group Delay")]
GDE,
[Display("Kelvin")]
KELV,
[Display("Fahrenheit")]
FAHR,
[Display("Celsius")]
CELS,
[Display("Positive Phase")]
PPH,
[Display("Complex")]
COMP
}
It would be better to use short form SCPI in enumeration to enable use of templates. For example:
This is causing the following to fail:
with a System.Collections.Generic.KeyNotFoundException.
This would work: