register method

void register(
  1. SamplingPackage package
)

Registers package.

Also adds the package's data types to CarpDataTypes, registers its SamplingPackage.deviceManager in the DeviceController, and calls SamplingPackage.onRegister.

Implementation

void register(SamplingPackage package) {
  _combinedSchemas = null;
  _packages.add(package);
  CarpDataTypes().add(package.samplingSchemes.dataTypes);

  // register the package's device in the device registry
  DeviceController().registerDevice(package.deviceType, package.deviceManager);

  // call back to the package
  package.onRegister();
}