Build a fleet dashboard
Ta treść nie jest jeszcze dostępna w Twoim języku.
A fleet dashboard watches many similar sites, such as pumping stations, substations, lighting cabinets, or cold rooms. The fleet and site blocks supply the overview, status, alarms, commands, and setup forms; the dashboard keeps only its domain: site types, equipment, drawings, and labels. The blocks are described in Fleet and site blocks, and the configuration helpers in Fleet and site configuration.
Lay out the pages
Section titled “Lay out the pages”- Make
FleetRoutesthe dashboard’s root, with theoverviewat/and asite(site)page under the sites path. - On the overview, render
FleetOverview. Leave out itstitle; the host already shows the dashboard’s name. Add your own content withsiteSummary,columns,sorts, andfilters. - To place the sites on a map, render
FleetMapamong the overview’schildren, and addsitePositionParameterIds(position)to the overview’s live demand. - On each site page, render
SitePageHeaderandSiteEquipmentView.
Evaluate the status once
Section titled “Evaluate the status once”- Build each site’s feedback once, and register its
siteStatusParameterIds(feedback)in the overview’s live demand. - Evaluate every site once per update with
evaluateSitesfrom@overvis/hmi-shared/dashboard, memoize the lookup, and pass it to every block asstateOf. - List each piece of equipment’s possible alarms with their own fields, and let
activeAlarmsBySeveritydrop the inactive ones.
Add operator commands
Section titled “Add operator commands”- Show a site’s commands with
SiteCommandButtons, and passcanWritefrom the user’s access. - For commands on many sites at once, add
selectionactions toFleetOverview: build the writes withbuildSiteGroupCommand, review them inSiteGroupCommandConfirmation, and show the outcome withSiteGroupCommandResults. To try the failed sites again, select them withsiteGroupRetrySelection.
Edit sites in setup mode
Section titled “Edit sites in setup mode”- After the overview creates a site, open
newSiteLocation(path, overviewSearch), its page in setup mode. - On the site page, call
useSiteSetup({ search, canEdit, pageParams }), and passeditingandsetEditingtoSitePageHeader. Use itsoverviewSearchfor links back to the overview. - Hold the open setup dialog with
useSiteEditor(site), and use itsbaselineas the conflict baseline of the configuration update. - Apply each form’s result inside
useDashboardConfigurationMutation, with the update helpers of@overvis/hmi-shared/dashboard, so a concurrent change fails as a conflict instead of being overwritten.
Build the setup forms
Section titled “Build the setup forms”- For the reading and condition slots of a
defineSiteRolesdeclaration, placeSiteSlotFieldswithfieldsat the rows built by the declaration’sformValue, and passrolesandlabels. UsesiteSlotRowsTypefor those rows in the form schema. On submit, turn theinvalidrows offromForminto field errors withsiteSlotErrors(invalid, path). - For a site’s zone and position, start
SitePlacementFieldswithsitePlacementFormValue(site), pass the board’szonesandsitePlacementContext(sites, siteId)ascontext, and on submit spread theplacementfromsitePlacementFromForm(value, path, parameterInfo)into the site. - For a new site’s typical readings, alarms, and setpoints, start
SiteStarterFieldswithsiteStarterFormValue(starters), collect the bindings withsiteStarterBindings, and pass them tostarterEquipment. - For a command, build
CommandStepsField’s value withcommandStepsFormValue(steps), check it on submit withcommandStepsErrors, and read the steps withcommandStepsFromForm. - Check bound parameters in the submit handler: await
useParameterInfo()for the parameter and pass the result to a binding check, such aswriteBindingErrorfor a setpoint.
Publish a page summary
Section titled “Publish a page summary”FleetOverview publishes the fleet summary for the assistant. To add each site’s active alarms and
overdue maintenance, pass alarmsOf and maintenanceOf. On a site page, publish the site and the
fleet with usePublishSiteSummary, passing the page’s readOnce and the parameterIds one site’s
summary reads, such as siteAttentionParameterIds.