Exemplo n.º 1
0
        public MainWindow()
        {
            try
            {
                IconSource = GetIcon("pack://application:,,,/ZenTimings;component/Resources/ZenTimings.ico", 16);

                InitSystemInfo();

                if (settings.DarkMode)
                {
                    settings.ChangeTheme();
                }

                InitializeComponent();
                ReadMemoryModulesInfo();
                ReadTimings();

                if (settings.AdvancedMode)
                {
                    PowerTable             = new PowerTable(OPS.Smu.SMU_TYPE);
                    BMC                    = new BiosMemController();
                    PowerCfgTimer.Interval = TimeSpan.FromMilliseconds(2000);
                    PowerCfgTimer.Tick    += new EventHandler(PowerCfgTimer_Tick);

                    ReadMemoryConfig();
                    ReadSVI();

                    // Get first base address
                    dramBaseAddress = (uint)(OPS.GetDramBaseAddress() & 0xFFFFFFFF);
                    if (dramBaseAddress > 0)
                    {
                        ReadPowerConfig();
                    }
                    else
                    {
                        compatMode = true;
                    }

                    StartAutoRefresh();
                }

                DataContext = new
                {
                    timings    = MEMCFG,
                    powerTable = PowerTable,
                    settings,
                };
            }
            catch (ApplicationException ex)
            {
                HandleError(ex.Message);
                //Dispose();
                ExitApplication();
            }
        }
Exemplo n.º 2
0
        public MainForm()
        {
            try
            {
#if BETA
                MessageBox.Show("This is a BETA version of the application. Some functions might be working incorrectly.\n\n" +
                                "Please report if something is not working as expected.");
#endif
#if DEBUG
                Debug.Listeners.AddRange(listeners);
#endif
                InitSystemInfo();
                InitializeComponent();
                BindControls();
                ReadMemoryModulesInfo();
                ReadTimings();

                if (!settings.AdvancedMode)
                {
                    SwitchToCompactMode();
                }
                else
                {
                    PowerTable = new PowerTable(OPS.Smu.SMU_TYPE);
                    BMC        = new BiosMemController();

                    BindAdvancedControls();
                    ReadMemoryConfig();
                    ReadSVI();

                    // Get first base address
                    dramBaseAddress = (uint)(OPS.GetDramBaseAddress() & 0xFFFFFFFF);
                    if (dramBaseAddress > 0)
                    {
                        ReadPowerConfig();
                    }
                    else
                    {
                        compatMode = true;
                    }

                    StartAutoRefresh();
                }
            }
            catch (ApplicationException ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Dispose();
                ExitApplication();
            }
        }
Exemplo n.º 3
0
 public DebugDialog(uint dramBaseAddr, List <MemoryModule> memModules,
                    MemoryConfig memCfg, SystemInfo systemInfo,
                    BiosMemController biosMemCtrl, PowerTable powerTable,
                    Ops ops)
 {
     InitializeComponent();
     baseAddress = dramBaseAddr;
     modules     = memModules;
     SI          = systemInfo;
     MEMCFG      = memCfg;
     PT          = powerTable;
     BMC         = biosMemCtrl;
     OPS         = ops;
 }
Exemplo n.º 4
0
        public MainForm()
        {
            try
            {
                PowerTable = new PowerTable(OPS.Smu.SMU_TYPE);
                BMC        = new BiosMemController();
#if BETA
                MessageBox.Show("This is a BETA version of the application. Some functions might be working incorrectly.\n\n" +
                                "Please report if something is not working as expected.");
#endif
#if DEBUG
                Debug.Listeners.AddRange(listeners);
#endif
                InitSystemInfo();
                InitializeComponent();
                BindControls();
            }
            catch (ApplicationException ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Dispose();
                ExitApplication();
            }
        }
Exemplo n.º 5
0
        //private Computer computer;

        public MainWindow()
        {
            try
            {
                SplashWindow.Loading("CPU");
                cpu = new Cpu();

                if (cpu.info.family.Equals(Cpu.Family.UNSUPPORTED))
                {
                    throw new ApplicationException("CPU is not supported.");
                }
                else if (cpu.info.codeName.Equals(Cpu.CodeName.Unsupported))
                {
                    throw new ApplicationException("CPU model is not supported.\nPlease run a debug report and send to the developer.");
                }

                IconSource = GetIcon("pack://application:,,,/ZenTimings;component/Resources/ZenTimings.ico", 16);
                InitializeComponent();
                SplashWindow.Loading("Memory modules");
                ReadMemoryModulesInfo();
                SplashWindow.Loading("Timings");

                // Read from first enabled DCT
                if (modules.Count > 0)
                {
                    ReadTimings(modules[0].DctOffset);
                }
                else
                {
                    ReadTimings();
                }

                if (settings.AdvancedMode)
                {
                    PowerCfgTimer.Interval = TimeSpan.FromMilliseconds(2000);
                    PowerCfgTimer.Tick    += PowerCfgTimer_Tick;

                    SplashWindow.Loading("Waiting for power table");
                    if (WaitForPowerTable())
                    {
                        SplashWindow.Loading("Reading power table");
                        // refresh the table again, to avoid displaying initial fclk, mclk and uclk values,
                        // which seem to be a little off when transferring the table for the "first" time,
                        // after an idle period
                        RefreshPowerTable();
                    }
                    else
                    {
                        SplashWindow.Loading("Power table error!");
                    }

                    SplashWindow.Loading("Plugins");
                    SplashWindow.Loading("SVI2 Plugin");
                    plugins.Add(new SVI2Plugin(cpu));
                    ReadSVI();

                    /*computer = new Computer()
                     * {
                     *  //CPUEnabled = true,
                     *  //RAMEnabled = true,
                     *  MainboardEnabled = true,
                     *  //FanControllerEnabled = true,
                     * };
                     *
                     * computer.Open();*/

                    if (!AsusWmi.Init())
                    {
                        AsusWmi.Dispose();
                        AsusWmi = null;
                    }

                    StartAutoRefresh();


                    SplashWindow.Loading("Memory controller");
                    BMC = new BiosMemController();
                    ReadMemoryConfig();
                }

                SplashWindow.Loading("Done");

                DataContext = new
                {
                    timings = MEMCFG,
                    cpu.powerTable,
                    WMIPresent = !compatMode,
                    settings
                };
            }
            catch (Exception ex)
            {
                HandleError(ex.Message);
                ExitApplication();
            }
        }
Exemplo n.º 6
0
        public MainWindow()
        {
            try
            {
                SplashWindow.Loading("CPU");

                IconSource = GetIcon("pack://application:,,,/ZenTimings;component/Resources/ZenTimings.ico", 16);

                if (cpu.info.family != Cpu.Family.FAMILY_17H && cpu.info.family != Cpu.Family.FAMILY_19H)
                {
                    HandleError("CPU is not supported.");
                    ExitApplication();
                }
                else if (cpu.info.codeName == Cpu.CodeName.Unsupported)
                {
                    HandleError("CPU model is not supported.\n" +
                                "Please run a debug report and send to the developer.");
                }

                InitializeComponent();
                SplashWindow.Loading("Memory modules");
                ReadMemoryModulesInfo();
                SplashWindow.Loading("Timings");

                // Read from first enabled DCT
                if (modules.Count > 0)
                {
                    ReadTimings(modules[0].DctOffset);
                }

                if (settings.AdvancedMode)
                {
                    if (cpu.info.codeName != Cpu.CodeName.Unsupported)
                    {
                        PowerCfgTimer.Interval = TimeSpan.FromMilliseconds(2000);
                        PowerCfgTimer.Tick    += new EventHandler(PowerCfgTimer_Tick);

                        SplashWindow.Loading("SVI2");
                        ReadSVI();

                        SplashWindow.Loading("Waiting for power table");
                        if (WaitForPowerTable())
                        {
                            // refresh the table again, to avoid displaying initial fclk, mclk and uclk values,
                            // which seem to be a little off when transferring the table for the "first" time,
                            // after an idle period
                            RefreshPowerTable();
                            SplashWindow.Loading("Reading power table");
                        }
                        else
                        {
                            SplashWindow.Loading("Power table error!");
                        }

                        if (!AsusWmi.Init())
                        {
                            AsusWmi.Dispose();
                            AsusWmi = null;
                        }

                        StartAutoRefresh();
                    }

                    SplashWindow.Loading("Memory controller");
                    BMC = new BiosMemController();
                    ReadMemoryConfig();
                }

                SplashWindow.Loading("Done");

                DataContext = new
                {
                    timings = MEMCFG,
                    cpu.powerTable,
                    WMIPresent = !compatMode,
                    settings
                };
            }
            catch (ApplicationException ex)
            {
                HandleError(ex.Message);
                //Dispose();
                ExitApplication();
            }
        }