Skip to content
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

Add gauge 4896 #4919

Merged
merged 82 commits into from
Apr 22, 2022
Merged

Add gauge 4896 #4919

merged 82 commits into from
Apr 22, 2022

Conversation

nikhilmandlik
Copy link
Contributor

@nikhilmandlik nikhilmandlik commented Mar 5, 2022

Closes #4896

Describe your changes:

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Is this change backwards compatible? For example, developers won't need to change how they are calling the API or how they've extended core plugins such as Tables or Plots.

Author Checklist

  • Changes address original issue?
  • Unit tests included and/or updated with changes?
  • Command line build passes?
  • Has this been smoke tested?
  • Testing instructions included in associated issue?

Reviewer Checklist

  • Changes appear to address issue?
  • Changes appear not to be breaking changes?
  • Appropriate unit tests included?
  • Code style and in-line documentation are appropriate?
  • Commit messages meet standards?
  • Has associated issue been labelled unverified? (only applicable if this PR closes the issue)
  • Has associated issue been labelled bug? (only applicable if this PR is for a bug fix)

charlesh88 and others added 4 commits March 4, 2022 14:18
@codecov
Copy link

codecov bot commented Mar 5, 2022

Codecov Report

Merging #4919 (4c6f4a7) into master (402cd15) will decrease coverage by 0.01%.
The diff coverage is 45.91%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4919      +/-   ##
==========================================
- Coverage   49.95%   49.93%   -0.02%     
==========================================
  Files         526      533       +7     
  Lines       19287    19480     +193     
  Branches     1734     1756      +22     
==========================================
+ Hits         9634     9728      +94     
- Misses       9221     9311      +90     
- Partials      432      441       +9     
Impacted Files Coverage Δ
src/api/forms/FormController.js 81.81% <ø> (ø)
...rc/api/forms/components/controls/CheckBoxField.vue 0.00% <0.00%> (ø)
src/api/forms/components/controls/NumberField.vue 0.00% <ø> (ø)
...pi/forms/components/controls/ToggleSwitchField.vue 0.00% <0.00%> (ø)
src/api/forms/toggle-check-box-mixin.js 0.00% <0.00%> (ø)
src/plugins/formActions/CreateWizard.js 62.16% <0.00%> (-3.56%) ⬇️
...c/plugins/gauge/components/GaugeFormController.vue 0.00% <0.00%> (ø)
src/ui/inspector/details/Properties.vue 61.40% <0.00%> (-1.10%) ⬇️
src/plugins/gauge/GaugePlugin.js 21.21% <21.21%> (ø)
src/api/forms/components/FormRow.vue 40.00% <33.33%> (-1.18%) ⬇️
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 402cd15...4c6f4a7. Read the comment docs.

- Added needle display style;
- Tweaked form wording;
@charlesh88
Copy link
Contributor

@nikhilmandlik Just pushed a needle display style:

image

charlesh88 and others added 23 commits March 8, 2022 17:20
- WIP!
- Added vertical and horizontal meter gauge types;
- WIP!
- Major additions of vertical and horizontal meter gauge types;
- Min and max range values now display based on properties settings;
- Better color definitions, moving towards theme-based color vars;
- Animation transition now applied to gauge value elements transforms;
- Better approach to clipping high and low values/ranges in meter;
- Tweaks to properties form text;
- Enhanced GAUGE_TYPES const for better human-readable names;
- WIP: turn off transition for dial to avoid delay "flash" problem;
- Remove rotation angle clipping from needle dial gauge;
- Reinstate transition for needle dial only;
- Fix typo in props form;
- WIP!
- Significant work: added lower limit to dial and meter;
- Added limitLow, refactored limit to limitHigh;
- Improved valToPercentMeter method;
- Handle case when high or low limit isn't defined;
- Current value implemented as size-relative SVG text in dial and meter;
- Code cleanups;
- TODO: cleanup and migrate colors to themes;
- Merging Nikhil's latest, resolve conflicts;
- TODO: clip dial display when values are outside set min/max;
- Added check to suppress display of dial needle;
- Moved filled dial display check in code;
- Code cleanup;
- Color refinement;
- Code cleanup;
- Properties form CSS cleanups and text tweaks;
- Added gauge type `meter-vertical-inverted`;
- CSS tightened up;
this.rangeLow = this.round(this.limitLow - Math.abs(this.limitLow * LIMIT_PADDING_IN_PERCENT / 100));
},
updateValue(datum) {
if (this.isRendering) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will short-circuit out and result in a stale value being rendered. Read the previous comment on this. We always want to store the new value (on a non-reactive property), then shortcut out if there is a RAF already queued. If we shortcut out without storing the value then when the queued RAF eventually executes it will be with a stale value.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh good catch, thanks 👍

@@ -0,0 +1,199 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2018, United States Government
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copy should be 2022

@@ -0,0 +1,19 @@
export default {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would name this toggle-mixin or form-toggle-mixin as it is used by at least check box and switch.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's file a followup for this and assign to @nikhilmandlik

import GaugeFormController from './components/GaugeFormController.vue';
import Vue from 'vue';

export const GAUGE_TYPES = [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a reason we need tuples instead of standard key/val objects?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's file a followup for this and assign to @nikhilmandlik

composition: []
};

describe('Gaugue plugin', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spelling error

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Akshually that's the British spelling

openmct = createOpenMct();
openmct.on('start', done);

openmct.startHeadless(appHolder);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

startHeadless will ignore appHolder

@@ -0,0 +1,65 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2018, United States Government
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copy should be 2022

:class="model.cssClass"
>
<ToggleSwitch
id="isUseTelemetryLimits"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you need to use an id over a vue ref? is this for css selector?

<ToggleSwitch
id="isUseTelemetryLimits"
:checked="isUseTelemetryLimits"
:label="`Use telemetry limits for minimum and maximum ranges`"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to bind to a static string

@@ -14,7 +14,7 @@ $elemBg: rgba(black, 0.7);
position: absolute;
left: 0;
top: 0;
z-index: 1;
z-index: 2;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stealthy non-issue change?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -222,7 +222,7 @@
.h-local-controls--overlay-content {
position: absolute;
left: $interiorMargin; top: $interiorMargin;
z-index: 2;
z-index: 70;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stealthy non-issue change?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@akhenry akhenry dismissed stale reviews from unlikelyzero, charlesh88, jvigliotta, and shefalijoshi April 22, 2022 21:55

Dismissing for merge

@akhenry akhenry merged commit a53a3a0 into master Apr 22, 2022
Copy link
Contributor

@unlikelyzero unlikelyzero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still need to remove guage.e2eSpec.js unless we

unlikelyzero added a commit that referenced this pull request Apr 22, 2022
@unlikelyzero unlikelyzero deleted the add-gauge-4896 branch July 5, 2022 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Gauge plugin
7 participants