Fusion |
This class will trigger FusionAssetStateChange event.
public sealed class FusionStaticAsset : FusionAssetBase
The FusionStaticAsset type exposes the following members.
| Name | Description | |
|---|---|---|
| AssetError | Property to return the AssetError sig details. The AssetError has only input sig and is used to send error data to Fusion. | |
| AssetUsage | Property to return the AssetUsage sig details. The AssetUsage has only input sig and is used to send asset usage data to Fusion. | |
| Connected | Property to return the Connected sig details. The Connected has only input sig and is used to send notification to Fusion that the device is connected to the control processor. | |
| Owner |
Returns the FusionRoom or FusionNode that the asset belongs to.
(Inherited from FusionAssetBase) | |
| ParamAssetName |
Parameter to access the name of the asset of FusionBase Device as it will be displayed in FusionBase.
(Inherited from FusionAssetBase) | |
| ParamAssetNumber |
Parameter to access the user defined number of the asset of FusionBase Device.
(Inherited from FusionAssetBase) | |
| ParamAssetType |
Parameter to access the user defined name of the asset type FusionBase Device asset. This parameter is read-only field used by FusionBase that
cannot be edited, except for FusionDynamicAsset and FusionStaticAsset assets.
User can define the name of the asset type only for FusionDynamicAsset and FusionStaticAsset assets of FusionBase Device.
(Inherited from FusionAssetBase) | |
| ParamInstanceID |
Parameter to access the user defined Instance ID of the asset of FusionBase Device which is read-only field used by FusionBase that cannot be edited.
(Inherited from FusionAssetBase) | |
| ParamMake | Parameter to access optional text field that identifies the make of the device of the FusionStaticAsset. | |
| ParamModel | Parameter to access optional text field that identifies the model of the device of the FusionStaticAsset. | |
| PowerOff |
Property to return the PowerOff sig details. The PowerOff has only output sig and is used to indicate that
Fusion is turning the power off.
The FusionAssetStateChange event will trigger with StaticAssetPowerOffReceivedEventId. | |
| PowerOn |
Property to return the PowerOn sig details. The PowerOn has both input and output sigs. Input sig is used
to send notification to Fusion that the device power is on and the output sig is used to indicate that
Fusion is turning the power on.
The FusionAssetStateChange event will trigger with StaticAssetPowerOnReceivedEventId. |
| Name | Description | |
|---|---|---|
| AddSig | Method to add user configurable sig to the corresponding collection. This will override any previous configuration for the specified number. The valid sig numbers are from 1 to 24951 for FusionGenericAssetSerialsAsset3 and FusionGenericAssetDigitalsAsset1 and FusionGenericAssetAnalogsAsset2 | |
| Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) | |
| GetHashCode | Serves as the default hash function. (Inherited from Object) | |
| GetType | Gets the Type of the current instance. (Inherited from Object) | |
| RemoveAllSigs | Method to remove all user configured sigs of predefined assets from all the collections. | |
| RemoveSig | Method to remove user configured sig from the corresponding collection. Both input and output sigs corresponding to the sig number passed will be removed. The valid sig numbers are from 1 to 24951 for FusionGenericAssetSerialsAsset3 and FusionGenericAssetDigitalsAsset1 and FusionGenericAssetAnalogsAsset2 | |
| ToString | Returns a string that represents the current object. (Inherited from Object) |
/// Add our assets to the Fusion room. Each Asset can be a variety of types /// For more info on each asset type, go to Fusion's SSI guide. /// Assets store information about each devices. /// For most use casses, static assets will be used. /// See FusionRoom example for initialization steps. private static bool addAsset(FusionRoom room) { bool returnValue = false; try { // IMPORTANT: when adding assets, the instance id must be unique, if it is not // fusion will override the old asset with the most recent asset with the same ID. // Add an asset to the room with the type Static asset, with the type of Display. room.AddAsset(eAssetType.StaticAsset, _displayId, "mainDisplay", "Display", "0005"); //return the status of the function's execution. returnValue = true; } catch (Exception e) { ErrorLog.Error("Error while creating Asset: {0}, {1}", e.Message.ToString(), e.StackTrace); // Flag our return value as false since execution has reached the exception block. returnValue = false; } // Return the boolean indicating the success of the function's execution. return returnValue; } // Returns a FusionStaticAsset object if type casting is successful. // If not then null is returned. public static FusionStaticAsset GetDisplay(FusionRoom room) { try { // Type casting the Asset baseClass to the StaticAsset class // as that is what was specified on time of creation. return room.UserConfigurableAssetDetails[_displayId].Asset as FusionStaticAsset; } catch (Exception e) { ErrorLog.Error("Error while trying to return FusionAsset at index: {0}", _displayId, e.StackTrace); } return null; } // Tracks the usage while device is detected as online. // These are called within other functions in the example. // However, call them at your discretion as there are multiple scenarios where // it would be a good idea to log device's usage time. public static void DisplayDeviceUsage(FusionRoom room, DateTime displayStartTime) { // Subtract the time the device came online from the current time. TimeSpan elapsedTime = CrestronEnvironment.GetLocalTime().Subtract(displayStartTime); // Report how long the display was used to Fusion. // for Display usage tracking. room.DisplayUsage.InputSig.UShortValue += (ushort)elapsedTime.TotalHours; // If the room is object is not initialized or the elapsed time is less than 1 minute // Don't send usage data. if (room != null && (int)elapsedTime.TotalHours > 0) { // Construct the time stamp that will be send over to Fusion. string time = elapsedTime.Hours + ":" + elapsedTime.Minutes + ":" + elapsedTime.Seconds; // Log some information about the usage to the control system. ErrorLog.Notice("Time: {0}", time); ErrorLog.Notice("Total elapsed hours: {0}", (int)elapsedTime.TotalHours); // Construct the date stamp that will be sent over to Fusion. string date = DateTime.Now.Year + "-" + DateTime.Now.Month + "-" + DateTime.Now.Day; // Construct the data that will be sent over to Fusion. room.DeviceUsage.InputSig.StringValue = "USAGE||" + date + "||" + time + "||TIME||DISPLAY||mainDisplay||-||" + (int)elapsedTime.TotalHours + "||-||-||-||"; } else { ErrorLog.Notice("Time active too small to track for display."); } }