Beispiel #1
0
        private void RefreshData()
        {
            RyzenAccess.Initialize();
            Args = new uint[] { 0, 0, 0, 0, 0, 0 };
            RyzenAccess.SendPsmu(0x65, ref Args);
            int Index = 0;

            //string TestPrint = "";
            foreach (var item in Sensors)
            {
                Sensors[Index].Value = $"{ReadFloat(Address, OffsetTable[Index]):F4}";
                //Thread.Sleep(10);
                //TestPrint += (Sensors[Index].Value + Environment.NewLine);
                Index++;
            }
            CpuData.Refresh();
            RyzenAccess.Deinitialize();
            //MessageBox.Show(TestPrint);
        }
Beispiel #2
0
        private void ApplySettings_Click(object sender, EventArgs e)
        {
            RyzenAccess = new Smu(false);

            RyzenAccess.Initialize();

            //String exe = Directory.GetCurrentDirectory() + "\\smu-tool\\smu-tool.exe";

            int i = 0;

            Smu.Status[] Statuses = new Smu.Status[8];
            Args = new uint[6];

            if (checkStapmLimit.Checked)
            {
                //Set Msg and Args
                Msg     = 0x14;
                Args[0] = (uint)Convert.ToInt32(upDownStapmLimit.Value * 1000);

                //Send msg
                Statuses[i++] = RyzenAccess.SendMp1(Msg, ref Args);

                //args = String.Format("--message=0x14 --arg0={0:0}000", upDownStapmLimit.Value);
                //var proc = System.Diagnostics.Process.Start(exe, args);
            }

            if (checkFastLimit.Checked)
            {
                //Set Msg and Args
                Msg     = 0x15;
                Args[0] = (uint)Convert.ToInt32(upDownFastLimit.Value * 1000);

                //Send msg
                Statuses[i++] = RyzenAccess.SendMp1(Msg, ref Args);

                //args = String.Format("--message=0x15 --arg0={0:0}000", upDownFastLimit.Value);
                //var proc = System.Diagnostics.Process.Start(exe, args);
            }

            if (checkSlowLimit.Checked)
            {
                //Set Msg and Args
                Msg     = 0x16;
                Args[0] = (uint)Convert.ToInt32(upDownSlowLimit.Value * 1000);

                //Send msg
                Statuses[i++] = RyzenAccess.SendMp1(Msg, ref Args);

                //args = String.Format("--message=0x16 --arg0={0:0}000", upDownSlowLimit.Value);
                //var proc = System.Diagnostics.Process.Start(exe, args);
            }

            if (checkSlowTime.Checked)
            {
                //Set Msg and Args
                Msg     = 0x17;
                Args[0] = (uint)Convert.ToInt32(upDownSlowTime.Value);

                //Send msg
                Statuses[i++] = RyzenAccess.SendMp1(Msg, ref Args);

                //args = String.Format("--message=0x17 --arg0={0:0}", upDownSlowTime.Value);
                //var proc = System.Diagnostics.Process.Start(exe, args);
            }

            if (checkStapmTime.Checked)
            {
                //Set Msg and Args
                Msg     = 0x18;
                Args[0] = (uint)Convert.ToInt32(upDownStapmTime.Value);

                //Send msg
                Statuses[i++] = RyzenAccess.SendMp1(Msg, ref Args);

                //args = String.Format("--message=0x18 --arg0={0:0}", upDownStapmTime.Value);
                //var proc = System.Diagnostics.Process.Start(exe, args);
            }

            if (checkTctlTemp.Checked)
            {
                //Set Msg and Args
                Msg     = 0x19;
                Args[0] = (uint)Convert.ToInt32(upDownTctlTemp.Value);

                //Send msg
                Statuses[i++] = RyzenAccess.SendMp1(Msg, ref Args);

                //args = String.Format("--message=0x19 --arg0={0:0}", upDownTctlTemp.Value);
                //var proc = System.Diagnostics.Process.Start(exe, args);
            }

            if (checkCurrentLimit.Checked)
            {
                //Set Msg and Args
                Msg     = 0x1A;
                Args[0] = (uint)Convert.ToInt32(upDownCurrentLimit.Value * 1000);

                //Send msg
                Statuses[i++] = RyzenAccess.SendMp1(Msg, ref Args);

                //args = String.Format("--message=0x1A --arg0={0:0}000", upDownCurrentLimit.Value);
                //var proc = System.Diagnostics.Process.Start(exe, args);
            }
            if (checkMaxCurrentLimit.Checked)
            {
                //Set Msg and Args
                Msg     = 0x1C;
                Args[0] = (uint)Convert.ToInt32(upDownMaxCurrentLimit.Value * 1000);

                //Send msg
                Statuses[i++] = RyzenAccess.SendMp1(Msg, ref Args);

                //args = String.Format("--message=0x1C --arg0={0:0}000", upDownMaxCurrentLimit.Value);
                //var proc = System.Diagnostics.Process.Start(exe, args);
            }

            /*
             * IF "%Stapm%" NEQ "" smu-tool.exe -m --message=0x14 --arg0=%Stapm%000
             * IF "%Fast%" NEQ "" smu-tool.exe -m --message=0x15 --arg0=%Fast%000
             * IF "%Slow%" NEQ "" smu-tool.exe -m --message=0x16 --arg0=%Slow%000
             * IF "%SlowTime%" NEQ "" smu-tool.exe -m --message=0x17 --arg0=%SlowTime%
             * IF "%StapmTime%" NEQ "" smu-tool.exe -m --message=0x18 --arg0=%StapmTime%
             * IF "%Tctl%" NEQ "" smu-tool.exe -m --message=0x19 --arg0=%Tctl%
             * IF "%Current%" NEQ "" smu-tool.exe -m --message=0x1A --arg0=%Current%000
             * IF "%MaxCurrent%" NEQ "" smu-tool.exe -m --message=0x1C --arg0=%MaxCurrent%000
             */

            for (int j = 0; j < i; j++)
            {/*
              * if (Statuses[j] != Smu.Status.OK)
              * {
              *     throw new ApplicationException($"{j:D}-Status: " + Statuses[j].ToString());
              * }*/
            }

            RyzenAccess.Deinitialize();
        }