Beispiel #1
0
        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);
        }
Beispiel #2
0
        public MSIABControlState Reload()
        {
            MSIABControlState result;

            result = MSIABControl.Start(0);

            if (result == MSIABControlState.Success)
            {
                FillDgvMSI();
                for (int i = 0; i < dgvMSI.RowCount; i++)
                {
                    if ((dgvMSI["GpuId", i].Value != null) && (oldGPUId.Trim() == dgvMSI["GpuId", i].Value.ToString().Trim()))
                    {
                        dgvMSI.CurrentCell = dgvMSI.Rows[i].Cells[0];
                        break;
                    }
                }
            }
            else
            {
                InitDgvMSI();
            }

            SetFormState();
            lblState.Text = "Reload: " + result.ToString();
            return(result);
        }
Beispiel #3
0
        MSIABControlState SetProfile()
        {
            currentProfileSettings.CoreClk      = (int)nudCoreClk.Value;
            currentProfileSettings.MemClk       = (int)nudMemClk.Value;
            currentProfileSettings.PowerLimit   = (int)nudPowerLimit.Value;
            currentProfileSettings.ThermalLimit = (int)nudThermalLimit.Value;

            return(MSIABControl.SaveProfileSetting((int)nudProfile.Value, currentProfileSettings));
        }
Beispiel #4
0
        void FillDgvMSI()
        {
            InitDgvMSI();

            for (int i = 0; i < MSIABControl.GpuCount; i++)
            {
                GPUDrvType DrvType;
                int        DrvTypeIndex;

                MSIABControl.GetType(i, out DrvType, out DrvTypeIndex);
                dgvMSI.Rows.Add(new String[]
                                { i.ToString(),
                                  MSIABControl.MAHM.GpuEntries[i].Index.ToString(),
                                  DrvType.ToString(),
                                  DrvTypeIndex.ToString(),
                                  MSIABControl.MAHM.GpuEntries[i].Device,
                                  MSIABControl.MAHM.GpuEntries[i].Family,
                                  MSIABControl.MAHM.GpuEntries[i].GpuId });
            }
        }
Beispiel #5
0
 private void closeToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Log.Wrl("Close = " + MSIABControl.Close().ToString());
 }
Beispiel #6
0
 private void MiReload_Click(object sender, EventArgs e)
 {
     Log.Wrl("ReloadMSIABInfo(5000) = " + MSIABControl.ReloadMSIABInfo(5000).ToString());
     LogException();
     FillDgvMSI();
 }
Beispiel #7
0
 private void MiRestart_Click(object sender, EventArgs e)
 {
     Log.Wrl("Restart(0) = " + MSIABControl.Restart((int)nudProfile.Value).ToString());
     LogException();
     FillDgvMSI();
 }
Beispiel #8
0
 private void MiMSIABStart_Click(object sender, EventArgs e)
 {
     Log.Wrl("Start(0) = " + MSIABControl.Start(0).ToString());
     LogException();
     FillDgvMSI();
 }
Beispiel #9
0
        //int tempIndex = 0;

        public GPUInfo(string GPUId)
        {
            MAGPUId = GPUId.Trim();
            MAState = MSIABControl.Start(0);

            if (MAState == MSIABControlState.Success)
            {
                //for (int i = 0; i < MSIABControl.GpuCount; i++)
                //{
                //  if (MSIABControl.MAHM.GpuEntries[i].GpuId.ToUpper().Trim() == MAGPUId.ToUpper())
                //  {
                //    MAIndex = i;
                //    DeviceName = MSIABControl.MAHM.GpuEntries[i].Device;
                //    break;
                //  }
                //}

                //for (int i = 0; i <= MAIndex; i++)
                //{
                //  if (MSIABControl.MAHM.GpuEntries[i].Device == DeviceName)
                //    tempIndex++;
                //}
                OHIndex = MSIABControl.GetAtiNvidiaCardIndex(GPUId);
            }

            if ((DeviceName != "") && (OHIndex >= 0))//(tempIndex>0))
            {
                OHComputer.Open();
                OHComputer.GPUEnabled = true;

                //for (int i = 0; i < OHComputer.Hardware.Length; i++)
                //{
                //  if (OHComputer.Hardware[i].Name.ToUpper().Contains(DeviceName.ToUpper()) || DeviceName.ToUpper().Contains(OHComputer.Hardware[i].Name.ToUpper()))
                //  {
                //    tempIndex--;
                //    if (tempIndex == 0)
                //    {
                //      OHIndex = i;
                //      break;
                //    }
                //  }
                //}

                if (OHComputer.Hardware[OHIndex].Name.ToUpper() != DeviceName.ToUpper())
                {
                    OHIndex = -1;
                }

                if (OHIndex >= 0)
                {
                    for (int j = 0; j < OHComputer.Hardware[OHIndex].Sensors.Length; j++)
                    {
                        string _name = OHComputer.Hardware[OHIndex].Sensors[j].Name.Trim().ToUpper();

                        switch (OHComputer.Hardware[OHIndex].Sensors[j].SensorType)
                        {
                        case SensorType.Clock:
                            if (_name.Contains(OHCoreIndexName.ToUpper()))
                            {
                                OHCoreClockIndex = j;
                            }
                            else if (_name.Contains(OHMemoryIndexName.ToUpper()))
                            {
                                OHMemoryClockIndex = j;
                            }
                            break;

                        case SensorType.Temperature:
                            if (_name.Contains(OHCoreIndexName.ToUpper()))
                            {
                                OHCoreTemperatureIndex = j;
                            }
                            break;

                        case SensorType.Control:
                            if (_name.Contains(OHFanIndexName.ToUpper()))
                            {
                                OHControlFanIndex = j;
                            }
                            break;

                        default:
                            break;
                        }
                    }
                }

                OHComputer.Close();
            }
        }