|
1 | | -# PowerGrid API usage sample |
2 | | ------------------------------- |
| 1 | +--- |
| 2 | +page_type: sample |
| 3 | +languages: |
| 4 | +- csharp |
| 5 | +- cpp |
| 6 | +- cppwinrt |
| 7 | +products: |
| 8 | +- windows |
| 9 | +- windows-uwp |
| 10 | +urlFragment: PowerGrid |
| 11 | +extendedZipContent: |
| 12 | +- path: SharedContent |
| 13 | + target: SharedContent |
| 14 | +- path: LICENSE |
| 15 | + target: LICENSE |
| 16 | +description: "Shows how to use power grid forecasts." |
| 17 | +--- |
| 18 | + |
| 19 | +# Power grid forecast sample |
| 20 | + |
| 21 | +> **Note:** This sample is part of a large collection of UWP feature samples. |
| 22 | +> You can download this sample as a standalone ZIP file |
| 23 | +> [from docs.microsoft.com](https://docs.microsoft.com/samples/microsoft/windows-universal-samples/resizeappview/), |
| 24 | +> or you can download the entire collection as a single |
| 25 | +> [ZIP file](https://github.com/Microsoft/Windows-universal-samples/archive/master.zip), but be |
| 26 | +> sure to unzip everything to access shared dependencies. For more info on working with the ZIP file, |
| 27 | +> the samples collection, and GitHub, see [Get the UWP samples from GitHub](https://aka.ms/ovu2uq). |
| 28 | +> For more samples, see the [Samples portal](https://aka.ms/winsamples) on the Windows Dev Center. |
| 29 | +
|
3 | 30 | Shows how to use the PowerGrid Forecast API. |
4 | 31 |
|
5 | 32 | This sample covers the following: |
6 | | -- Obtaining the PowerGrid Forecast |
| 33 | +- Obtaining the power grid forecast |
7 | 34 | - Registering for ForecastUpdated notifications |
8 | 35 | - Looking for the lowest severity in a specified timeframe |
9 | 36 |
|
10 | | -## Requirements |
11 | | -- Visual Studio 2022 |
12 | | -- Windows 11 SDK |
13 | | -- Windows 11 |
| 37 | +**Note** The Windows universal samples require Visual Studio to build and Windows 11 to execute. |
| 38 | + |
| 39 | +To obtain information about Windows development, go to the [Windows Dev Center](http://go.microsoft.com/fwlink/?LinkID=532421) |
| 40 | + |
| 41 | +To obtain information about Microsoft Visual Studio and the tools for developing Windows apps, go to [Visual Studio](http://go.microsoft.com/fwlink/?LinkID=532422) |
| 42 | + |
| 43 | +## Related topics |
| 44 | + |
| 45 | +### Reference |
| 46 | + |
| 47 | +[PowerGridForecast class](https://learn.microsoft.com/uwp/api/windows.devices.power.powergridforecast) |
| 48 | + |
| 49 | +### Related samples |
| 50 | + |
| 51 | +[Power grid forecast from a Win32 app](https://github.com/microsoft/Windows-classic-samples/tree/main/Samples/PowerGrid) |
| 52 | + |
| 53 | +## System requirements |
| 54 | + |
| 55 | +- Windows 11 SDK (build 26100 or higher) |
| 56 | +- Windows 11 (build 26100 or higher) |
14 | 57 |
|
15 | 58 | ## Build the sample |
16 | | -Open the solution in Visual Studio 2022 and build. |
| 59 | + |
| 60 | +1. If you download the samples ZIP, be sure to unzip the entire archive, not just the folder with the sample you want to build. |
| 61 | +2. Start Microsoft Visual Studio and select **File** \> **Open** \> **Project/Solution**. |
| 62 | +3. Starting in the folder where you unzipped the samples, go to the Samples subfolder, then the subfolder for this specific sample, then the subfolder for your preferred language (C++, C#, or JavaScript). Double-click the Visual Studio Solution (.sln) file. |
| 63 | +4. Press Ctrl+Shift+B, or select **Build** \> **Build Solution**. |
17 | 64 |
|
18 | 65 | ## Run the sample |
19 | | -Run from within Visual Studio or open Windows Terminal and navigate to the directory with the built executable. From the terminal run `PowerGrid.exe`. |
| 66 | + |
| 67 | +The next steps depend on whether you just want to deploy the sample or you want to both deploy and run it. |
| 68 | + |
| 69 | +### Deploying the sample |
| 70 | + |
| 71 | +- Select Build > Deploy Solution. |
| 72 | + |
| 73 | +### Deploying and running the sample |
| 74 | + |
| 75 | +- To debug the sample and then run it, press F5 or select Debug > Start Debugging. To run the sample without debugging, press Ctrl+F5 or select Debug > Start Without Debugging. |
| 76 | + |
0 commit comments