Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
            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)));
            }
Beispiel #5
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);
        }
Beispiel #6
0
 public static extern AARTSAAPI_Result AARTSAAPI_ConfigGetInteger(ref AARTSAAPI_Device dhandle, ref AARTSAAPI_Config config, out long value);
Beispiel #7
0
 public static extern AARTSAAPI_Result AARTSAAPI_ConfigGetString(ref AARTSAAPI_Device dhandle, ref AARTSAAPI_Config config, char[] value, ref long size);
Beispiel #8
0
 public static extern AARTSAAPI_Result AARTSAAPI_ConfigSetString(ref AARTSAAPI_Device dhandle, ref AARTSAAPI_Config config, [MarshalAs(UnmanagedType.LPWStr)] string value);
Beispiel #9
0
 public static extern AARTSAAPI_Result AARTSAAPI_ConfigGetFloat(ref AARTSAAPI_Device dhandle, ref AARTSAAPI_Config config, out double value);
Beispiel #10
0
 public static extern AARTSAAPI_Result AARTSAAPI_ConfigGetInfo(ref AARTSAAPI_Device dhandle, ref AARTSAAPI_Config config, ref AARTSAAPI_ConfigInfo cinfo);
Beispiel #11
0
 public static extern AARTSAAPI_Result AARTSAAPI_ConfigGetName(ref AARTSAAPI_Device dhandle, ref AARTSAAPI_Config config, [MarshalAs(UnmanagedType.LPWStr)] out string name);
Beispiel #12
0
 public static extern AARTSAAPI_Result AARTSAAPI_ConfigFind(ref AARTSAAPI_Device dhandle, ref AARTSAAPI_Config group, ref AARTSAAPI_Config config, [MarshalAs(UnmanagedType.LPWStr)] string name);
Beispiel #13
0
 public static extern AARTSAAPI_Result AARTSAAPI_ConfigNext(ref AARTSAAPI_Device dhandle, ref AARTSAAPI_Config group, out AARTSAAPI_Config config);
Beispiel #14
0
 public static extern AARTSAAPI_Result AARTSAAPI_ConfigHealth(ref AARTSAAPI_Device dhandle, out AARTSAAPI_Config config);