private bool SetConfig(string cfg, string value) { AARTSAAPI_Config config = new AARTSAAPI_Config(true); if (AARTSAAPI_ConfigFind(ref Device, ref ConfigRoot, ref config, cfg) == AARTSAAPI_Result.AARTSAAPI_OK) { return(AARTSAAPI_ConfigSetString(ref Device, ref config, value) == AARTSAAPI_Result.AARTSAAPI_OK); } return(false); }
private double GetConfig(string cfg, double defaultValue = 0) { AARTSAAPI_Config config = new AARTSAAPI_Config(true); if (AARTSAAPI_ConfigFind(ref Device, ref ConfigRoot, ref config, cfg) == AARTSAAPI_Result.AARTSAAPI_OK) { double ret = 0; AARTSAAPI_ConfigGetFloat(ref Device, ref config, out ret); return(ret); } return(defaultValue); }
private long GetConfigInteger(string cfg, long defaultValue = 0) { AARTSAAPI_Config config = new AARTSAAPI_Config(true); if (AARTSAAPI_ConfigFind(ref Device, ref ConfigRoot, ref config, cfg) == AARTSAAPI_Result.AARTSAAPI_OK) { long ret = 0; AARTSAAPI_ConfigGetInteger(ref Device, ref config, out ret); return(ret); } return(defaultValue); }
public ConfigNode(AARTSAAPI_Device dev, AARTSAAPI_Config cfg) { Device = dev; Config = cfg; ConfigInfo = new AARTSAAPI_ConfigInfo(false); AARTSAAPI_ConfigGetInfo(ref Device, ref Config, ref ConfigInfo); char[] str = new char[1024]; long strLen = str.Length; AARTSAAPI_ConfigGetString(ref Device, ref Config, str, ref strLen); ValueString = new string(str, 0, (int)Math.Min(strLen, str.ToList().IndexOf((char)0))); }
private string GetConfigString(string cfg, string defaultValue = "") { AARTSAAPI_Config config = new AARTSAAPI_Config(true); if (AARTSAAPI_ConfigFind(ref Device, ref ConfigRoot, ref config, cfg) == AARTSAAPI_Result.AARTSAAPI_OK) { char[] ret = new char[1024]; long length = ret.Length; AARTSAAPI_ConfigGetString(ref Device, ref config, ret, ref length); return(new string(ret, 0, (int)Math.Min(length, ret.ToList().IndexOf((char)0)))); } return(defaultValue); }
public static extern AARTSAAPI_Result AARTSAAPI_ConfigGetInteger(ref AARTSAAPI_Device dhandle, ref AARTSAAPI_Config config, out long value);
public static extern AARTSAAPI_Result AARTSAAPI_ConfigGetString(ref AARTSAAPI_Device dhandle, ref AARTSAAPI_Config config, char[] value, ref long size);
public static extern AARTSAAPI_Result AARTSAAPI_ConfigSetString(ref AARTSAAPI_Device dhandle, ref AARTSAAPI_Config config, [MarshalAs(UnmanagedType.LPWStr)] string value);
public static extern AARTSAAPI_Result AARTSAAPI_ConfigGetFloat(ref AARTSAAPI_Device dhandle, ref AARTSAAPI_Config config, out double value);
public static extern AARTSAAPI_Result AARTSAAPI_ConfigGetInfo(ref AARTSAAPI_Device dhandle, ref AARTSAAPI_Config config, ref AARTSAAPI_ConfigInfo cinfo);
public static extern AARTSAAPI_Result AARTSAAPI_ConfigGetName(ref AARTSAAPI_Device dhandle, ref AARTSAAPI_Config config, [MarshalAs(UnmanagedType.LPWStr)] out string name);
public static extern AARTSAAPI_Result AARTSAAPI_ConfigFind(ref AARTSAAPI_Device dhandle, ref AARTSAAPI_Config group, ref AARTSAAPI_Config config, [MarshalAs(UnmanagedType.LPWStr)] string name);
public static extern AARTSAAPI_Result AARTSAAPI_ConfigNext(ref AARTSAAPI_Device dhandle, ref AARTSAAPI_Config group, out AARTSAAPI_Config config);
public static extern AARTSAAPI_Result AARTSAAPI_ConfigHealth(ref AARTSAAPI_Device dhandle, out AARTSAAPI_Config config);