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

Added Anemometer functionality to be displayed on the dashboard #169

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ashvarg
Copy link

@ashvarg ashvarg commented Apr 18, 2023

Description

Added new files for display on the anemometer

Screenshots

Steps to Test

@ashvarg ashvarg requested a review from kdav108 April 18, 2023 08:02
Copy link
Contributor

@kdav108 kdav108 left a comment

Choose a reason for hiding this comment

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

This is looking great so far! I haven't run the code yet, just did a code review, but it seems to go well with how the code in this repository is structured.

One major task we still need to integrate is to actually listen to the wind speed and direction data from MQTT in the backend (/server/js/socket.js). How the data gets read from MQTT and relayed to the front-end can be a bit hard to understand, I would suggest picking another WM and tracking how it gets its data. A good place to start would be subscribing to the topic that sends the anemometer data.

@@ -117,6 +126,9 @@ export type CO2T = Static<typeof CO2RT>;
/** Value type of accelerometer sensor data */
export type AccelerometerT = Static<typeof AccelerometerRT>;

/** Value type of aneomometer sensor data */
export type AnemometerRT = Static<typeof AnemometerRT>;
Copy link
Contributor

@kdav108 kdav108 Apr 23, 2023

Choose a reason for hiding this comment

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

Suggested change
export type AnemometerRT = Static<typeof AnemometerRT>;
export type AnemometerT = Static<typeof AnemometerRT>;

we already define a variable called AnemometerRT above, here we define a type and although we could still use the same name, it won't make sense since it's not AnemometerRT. The 'RT' stands for RunType and is not strictly a type in TypeScript. Some background reading if you're interested to know what RunType is and why we use it.

In short, some places in our code accept a variable that represents our data, so we use AnemometerRT, but in other places we need to use a type so we define a type called AnemometerT.

import { useModuleStatus } from 'api/common/data';

/**
* Container for Wireless Module Statuses
Copy link
Contributor

Choose a reason for hiding this comment

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

Need to update the function documentation

Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need this file? We could use WMStatus.tsx to achieve the same objective...

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.

2 participants