-
Notifications
You must be signed in to change notification settings - Fork 302
Export settings w/o calibration #2399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Ruthie-FRC
wants to merge
8
commits into
PhotonVision:main
Choose a base branch
from
Ruthie-FRC:export-settings-w/o-calibration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d073b3a
Add export settings functionality with option to exclude calibration …
Ruthie-FRC b2d201c
Add option to exclude calibration images when exporting settings as zip
Ruthie-FRC 220304a
Add option to exclude images when exporting settings to ZIP
Ruthie-FRC 107a65b
Add package-lock.json to .gitignore
Ruthie-FRC e72e036
Fix missing newline at end of file in ConfigManager and RequestHandler
Ruthie-FRC 1b2f1ea
Fix missing newline at end of file in DeviceCard.vue
Ruthie-FRC 5115755
Merge branch 'PhotonVision:main' into export-settings-w/o-calibration
Ruthie-FRC 1fe36e4
Implement thermal throttling alert and fix typos
Ruthie-FRC File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -20,6 +20,9 @@ | |
| import edu.wpi.first.cscore.CameraServerJNI; | ||
| import edu.wpi.first.networktables.NetworkTable; | ||
| import edu.wpi.first.networktables.ProtobufPublisher; | ||
| import edu.wpi.first.wpilibj.Alert; | ||
| import edu.wpi.first.wpilibj.Alert.AlertType; | ||
| import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; | ||
| import java.io.IOException; | ||
| import java.nio.file.FileStore; | ||
| import java.nio.file.Files; | ||
|
|
@@ -62,6 +65,9 @@ private record NetworkTraffic(double sentBitRate, double recvBitRate) {} | |
| .getProtobufTopic(CameraServerJNI.getHostname(), DeviceMetrics.proto) | ||
| .publish(); | ||
|
|
||
| private final Alert thermalThrottlingAlert = | ||
| new Alert("PhotonAlerts", "Thermal throttling detected!", AlertType.kWarning); | ||
|
|
||
| private SystemInfo si; | ||
| private CentralProcessor cpu; | ||
| private OperatingSystem os; | ||
|
|
@@ -140,11 +146,11 @@ protected SystemMonitor() { | |
| } | ||
|
|
||
| /** | ||
| * Returns a comma-separated list of addtional thermal zone types that should be checked to get | ||
| * Returns a comma-separated list of additional thermal zone types that should be checked to get | ||
| * the CPU temperature on Unix systems. The temperature will be reported for the first temperature | ||
| * zone with a type that mateches an item of this list. If the CPU temperature isn't being | ||
| * reported correctly for a coprocessor, override this method to return a string with type | ||
| * associated with the thermal zone for that comprocessor. | ||
| * zone with a type that matches an item of this list. If the CPU temperature isn't being reported | ||
| * correctly for a coprocessor, override this method to return a string with type associated with | ||
| * the thermal zone for that coprocessor. | ||
| * | ||
| * @return String containing a comma-separated list of thermal zone types for reading CPU | ||
| * temperature. | ||
|
|
@@ -159,7 +165,7 @@ protected String getThermalZoneTypes() { | |
|
|
||
| /** | ||
| * Starts the periodic system monitor that publishes performance metrics. The metrics are | ||
| * published every millisUpdateInerval seconds after a millisStartDelay startup delay. Calling | ||
| * published every millisUpdateInterval seconds after a millisStartDelay startup delay. Calling | ||
| * this method when the monitor is running will stop it and restart it with the new delay and | ||
| * update interval. | ||
| * | ||
|
|
@@ -210,6 +216,9 @@ private void publishMetrics() { | |
|
|
||
| metricPublisher.set(metrics); | ||
|
|
||
| thermalThrottlingAlert.set(this.isThermallyThrottling()); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems unrelated to settings export, is it intended for this PR?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so tht where that commit went... no it was not, sorry |
||
| SmartDashboard.updateValues(); | ||
|
|
||
| if (writeMetricsToLog) { | ||
| logMetrics(metrics); | ||
| } | ||
|
|
@@ -233,7 +242,7 @@ private void logMetrics(DeviceMetrics metrics) { | |
| String.format("CPU Throttle: %s, ", metrics.cpuThr().isBlank() ? "N/A" : metrics.cpuThr())); | ||
| sb.append( | ||
| String.format( | ||
| "Data sent: %.0f Kbps, Data recieved: %.0f Kbps", | ||
| "Data sent: %.0f Kbps, Data received: %.0f Kbps", | ||
| metrics.sentBitRate() / 1000, metrics.recvBitRate() / 1000)); | ||
| logger.debug(sb.toString()); | ||
| } | ||
|
|
@@ -446,6 +455,16 @@ public String getCpuThrottleReason() { | |
| return ""; | ||
| } | ||
|
|
||
| /** | ||
| * Returns true if the device is currently experiencing thermal throttling. Platforms that support | ||
| * thermal throttling detection will override this method. | ||
| * | ||
| * @return true if thermally throttling, false otherwise. | ||
| */ | ||
| public boolean isThermallyThrottling() { | ||
| return false; | ||
| } | ||
|
|
||
| /** | ||
| * Returns the total GPU memory in MiB. | ||
| * | ||
|
|
@@ -475,7 +494,7 @@ public String getIpAddress() { | |
| } | ||
|
|
||
| /** | ||
| * Returns a NetworkTraffic instance containing the average sent and recieved network traffic | ||
| * Returns a NetworkTraffic instance containing the average sent and received network traffic | ||
| * since the last time this was called. | ||
| * | ||
| * @return NetworkTraffic instance with data in bits/second. The traffic values will be -1 if the | ||
|
|
@@ -537,7 +556,7 @@ private void testSM() { | |
| () -> { | ||
| var nt = getNetworkTraffic(); | ||
| return String.format( | ||
| "Data sent: %.0f Kbps, Data recieved: %.0f Kbps", | ||
| "Data sent: %.0f Kbps, Data received: %.0f Kbps", | ||
| nt.sentBitRate() / 1000, nt.recvBitRate() / 1000); | ||
| }); | ||
|
|
||
|
|
||
This file contains hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good software is DRY - this hardcodes an assumption about the names of the directories, but there's other varibles which define those already.