public static string ParseForMiningPairs(List <MiningPair> MiningPairs, DeviceType deviceType, bool showLog = true)
        {
            _showLog = showLog;

            MinerBaseType minerBaseType = MinerBaseType.NONE;
            AlgorithmType algorithmType = AlgorithmType.NONE;

            if (MiningPairs.Count > 0)
            {
                var algo = MiningPairs[0].Algorithm;
                if (algo != null)
                {
                    algorithmType = algo.NiceHashID;
                    minerBaseType = algo.MinerBaseType;
                }
            }

            MinerType minerType = GetMinerType(deviceType, minerBaseType, algorithmType);

            MinerOptionPackage minerOptionPackage = ExtraLaunchParameters.GetMinerOptionPackageForMinerType(minerType);

            List <MiningPair> setMiningPairs = MiningPairs.ConvertAll((mp) => mp);

            // handle exceptions and package parsing
            // CPU exception
            if (deviceType == DeviceType.CPU && minerType != MinerType.Xmrig)
            {
                CheckAndSetCPUPairs(setMiningPairs);
            }
            // ethminer exception
            if (MinerType.ethminer_OCL == minerType || MinerType.ethminer_CUDA == minerType)
            {
                // use if missing compute device for correct mapping
                // init fakes workaround
                var cdevs_mappings = new List <MiningPair>();
                {
                    int id       = -1;
                    var fakeAlgo = new Algorithm(MinerBaseType.ethminer, AlgorithmType.DaggerHashimoto, "daggerhashimoto");
                    foreach (var pair in setMiningPairs)
                    {
                        while (++id != pair.Device.ID)
                        {
                            var fakeCdev = new ComputeDevice(id);
                            cdevs_mappings.Add(new MiningPair(fakeCdev, fakeAlgo));
                        }
                        cdevs_mappings.Add(pair);
                    }
                }
                // reset setMiningPairs
                setMiningPairs = cdevs_mappings;
            }
            // sgminer exception handle intensity types
            if (MinerType.sgminer == minerType)
            {
                // rawIntensity overrides xintensity, xintensity overrides intensity
                var sgminer_intensities = new List <MinerOption>()
                {
                    new MinerOption("Intensity", "-I", "--intensity", "d", MinerOptionFlagType.MultiParam, ","),      // default is "d" check if -1 works
                    new MinerOption("Xintensity", "-X", "--xintensity", "-1", MinerOptionFlagType.MultiParam, ","),   // default none
                    new MinerOption("Rawintensity", "", "--rawintensity", "-1", MinerOptionFlagType.MultiParam, ","), // default none
                };
                var contains_intensity = new Dictionary <MinerOptionType, bool>()
                {
                    { "Intensity", false },
                    { "Xintensity", false },
                    { "Rawintensity", false },
                };
                // check intensity and xintensity, the latter overrides so change accordingly
                foreach (var cDev in setMiningPairs)
                {
                    foreach (var intensityOption in sgminer_intensities)
                    {
                        if (!string.IsNullOrEmpty(intensityOption.ShortName) && cDev.CurrentExtraLaunchParameters.Contains(intensityOption.ShortName))
                        {
                            cDev.CurrentExtraLaunchParameters        = cDev.CurrentExtraLaunchParameters.Replace(intensityOption.ShortName, intensityOption.LongName);
                            contains_intensity[intensityOption.Type] = true;
                        }
                        if (cDev.CurrentExtraLaunchParameters.Contains(intensityOption.LongName))
                        {
                            contains_intensity[intensityOption.Type] = true;
                        }
                    }
                }
                // replace
                if (contains_intensity["Intensity"] && contains_intensity["Xintensity"])
                {
                    LogParser("Sgminer replacing --intensity with --xintensity");
                    foreach (var cDev in setMiningPairs)
                    {
                        cDev.CurrentExtraLaunchParameters = cDev.CurrentExtraLaunchParameters.Replace("--intensity", "--xintensity");
                    }
                }
                if (contains_intensity["Xintensity"] && contains_intensity["Rawintensity"])
                {
                    LogParser("Sgminer replacing --xintensity with --rawintensity");
                    foreach (var cDev in setMiningPairs)
                    {
                        cDev.CurrentExtraLaunchParameters = cDev.CurrentExtraLaunchParameters.Replace("--xintensity", "--rawintensity");
                    }
                }
            }

            string ret     = "";
            string general = Parse(setMiningPairs, minerOptionPackage.GeneralOptions, false, minerOptionPackage.TemperatureOptions);

            // temp control and parse
            if (ConfigManager.GeneralConfig.DisableAMDTempControl)
            {
                LogParser("DisableAMDTempControl is TRUE, temp control parameters will be ignored");
                ret = general;
            }
            else
            {
                LogParser("AMD parsing temperature control parameters");
                // temp = Parse(setMiningPairs, minerOptionPackage.TemperatureOptions, true, minerOptionPackage.GeneralOptions);
                string temp = Parse(setMiningPairs, minerOptionPackage.TemperatureOptions, false, minerOptionPackage.GeneralOptions);

                ret = general + "  " + temp;
            }

            return(ret);
        }
        public static string ParseForMiningPairs(List <MiningPair> MiningPairs, DeviceType deviceType, bool showLog = true)
        {
            _showLog = showLog;

            MinerBaseType minerBaseType = MinerBaseType.NONE;
            AlgorithmType algorithmType = AlgorithmType.NONE;

            if (MiningPairs.Count > 0)
            {
                var algo = MiningPairs[0].Algorithm;
                if (algo != null)
                {
                    algorithmType = algo.CryptoMiner937ID;
                    minerBaseType = algo.MinerBaseType;
                }
            }

            MinerType minerType = GetMinerType(deviceType, minerBaseType, algorithmType);

            MinerOptionPackage minerOptionPackage = ExtraLaunchParameters.GetMinerOptionPackageForMinerType(minerType);

            List <MiningPair> setMiningPairs = MiningPairs.ConvertAll((mp) => mp);

            // handle exceptions and package parsing
            // CPU exception
            if (deviceType == DeviceType.CPU)
            {
                CheckAndSetCPUPairs(setMiningPairs);
            }
            // sgminer exception handle intensity types
            if (MinerType.sgminer == minerType)
            {
                // rawIntensity overrides xintensity, xintensity overrides intensity
                var sgminer_intensities = new List <MinerOption>()
                {
                    new MinerOption("Intensity", "-I", "--intensity", "d", MinerOptionFlagType.MultiParam, ","),      // default is "d" check if -1 works
                    new MinerOption("Xintensity", "-X", "--xintensity", "-1", MinerOptionFlagType.MultiParam, ","),   // default none
                    new MinerOption("Rawintensity", "", "--rawintensity", "-1", MinerOptionFlagType.MultiParam, ","), // default none
                };
                var contains_intensity = new Dictionary <MinerOptionType, bool>()
                {
                    { "Intensity", false },
                    { "Xintensity", false },
                    { "Rawintensity", false },
                };
                // check intensity and xintensity, the latter overrides so change accordingly
                foreach (var cDev in setMiningPairs)
                {
                    foreach (var intensityOption in sgminer_intensities)
                    {
                        if (!string.IsNullOrEmpty(intensityOption.ShortName) && cDev.CurrentExtraLaunchParameters.Contains(intensityOption.ShortName))
                        {
                            cDev.CurrentExtraLaunchParameters        = cDev.CurrentExtraLaunchParameters.Replace(intensityOption.ShortName, intensityOption.LongName);
                            contains_intensity[intensityOption.Type] = true;
                        }
                        if (cDev.CurrentExtraLaunchParameters.Contains(intensityOption.LongName))
                        {
                            contains_intensity[intensityOption.Type] = true;
                        }
                    }
                }
                // replace
                if (contains_intensity["Intensity"] && contains_intensity["Xintensity"])
                {
                    LogParser("Sgminer replacing --intensity with --xintensity");
                    foreach (var cDev in setMiningPairs)
                    {
                        cDev.CurrentExtraLaunchParameters = cDev.CurrentExtraLaunchParameters.Replace("--intensity", "--xintensity");
                    }
                }
                if (contains_intensity["Xintensity"] && contains_intensity["Rawintensity"])
                {
                    LogParser("Sgminer replacing --xintensity with --rawintensity");
                    foreach (var cDev in setMiningPairs)
                    {
                        cDev.CurrentExtraLaunchParameters = cDev.CurrentExtraLaunchParameters.Replace("--xintensity", "--rawintensity");
                    }
                }
            }
            if (MinerType.glg == minerType)
            {
                // rawIntensity overrides xintensity, xintensity overrides intensity
                var glg_intensities = new List <MinerOption>()
                {
                    new MinerOption("Intensity", "-I", "--intensity", "d", MinerOptionFlagType.MultiParam, ","),      // default is "d" check if -1 works
                    new MinerOption("Xintensity", "-X", "--xintensity", "-1", MinerOptionFlagType.MultiParam, ","),   // default none
                    new MinerOption("Rawintensity", "", "--rawintensity", "-1", MinerOptionFlagType.MultiParam, ","), // default none
                };
                var contains_intensity = new Dictionary <MinerOptionType, bool>()
                {
                    { "Intensity", false },
                    { "Xintensity", false },
                    { "Rawintensity", false },
                };
                // check intensity and xintensity, the latter overrides so change accordingly
                foreach (var cDev in setMiningPairs)
                {
                    foreach (var intensityOption in glg_intensities)
                    {
                        if (!string.IsNullOrEmpty(intensityOption.ShortName) && cDev.CurrentExtraLaunchParameters.Contains(intensityOption.ShortName))
                        {
                            cDev.CurrentExtraLaunchParameters        = cDev.CurrentExtraLaunchParameters.Replace(intensityOption.ShortName, intensityOption.LongName);
                            contains_intensity[intensityOption.Type] = true;
                        }
                        if (cDev.CurrentExtraLaunchParameters.Contains(intensityOption.LongName))
                        {
                            contains_intensity[intensityOption.Type] = true;
                        }
                    }
                }
                // replace
                if (contains_intensity["Intensity"] && contains_intensity["Xintensity"])
                {
                    LogParser("Gateless Gate replacing --intensity with --xintensity");
                    foreach (var cDev in setMiningPairs)
                    {
                        cDev.CurrentExtraLaunchParameters = cDev.CurrentExtraLaunchParameters.Replace("--intensity", "--xintensity");
                    }
                }
                if (contains_intensity["Xintensity"] && contains_intensity["Rawintensity"])
                {
                    LogParser("Gateless Gat replacing --xintensity with --rawintensity");
                    foreach (var cDev in setMiningPairs)
                    {
                        cDev.CurrentExtraLaunchParameters = cDev.CurrentExtraLaunchParameters.Replace("--xintensity", "--rawintensity");
                    }
                }
            }

            string ret     = "";
            string general = Parse(setMiningPairs, minerOptionPackage.GeneralOptions, false, minerOptionPackage.TemperatureOptions);

            // temp control and parse
            if (ConfigManager.GeneralConfig.DisableAMDTempControl)
            {
                LogParser("DisableAMDTempControl is TRUE, temp control parameters will be ignored");
                ret = general;
            }
            else
            {
                LogParser("AMD parsing temperature control parameters");
                // temp = Parse(setMiningPairs, minerOptionPackage.TemperatureOptions, true, minerOptionPackage.GeneralOptions);
                string temp = Parse(setMiningPairs, minerOptionPackage.TemperatureOptions, false, minerOptionPackage.GeneralOptions);

                ret = general + "  " + temp;
            }

            return(ret);
        }