WIP
DirectOutput framework for virtual pinball cabinets WIP
|
Go to: Overview |
The Pinscape Controller is an open-source software/hardware project based on the inexpensive and powerful Freescale FRDM-KL25Z microcontroller development platform. It provides a full set of virtual pinball cabinet I/O features, including analog plunger, accelerometer nudging, key/button input, and a flexible array of PWM outputs. More...
Classes | |
class | Device |
Public Member Functions | |
override void | Init (Cabinet Cabinet) |
Initializes the Pinscape object. This method does also start the workerthread which does the actual update work when Update() is called. This method should only be called once. Subsequent calls have no effect. More... | |
override void | Finish () |
Finishes the Pinscape object. Finish does also terminate the workerthread for updates. More... | |
Pinscape () | |
Initializes a new instance of the Pinscape class with no unit number set. The unit number must be set before use (via the Number property). More... | |
Pinscape (int Number) | |
Initializes a new instance of the Pinscape class with a given unit number. More... | |
Public Member Functions inherited from DirectOutput.Cab.Out.OutputControllerCompleteBase | |
void | SetValues (int FirstOutput, byte[] Values) |
Sets the values for one or several outputs of the controller. More... | |
void | Update () |
Triggers the update of the physical outputs More... | |
Static Public Member Functions | |
static List< Device > | AllDevices () |
Get the list of all Pinscape devices discovered in the system from the Windows USB device scan. More... | |
Protected Member Functions | |
override bool | VerifySettings () |
Verify settings. Returns true if settings are valid, false otherwise. In the current implementation, there's nothing to check; we simply return true unconditionally. More... | |
override void | UpdateOutputs (byte[] NewOutputValues) |
Send updated outputs to the physical device. More... | |
override void | ConnectToController () |
Connect to the controller. More... | |
override void | DisconnectFromController () |
Disconnect from the controller. More... | |
Protected Member Functions inherited from DirectOutput.Cab.Out.OutputControllerFlexCompleteBase | |
override int | GetNumberOfConfiguredOutputs () |
This method must return the number of configured outputs. The method is used internaly to determine the number of output objects which have to be setup. Return a fixed value for output controllers which have a fixed number of outputs. Return the value of a configurable property for controllers with a defineable number of outputs. More... | |
Protected Member Functions inherited from DirectOutput.Cab.Out.OutputControllerCompleteBase | |
void | SetupOutputs () |
Manages to output object of the output controller. Use the GetNumberOfConfiguredOutputs() method to determine the number of outputs to be setup. More... | |
override void | AfterNameChange (string OldName, string NewName) |
Protected Member Functions inherited from DirectOutput.General.Generic.NamedItemBase | |
virtual void | BeforeNameChange (string OldName, string NewName) |
virtual void | OnPropertyChanged (string propertyName) |
virtual void | OnPropertyChanging (string propertyName) |
Properties | |
int | Number [get, set] |
Gets or sets the unit number of the controller. The unit number must be unique. Setting changes the Name property, if it is blank or if the Name coresponds to "Pinscape Controller {Number}". More... | |
int | MinCommandIntervalMs [get, set] |
Gets or sets the mininimal interval between command in miliseconds (Default: 1ms). The minimum message interval at the USB level is 1ms, but real LedWiz units can reportedly miss messages on some systems if messages are sent at full USB speed. The underlying causes aren't clear as there are a lot of black boxes in the communication path (the motherboard USB hardware, the Windows USB drivers, the Windows HID drivers, USB hubs, and the LedWiz itself), but the assumption is that it's timing-related, so the LedWiz version uses this parameter to throttle the data rate by increasing the time between consecutive messages going across the wire to the LedWiz. Since the Pinscape controller is all open source, the device side of the path is under our control, unlike the LedWiz, so if we ever did run into any similar problems, we could potentially fix them more cleanly by fixing whatever the real problem is on the device side of the USB path. Even so, we'll also provide this parameter in case it turns out to be useful. More... | |
Properties inherited from DirectOutput.Cab.Out.OutputControllerFlexCompleteBase | |
int | NumberOfOutputs [get, set] |
Properties inherited from DirectOutput.Cab.Out.OutputControllerCompleteBase | |
OutputList | Outputs [get, set] |
Contains the OutputList object for the outputs of the output controller. More... | |
bool | UpdaterThreadIsActive [get] |
Indicates whether the UpdaterThread is active or not. More... | |
Properties inherited from DirectOutput.General.Generic.NamedItemBase | |
string | Name [get, set] |
Name of the named item. Triggers BeforeNameChange before a new Name is set. Triggers AfterNameChanged after a new name has been set. More... | |
Properties inherited from DirectOutput.General.Generic.INamedItem | |
string | Name [get, set] |
Gets or sets the name of the item. Must fire the BeforeNameChange and AfterNameChange events when the value of the property is changed. More... | |
Properties inherited from DirectOutput.Cab.Out.IOutputController | |
new string | Name [get, set] |
Name of the IOutputController. This property is fully implemented in the abstract OutputControllerBase class. More... | |
OutputList | Outputs [get, set] |
OutputList containing the IOutput objects for a IOutputController. More... | |
Additional Inherited Members | |
Events inherited from DirectOutput.General.Generic.NamedItemBase | |
EventHandler< NameChangeEventArgs > | AfterNameChanged |
Event is fired after the value of the property Name has changed. More... | |
EventHandler< NameChangeEventArgs > | BeforeNameChanged |
Event is fired before the value of the property Name is changed. More... | |
PropertyChangedEventHandler | PropertyChanged |
PropertyChangingEventHandler | PropertyChanging |
Events inherited from DirectOutput.General.Generic.INamedItem | |
EventHandler< NameChangeEventArgs > | BeforeNameChanged |
Occurs before the name of the item changes. More... | |
EventHandler< NameChangeEventArgs > | AfterNameChanged |
Occurs when after the name of the item has changed. More... | |
The Pinscape Controller is an open-source software/hardware project based on the inexpensive and powerful Freescale FRDM-KL25Z microcontroller development platform. It provides a full set of virtual pinball cabinet I/O features, including analog plunger, accelerometer nudging, key/button input, and a flexible array of PWM outputs.
For DOF purposes, we're only interested in the output controller features; all of the input features are handled through the standard Windows USB joystick drivers. The output controller emulates an LedWiz, so legacy LedWiz-aware software can access its basic functionality. However, the Pinscape controller has expanded functionality that the LedWiz protocol can't access due to its inherent design limits. To allow access to the expanded functionality, the Pinscape controller uses custom extensions to the LedWiz protocol. This DirectOutput framework module lets DOF use the extended protocol to take full advantage of the extended features. First and most importantly, the Pinscape controller can support many more output channels than a real LedWiz. In fact, there's no hard limit to the number of channels that could be attached to one controller, although the practical limit is probably about 200, and the reference hardware design provides up to about 60. The extended protocol allows for about 130 channels, which is hopefully well beyond what anyone will be motivated to actually build in hardware. Second, the extended protocol provides 8-bit PWM resolution, whereas the LedWiz protocol is limited to 49 levels (about 5-1/2 bit resolution). DOF uses 8-bit resolution internally, so this lets devices show the full range of brightness levels that DOF can represent internally, for smoother fades and more precise color control in RGB devices (or more precise speed control in motors, intensity control in solenoids, etc).
DOF uses the extended protocol, so it can fully access all of the expanded features. Legacy software that uses only the original LedWiz protocol (e.g., Future Pinball) can still recognize the device and access the first 32 output ports, using 49-level PWM resolution.
DOF can automatically detect connected Pinscape controllers and configure them for use with the framework.
The Pinscape Controller project can be found on mbed.org.
Definition at line 40 of file Pinscape.cs.
DirectOutput.Cab.Out.PS.Pinscape.Pinscape | ( | ) |
Initializes a new instance of the Pinscape class with no unit number set. The unit number must be set before use (via the Number property).
Definition at line 576 of file Pinscape.cs.
DirectOutput.Cab.Out.PS.Pinscape.Pinscape | ( | int | Number | ) |
Initializes a new instance of the Pinscape class with a given unit number.
Number | The number of the Pinscape controller (1-16). |
Definition at line 584 of file Pinscape.cs.
|
static |
Get the list of all Pinscape devices discovered in the system from the Windows USB device scan.
Definition at line 440 of file Pinscape.cs.
|
protectedvirtual |
Connect to the controller.
Implements DirectOutput.Cab.Out.OutputControllerCompleteBase.
Definition at line 221 of file Pinscape.cs.
|
protectedvirtual |
Disconnect from the controller.
Implements DirectOutput.Cab.Out.OutputControllerCompleteBase.
Definition at line 228 of file Pinscape.cs.
|
virtual |
Finishes the Pinscape object.
Finish does also terminate the workerthread for updates.
Reimplemented from DirectOutput.Cab.Out.OutputControllerCompleteBase.
Definition at line 148 of file Pinscape.cs.
|
virtual |
Initializes the Pinscape object.
This method does also start the workerthread which does the actual update work when Update() is called.
This method should only be called once. Subsequent calls have no effect.
Reimplemented from DirectOutput.Cab.Out.OutputControllerCompleteBase.
Definition at line 134 of file Pinscape.cs.
|
protectedvirtual |
Send updated outputs to the physical device.
Implements DirectOutput.Cab.Out.OutputControllerCompleteBase.
Definition at line 171 of file Pinscape.cs.
|
protectedvirtual |
Verify settings. Returns true if settings are valid, false otherwise. In the current implementation, there's nothing to check; we simply return true unconditionally.
Implements DirectOutput.Cab.Out.OutputControllerCompleteBase.
Definition at line 163 of file Pinscape.cs.
|
getset |
Gets or sets the mininimal interval between command in miliseconds (Default: 1ms). The minimum message interval at the USB level is 1ms, but real LedWiz units can reportedly miss messages on some systems if messages are sent at full USB speed. The underlying causes aren't clear as there are a lot of black boxes in the communication path (the motherboard USB hardware, the Windows USB drivers, the Windows HID drivers, USB hubs, and the LedWiz itself), but the assumption is that it's timing-related, so the LedWiz version uses this parameter to throttle the data rate by increasing the time between consecutive messages going across the wire to the LedWiz. Since the Pinscape controller is all open source, the device side of the path is under our control, unlike the LedWiz, so if we ever did run into any similar problems, we could potentially fix them more cleanly by fixing whatever the real problem is on the device side of the USB path. Even so, we'll also provide this parameter in case it turns out to be useful.
We recommend using the default interval of 1 ms, and only increasing this if problems occur (Toys which are sometimes not reacting, random knocks of replay knocker or solenoids). Better yet, any such problems should be investigated first on the Pinscape controller side to see if they can be addressed more cleanly there.
The mininimal interval between command in miliseconds. The default is 1ms, which is also the minimum, since it's the fastest that USB allows at the hardware protocol level.
Definition at line 117 of file Pinscape.cs.
|
getset |
Gets or sets the unit number of the controller.
The unit number must be unique.
Setting changes the Name property, if it is blank or if the Name coresponds to "Pinscape Controller {Number}".
The unique unit number of the controller (Range 1-16).
System.Exception | Pinscape Unit Numbers must be between 1-16. The supplied number {0} is out of range. |
Definition at line 60 of file Pinscape.cs.