-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
230 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
package daq.pubber; | ||
|
||
import udmi.schema.Config; | ||
import udmi.schema.DevicePersistent; | ||
import udmi.schema.Entry; | ||
import udmi.schema.Level; | ||
import udmi.schema.Metadata; | ||
import udmi.schema.Operation.SystemMode; | ||
import udmi.schema.PubberOptions; | ||
|
||
/** | ||
* Uber-manager for a complete device. | ||
*/ | ||
public class DeviceManager extends ManagerBase { | ||
|
||
private PointsetManager pointsetManager; | ||
private SystemManager systemManager; | ||
|
||
/** | ||
* Create a new instance. | ||
*/ | ||
public DeviceManager(ManagerHost host, PubberOptions options, String serialNo) { | ||
super(host, options); | ||
systemManager = new SystemManager(host, options, serialNo); | ||
pointsetManager = new PointsetManager(host, options); | ||
} | ||
|
||
@Override | ||
protected void periodicUpdate() { | ||
|
||
} | ||
|
||
public void setPersistentData(DevicePersistent persistentData) { | ||
systemManager.setPersistentData(persistentData); | ||
} | ||
|
||
public void setMetadata(Metadata metadata) { | ||
pointsetManager.setPointsetModel(metadata.pointset); | ||
systemManager.setMetadata(metadata); | ||
} | ||
|
||
@Override | ||
public void cancelPeriodicSend() { | ||
super.cancelPeriodicSend(); | ||
pointsetManager.cancelPeriodicSend(); | ||
systemManager.cancelPeriodicSend(); | ||
} | ||
|
||
public void systemLifecycle(SystemMode mode) { | ||
systemManager.systemLifecycle(mode); | ||
} | ||
|
||
public void maybeRestartSystem() { | ||
systemManager.maybeRestartSystem(); | ||
} | ||
|
||
public void localLog(Entry report) { | ||
systemManager.localLog(report); | ||
} | ||
|
||
public void localLog(String message, Level trace, String timestamp, String detail) { | ||
systemManager.localLog(message, trace, timestamp, detail); | ||
} | ||
|
||
public String getTestingTag() { | ||
return systemManager.getTestingTag(); | ||
} | ||
|
||
public void updateConfig(Config config) { | ||
pointsetManager.updateConfig(config.pointset); | ||
systemManager.updateConfig(config.system, config.timestamp); | ||
} | ||
|
||
public void publishLogMessage(Entry logEntry) { | ||
systemManager.publishLogMessage(logEntry); | ||
} | ||
|
||
public void cloudLog(String message, Level level, String detail) { | ||
systemManager.cloudLog(message, level, detail); | ||
} | ||
|
||
public void shutdown() { | ||
systemManager.shutdown(); | ||
pointsetManager.shutdown(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.