示例#1
0
        private static string GetModelName(IRGBDeviceInfo info, _CorsairChannelDeviceInfo channelDeviceInfo)
        {
            switch (channelDeviceInfo.type)
            {
            case CorsairChannelDeviceType.Invalid:
                return("Invalid");

            case CorsairChannelDeviceType.FanHD:
                return("HD Fan");

            case CorsairChannelDeviceType.FanSP:
                return("SP Fan");

            case CorsairChannelDeviceType.FanLL:
                return("LL Fan");

            case CorsairChannelDeviceType.FanML:
                return("ML Fan");

            case CorsairChannelDeviceType.Strip:
                // LS100 Led Strips are reported as one big strip if configured in monitor mode in iCUE, 138 LEDs for dual monitor, 84 for single
                if ((info.Model == "LS100 Starter Kit") && (channelDeviceInfo.deviceLedCount == 138))
                {
                    return("LS100 LED Strip (dual monitor)");
                }
                else if ((info.Model == "LS100 Starter Kit") && (channelDeviceInfo.deviceLedCount == 84))
                {
                    return("LS100 LED Strip (single monitor)");
                }
                // Any other value means an "External LED Strip" in iCUE, these are reported per-strip, 15 for short strips, 27 for long
                else if ((info.Model == "LS100 Starter Kit") && (channelDeviceInfo.deviceLedCount == 15))
                {
                    return("LS100 LED Strip (short)");
                }
                else if ((info.Model == "LS100 Starter Kit") && (channelDeviceInfo.deviceLedCount == 27))
                {
                    return("LS100 LED Strip (long)");
                }
                // Device model is "Commander Pro" for regular LED strips
                else
                {
                    return("LED Strip");
                }

            case CorsairChannelDeviceType.DAP:
                return("DAP Fan");

            case CorsairChannelDeviceType.Pump:
                return("Pump");

            case CorsairChannelDeviceType.FanQL:
                return("QL Fan");

            default:
                throw new ArgumentOutOfRangeException(nameof(channelDeviceInfo.type), channelDeviceInfo.type, null);
            }
        }
示例#2
0
        /// <summary>
        /// </summary>
        /// <param name="type"></param>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void ResolveAbsolutePath(Type type, object sender, ResolvePathEventArgs e)
        {
            if (sender.GetType() == type || sender.GetType().IsGenericType(type))
            {
                // Start from the plugin directory
                if (e.RelativePart != null && e.FileName != null)
                {
                    e.FinalPath = Path.Combine(PluginInfo.Directory.FullName, e.RelativePart, e.FileName);
                }
                else if (e.RelativePath != null)
                {
                    e.FinalPath = Path.Combine(PluginInfo.Directory.FullName, e.RelativePath);
                }

                IRGBDeviceInfo deviceInfo = ((IRGBDevice)sender).DeviceInfo;
                if (e.FileName != null && !File.Exists(e.FinalPath))
                {
                    Logger?.Information("Couldn't find a layout for device {deviceName}, model {deviceModel} at {filePath}",
                                        deviceInfo.DeviceName, deviceInfo.Model, e.FinalPath);
                }
            }
        }