コード例 #1
0
ファイル: FrMain.cs プロジェクト: belomord/GControlSrv
        MSIABControlState LoadProfile()
        {
            MSIABControlState result = MSIABControlState.Success;

            if (dgvMSI.CurrentRow == null)
            {
                return(MSIABControlState.IndexOutOfRange);
            }

            int i = dgvMSI.CurrentRow.Index;

            if (i >= MSIABControl.GpuCount)
            {
                return(MSIABControlState.IndexOutOfRange);
            }

            string GpuId = MSIABControl.MAHM.GpuEntries[i].GpuId;

            currentProfileSettings = MSIABControl.LoadProfileSetting(GpuId, (int)nudProfile.Value);
            nudCoreClk.Value       = currentProfileSettings.CoreClk;
            nudMemClk.Value        = currentProfileSettings.MemClk;
            nudPowerLimit.Value    = currentProfileSettings.PowerLimit;
            nudThermalLimit.Value  = currentProfileSettings.ThermalLimit;

            return(result);
        }
コード例 #2
0
        public static MSIABProfileSettings Load(string iniFileName, string profileSectionName)
        {
            MSIABProfileSettings result = new MSIABProfileSettings();

            try
            {
                IniFile ini = new IniFile(iniFileName);

                result.Format       = StrToValue(ini.Read("Format", profileSectionName, ""));
                result.PowerLimit   = StrToValue(ini.Read("PowerLimit", profileSectionName, ""));
                result.ThermalLimit = StrToValue(ini.Read("ThermalLimit", profileSectionName, ""));
                result.CoreClk      = StrToValue(ini.Read("CoreClk", profileSectionName, ""));
                result.MemClk       = StrToValue(ini.Read("MemClk", profileSectionName, ""));
                result.FanMode      = StrToValue(ini.Read("FanMode", profileSectionName, ""));
                result.FanSpeed     = StrToValue(ini.Read("FanSpeed", profileSectionName, ""));
            }
            catch
            {
                result = new MSIABProfileSettings();
            }

            return(result);
        }