Перейти до вмісту

Build a fleet dashboard

Цей контент ще не доступний вашою мовою.

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.

  1. Make FleetRoutes the dashboard’s root, with the overview at / and a site(site) page under the sites path.
  2. On the overview, render FleetOverview. Leave out its title; the host already shows the dashboard’s name. Add your own content with siteSummary, columns, sorts, and filters.
  3. To place the sites on a map, render FleetMap among the overview’s children, and add sitePositionParameterIds(position) to the overview’s live demand.
  4. On each site page, render SitePageHeader and SiteEquipmentView.
  1. Build each site’s feedback once, and register its siteStatusParameterIds(feedback) in the overview’s live demand.
  2. Evaluate every site once per update with evaluateSites from @overvis/hmi-shared/dashboard, memoize the lookup, and pass it to every block as stateOf.
  3. List each piece of equipment’s possible alarms with their own fields, and let activeAlarmsBySeverity drop the inactive ones.
  1. Show a site’s commands with SiteCommandButtons, and pass canWrite from the user’s access.
  2. For commands on many sites at once, add selection actions to FleetOverview: build the writes with buildSiteGroupCommand, review them in SiteGroupCommandConfirmation, and show the outcome with SiteGroupCommandResults. To try the failed sites again, select them with siteGroupRetrySelection.
  1. After the overview creates a site, open newSiteLocation(path, overviewSearch), its page in setup mode.
  2. On the site page, call useSiteSetup({ search, canEdit, pageParams }), and pass editing and setEditing to SitePageHeader. Use its overviewSearch for links back to the overview.
  3. Hold the open setup dialog with useSiteEditor(site), and use its baseline as the conflict baseline of the configuration update.
  4. 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.
  1. For the reading and condition slots of a defineSiteRoles declaration, place SiteSlotFields with fields at the rows built by the declaration’s formValue, and pass roles and labels. Use siteSlotRowsType for those rows in the form schema. On submit, turn the invalid rows of fromForm into field errors with siteSlotErrors(invalid, path).
  2. For a site’s zone and position, start SitePlacementFields with sitePlacementFormValue(site), pass the board’s zones and sitePlacementContext(sites, siteId) as context, and on submit spread the placement from sitePlacementFromForm(value, path, parameterInfo) into the site.
  3. For a new site’s typical readings, alarms, and setpoints, start SiteStarterFields with siteStarterFormValue(starters), collect the bindings with siteStarterBindings, and pass them to starterEquipment.
  4. For a command, build CommandStepsField’s value with commandStepsFormValue(steps), check it on submit with commandStepsErrors, and read the steps with commandStepsFromForm.
  5. Check bound parameters in the submit handler: await useParameterInfo() for the parameter and pass the result to a binding check, such as writeBindingError for a setpoint.

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.