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

Model the alarm limits better #55

Open
cnlklink opened this issue Jun 1, 2023 · 6 comments
Open

Model the alarm limits better #55

cnlklink opened this issue Jun 1, 2023 · 6 comments

Comments

@cnlklink
Copy link
Contributor

cnlklink commented Jun 1, 2023

          It seems like we could model the alarm limits better better. Something along the lines of:
abstract class AlarmLimit {
    double get nominal;
    double get tolerance;
    double get min_value;
    double get max_value;
}

class AlarmMinMax extends AlarmLimits {
    final double _min;
    final double _max;

    AlarmMinMax(this._min, this._max);

    double get min_value => _min;
    double get max_value => _max;
    double get nominal => (_min + _max) / 2;
    double get tolerance => nominal - _min;
}

class AlarmNomTol extends AlarmLimits {
    final double _nom;
    final double _tol;

    AlarmNomTol(this._nom, this._tol);

    double get min_value => _nom - _tol;
    double get max_value => _nom + _tol;
    double get nominal => _nom;
    double get tolerance => _tol;
}

Originally posted by @rneswold in #54 (comment)

@cnlklink
Copy link
Contributor Author

cnlklink commented Jun 1, 2023

I know we discussed this issue a bit in the last status meeting. Someone (was it @beauremus ?) asked if this should be handled by DPM. Seems to me that's the best spot for it. Thoughts?

@rneswold
Copy link
Contributor

rneswold commented Jun 1, 2023

If the param page switches between NOM/TOL and MIN/MAX, does it resend the request to DPM? The modeling I proposed above would do the switch in the app and DPM would simply provide the data returned by the device.

I guess the question is: is it useful for DPM to provide the switch? I can't think of scripts or apps (besides param page) that actually care about the alarm limits. They may care that a device is in alarm, but not so much the limits. The param page cares because users may want to better understand the limits by switching between views.

But, then, I've never written an in-depth Python or ACL script. Maybe they do commonly access the limits and like to switch between the types.

@cnlklink
Copy link
Contributor Author

cnlklink commented Jun 1, 2023

Actually, what I've implemented so far displays all four values. I figured that the existing parameter page is asking you to toggle between the two because of limited screen space. But we can easily pack four values onto the page. And so, there's no switch to be done really.

What's stored in the database - nom and tolerance? And so min/max are calculated?

@beauremus
Copy link
Member

G:AMANDA Analog Alarm Limits
I believe the white fields, highlighted in red, are the FE config and the cyan field, highlighted in pink, is the device DB config for what the user wants to see.

@rneswold
Copy link
Contributor

rneswold commented Jun 1, 2023

But we can easily pack four values onto the page.

Something like:

    Max: 100.0
    Nom:  75.0   Tol: +/- 25.0
    Min:  50.0

@rneswold
Copy link
Contributor

rneswold commented Jun 9, 2023

I'm going to tuck this thought at the end of this issue:

A parameter row could simply show the most general, useful stuff (name, description, setting, reading, status) and a details icon. Clicking the icon could animate the row to expand vertically to show details like basic status bits and alarm limits.

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

No branches or pull requests

3 participants