C# Class RemoteLedMatrix.MainPage

Main page of the RemoteLedMatrix application. Contains the actual controls for the led matrix, as well as the settings bar and instance.
Inheritance: Windows.UI.Xaml.Controls.Page
Afficher le fichier Open project: ms-iot/LEDMatrix

Méthodes publiques

Свойство Type Description
CurrentConnection RemoteLedMatrix.Helpers.Connection
Instance MainPage
IsInSettings bool
_isPreviewing bool

Méthodes publiques

Méthode Description
CheckAlwaysRunning ( bool force = null ) : void

Tries to keep the machine from locking/sleeping by periodically making a DisplayRequest

Connect ( Connection selectedConnection ) : System.Threading.Tasks.Task

Connects to a remote device over firmata

Disconnect ( ) : void

Disconnects the current connection and cleans up any related objects

MainPage ( ) : System
PopulateList ( ) : void

Populates the list of connections in the settings UI

RefreshConnections ( ) : Task

Refreshes the connections from the available device sources

Méthodes protégées

Méthode Description
OnNavigatedTo ( NavigationEventArgs e ) : void
OnNavigatingFrom ( NavigatingCancelEventArgs e ) : void

Private Methods

Méthode Description
Application_Resuming ( object sender, object o ) : void
Application_Suspending ( object sender, SuspendingEventArgs e ) : void
CaptureTimerTick ( object sender, object e ) : void

Performs a capture every timer tick, to provide continuous streaming

CleanupCameraAsync ( ) : System.Threading.Tasks.Task

Cleans up the camera resources (after stopping the preview if necessary) and unregisters from MediaCapture events

ConvertDisplayOrientationToDegrees ( DisplayOrientations orientation ) : int

Converts the given orientation of the app on the screen to the corresponding rotation in degrees

DisplayInformation_OrientationChanged ( DisplayInformation sender, object args ) : void

This event will fire when the page is rotated

Display_Tapped ( object sender, TappedRoutedEventArgs e ) : void

Display button tapped event handler

FindCameraDeviceByPanelAsync ( Windows.Devices.Enumeration.Panel desiredPanel ) : Task

Queries the available video capture devices to try and find one mounted on the desired panel

GetPreviewFrameAsSoftwareBitmapAsync ( ) : System.Threading.Tasks.Task

Gets the current preview frame as a SoftwareBitmap, displays its properties in a TextBlock, and can optionally display the image in the UI and/or save it to disk as a jpg

GetPreviewFrameButton_Tapped ( object sender, TappedRoutedEventArgs e ) : void
InitializeCameraAsync ( ) : System.Threading.Tasks.Task

Initializes the MediaCapture, registers events, gets camera device information for mirroring and rotating, and starts preview

MediaCapture_Failed ( MediaCapture sender, MediaCaptureFailedEventArgs errorEventArgs ) : void
OnConnectionEstablished ( ) : void

OnConnectionFailed ( string message ) : void

Handler for failed connection event, logs and displays a UI message

OnConnectionLost ( string message ) : void

Handler for lost connection event, logs and displays a UI message

PreviewButton_Checked ( object sender, RoutedEventArgs e ) : void
PreviewButton_Click ( object sender, RoutedEventArgs e ) : void

Handler for clicking the preview button

PreviewButton_Unchecked ( object sender, RoutedEventArgs e ) : void
SetPreviewRotationAsync ( ) : System.Threading.Tasks.Task

Gets the current orientation of the UI in relation to the device and applies a corrective rotation to the preview

SettingButton_Click ( object sender, RoutedEventArgs e ) : void

Handler for clicking the setting button

StartPreviewAsync ( ) : System.Threading.Tasks.Task

Starts the preview and adjusts it for for rotation and mirroring after making a request to keep the screen on and unlocks the UI

StopPreviewAsync ( ) : System.Threading.Tasks.Task

Stops the preview and deactivates a display request, to allow the screen to go into power saving modes, and locks the UI

TestButton_Click ( object sender, RoutedEventArgs e ) : void

Handler for clicking the test button

Method Details

CheckAlwaysRunning() public méthode

Tries to keep the machine from locking/sleeping by periodically making a DisplayRequest
public CheckAlwaysRunning ( bool force = null ) : void
force bool Forces the request, even if AlwaysRunning isn't set
Résultat void

Connect() public méthode

Connects to a remote device over firmata
public Connect ( Connection selectedConnection ) : System.Threading.Tasks.Task
selectedConnection RemoteLedMatrix.Helpers.Connection Connection to connect to
Résultat System.Threading.Tasks.Task

Disconnect() public méthode

Disconnects the current connection and cleans up any related objects
public Disconnect ( ) : void
Résultat void

MainPage() public méthode

public MainPage ( ) : System
Résultat System

OnNavigatedTo() protected méthode

protected OnNavigatedTo ( NavigationEventArgs e ) : void
e Windows.UI.Xaml.Navigation.NavigationEventArgs
Résultat void

OnNavigatingFrom() protected méthode

protected OnNavigatingFrom ( NavigatingCancelEventArgs e ) : void
e Windows.UI.Xaml.Navigation.NavigatingCancelEventArgs
Résultat void

PopulateList() public méthode

Populates the list of connections in the settings UI
public PopulateList ( ) : void
Résultat void

RefreshConnections() public méthode

Refreshes the connections from the available device sources
public RefreshConnections ( ) : Task
Résultat Task

Property Details

CurrentConnection public_oe property

public Connection,RemoteLedMatrix.Helpers CurrentConnection
Résultat RemoteLedMatrix.Helpers.Connection

Instance public_oe static_oe property

public static MainPage Instance
Résultat MainPage

IsInSettings public_oe property

public bool IsInSettings
Résultat bool

_isPreviewing public_oe property

public bool _isPreviewing
Résultat bool