C# Class Netduino.Core.Services.Emulator2

Extension of standard Emulator to provide events for key state changes
The standard emulator and derived classes go through several stages of initialization. However, external classes, like a view model don't get to participate in the "notification" of state changes. Thus it is difficult for a view model to know when it is safe to attach to the emulators LCD changed event.

This class is designed to add events to the standard emulator for the Initialize and Uninitialize states and to simplify registration of GPIO pins and LCD display components

Inheritance: Emulator
Afficher le fichier Open project: mlinnen/Netduino-Emulator

Méthodes publiques

Méthode Description
Emulator2 ( ) : System

Creates a new instance of an Emulator2

InitializeComponent ( ) : void

Triggers the Initialize event

StartEmulator ( ) : void

Start the emulator engine on a new thread

Uses Environment.GetCommandLineArguments()

StartEmulator ( string Args ) : void

Start the emulator engine on a new thread

UninitializeComponent ( ) : void

Triggers the Uninitialize event

Méthodes protégées

Méthode Description
RegisterPin ( string Name, Cpu Pin ) : GpioPort

Registers a GPIO pin in the system

Useful method for registering a pin

NOTE: This should only be called from an overload of the LoadDefaultComponents() Method

RegisterPin ( string Name, Cpu Pin, GpioPortMode ExpectedMode, GpioPortMode AllowedMode ) : GpioPort

Registers a GPIO pin in the system

Useful method for registering a pin

NOTE: This should only be called from an overload of the LoadDefaultComponents() Method

RegisterPin ( string Name, Cpu Pin, VirtualKey Key ) : GpioPort

Registers a GPIO pin in the system

Useful method for registering a pin that acts as a button

NOTE: This should only be called from an overload of the LoadDefaultComponents() Method

Method Details

Emulator2() public méthode

Creates a new instance of an Emulator2
public Emulator2 ( ) : System
Résultat System

InitializeComponent() public méthode

Triggers the Initialize event
public InitializeComponent ( ) : void
Résultat void

RegisterPin() protected méthode

Registers a GPIO pin in the system

Useful method for registering a pin

NOTE: This should only be called from an overload of the LoadDefaultComponents() Method

protected RegisterPin ( string Name, Cpu Pin ) : GpioPort
Name string Name for the pin
Pin Microsoft.SPOT.Hardware.Cpu Pin number
Résultat GpioPort

RegisterPin() protected méthode

Registers a GPIO pin in the system

Useful method for registering a pin

NOTE: This should only be called from an overload of the LoadDefaultComponents() Method

protected RegisterPin ( string Name, Cpu Pin, GpioPortMode ExpectedMode, GpioPortMode AllowedMode ) : GpioPort
Name string Name for the pin
Pin Microsoft.SPOT.Hardware.Cpu Pin number
ExpectedMode GpioPortMode Expected mode for the pin
AllowedMode GpioPortMode Allowed modes for the pin
Résultat GpioPort

RegisterPin() protected méthode

Registers a GPIO pin in the system

Useful method for registering a pin that acts as a button

NOTE: This should only be called from an overload of the LoadDefaultComponents() Method

protected RegisterPin ( string Name, Cpu Pin, VirtualKey Key ) : GpioPort
Name string Name for the pin
Pin Microsoft.SPOT.Hardware.Cpu Pin number
Key VirtualKey Virtual Key to attach to the pin
Résultat GpioPort

StartEmulator() public méthode

Start the emulator engine on a new thread
Uses Environment.GetCommandLineArguments()
public StartEmulator ( ) : void
Résultat void

StartEmulator() public méthode

Start the emulator engine on a new thread
public StartEmulator ( string Args ) : void
Args string Command line arguments
Résultat void

UninitializeComponent() public méthode

Triggers the Uninitialize event
public UninitializeComponent ( ) : void
Résultat void