Maintenance and sites

Asset Card <smart-asset-card>

AssetCard is one machine as maintenance sees it: how long it has run, when it is next due for service, how it is doing and what is open against it.

<smart-asset-card> · 17 properties, 0 methods, 3 events · source/modules/smart.assetcard.js

Usage in Blazor

The Razor component is <AssetCard> in Smart.Blazor.Industrial: every property is a parameter in PascalCase, every event an EventCallback<Event> named On<Event> whose ev["Detail"] is the typed detail class, and the methods are called on the @ref. String choices are enums. In a Blazor Web App (.NET 8 and later) the page needs an interactive render mode, for example @rendermode InteractiveServer; a statically rendered component stays empty.

@using Smart.Blazor.Industrial
@* .NET 8 and later: an interactive render mode, on the page or for the whole app *@
@rendermode InteractiveServer

<AssetCard @ref="assetCard" Name="Feed pump P-101"
    OnWorkOrderRequest="OnWorkOrderRequest" />

@code {
    AssetCard assetCard;

    void OnWorkOrderRequest(Event ev)
    {
        AssetCardWorkOrderRequestEventDetail detail = ev["Detail"];
    }
}

Properties

ParameterType, defaultDescription
Name
name
stringSets or retrieves the name of the asset. It is the heading of the card and its accessible name.
AssetId
assetId
stringSets or retrieves the asset's identifier, as the plant's maintenance system knows it.
Model
model
stringSets or retrieves the maker and model.
Location
location
stringSets or retrieves where the asset stands.
State
state
AssetCardState
running
Sets or retrieves the machine's state. Only fault, maintenance and offline are marked; running and stopped are text.
RunHours
runHours
int
0
Sets or retrieves the run hours, from the PLC's counter.
Starts
starts
intSets or retrieves the number of starts, from the PLC's counter. Null hides it.
ServiceInterval
serviceInterval
int
0
Sets or retrieves the hours between services. 0 for an asset without an hours-based interval, which the card says rather than drawing an empty bar.
LastServiceHours
lastServiceHours
int
0
Sets or retrieves the run hours at the last service. The next is due at this plus the interval. When runHours is below it - a counter reset or replaced, or a service entered wrong - the card says the counter needs checking instead of showing a full interval.
LastServiceDate
lastServiceDate
stringSets or retrieves when the last service was done, as an ISO date.
LastServiceBy
lastServiceBy
stringSets or retrieves who did the last service.
DueSoon
dueSoon
int
0.1
Sets or retrieves how much of the interval is left, as a fraction, when the service is marked due soon.
Condition
condition
IEnumerable<object>Sets or retrieves the condition readings as [{ label, value, unit, status, limit, direction }]. status is normal, warning or alarm; a reading out of band says so in words, with its limit. A warning names its side: direction 'high' or 'low' when given, otherwise high when a numeric value is above its limit and low when below it, and 'warning' when neither can be told.
WorkOrders
workOrders
IEnumerable<object>Sets or retrieves the work orders as [{ id, title, status, priority, due }]. Done orders are not listed. Assign a new array to update the component.
Compact
compact
bool
false
Sets or retrieves whether the card shows only the name, the state and the service: for a wall of assets.
ReadOnly
readOnly
bool
false
Sets or retrieves whether the card only shows. Request work and Record service are removed; work orders can still be opened.
Busy
busy
bool
false
Sets or retrieves whether the application is sending a request or recording a service. Send and Record wait.

Events

Every event is an EventCallback<Event>; Event is a dictionary and ev["Detail"] converts to the detail class named under the event.

EventDescription and detail
OnWorkOrderRequest
workOrderRequest
AssetCardWorkOrderRequestEventDetail
This event is triggered when the operator sends a request for work on the asset.
AssetId string The asset's identifier.
Text string What needs doing.
Priority string high, normal or low.
OnServiceRecord
serviceRecord
AssetCardServiceRecordEventDetail
This event is triggered when a service is recorded, after the confirmation. The card does not restart the interval itself: the application records it and sets lastServiceHours.
AssetId string The asset's identifier.
RunHours int The run hours the service was done at.
OnWorkOrderOpen
workOrderOpen
AssetCardWorkOrderOpenEventDetail
This event is triggered when a work order is opened from the card, for the application to show it.
Id string The id of the work order.
AssetId string The asset's identifier.

Types

enum AssetCardState

AssetCardState.Running "running" AssetCardState.Stopped "stopped" AssetCardState.Fault "fault" AssetCardState.Maintenance "maintenance" AssetCardState.Offline "offline"

CSS variables

The component declares 5 CSS variables; the CSS page shows how to set them.

--smart-asset-card-fill --smart-asset-card-warning --smart-asset-card-alarm --smart-asset-card-alarm-text --smart-asset-card-mono