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 Support for Attribute Dependency in Custom Chips #706

Open
hayschan opened this issue Dec 28, 2023 · 2 comments
Open

Add Support for Attribute Dependency in Custom Chips #706

hayschan opened this issue Dec 28, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@hayschan
Copy link

Describe the feature request:
I am currently developing a custom chip simulation for an air flow sensor in the Wokwi Simulator. The sensor's behavior involves variable flow rate values depending on another attribute, specifically the 'K' value. The Wokwi Simulator custom chips AI currently doesn't support attribute dependency, which is crucial for accurately simulating the behavior of such sensors.

Use Case:
The air flow sensor has different flow rate ranges based on the 'K' value:

  • For K = 1000, the flow rate range is 10SLM to <50SLM.
  • For K = 100, the flow rate range is 50SLM to ≤300SLM.

I need to simulate the sensor such that when the 'K' value attribute changes, the range of another attribute (the flow rate) adjusts accordingly.

Both of these attributes are set by user.

Current Limitation:
The current API does not support dynamic adjustment of one attribute's range based on the value of another attribute. Here is the current JSON configuration for the custom chip:

{
    "name": "airFlowSensor",
    "author": "",
    "pins": [
        "GND",
        "SCL",
        "SDA",
        "VCC"
    ],
    "controls": [
        {
            "id": "airFlowRate",
            "label": "Gas Air Flow Rate",
            "type": "range",
            "min": 10,
            "max": 50,
            "step": 1
        },
        {
            "id": "K value",
            "label": "K value",
            "type": "range",
            "min": 100,
            "max": 1000,
            "step": 900
        }
    ]
}

Requested Feature:
I propose the implementation of attribute dependency within the custom chip configuration. This feature would allow for dynamic changes in one attribute's properties (such as range) based on the value of another attribute. This enhancement would significantly increase the accuracy and utility of simulations involving sensors or components with interdependent parameters.

Thank you for considering this feature request.

@hayschan hayschan added the enhancement New feature or request label Dec 28, 2023
@djedu28
Copy link

djedu28 commented Oct 1, 2024

For this specific application, you can use percentage airFlowRate. in the ranger from 0 to 100% for “airFlowRate”.

{
            "id": "airFlowRate",
            "label": "Gas Air Flow Rate",
            "type": "range",
            "min": 0,
            "max": 100,
            "step": 1
 },

In this way, the chip's programming will interpret the maximum and minimum airFlowRate as varying according to the value of K.

As a visual solution to the airFlowRate value, you could use the graphic resource on the chip itself, implemented in Framebuffer Chip - https://wokwi.com/projects/330503863007183442

"display": {
    "width": 128,
    "height": 50
}

image

Translated with DeepL.com

@hayschan
Copy link
Author

For this specific application, you can use percentage airFlowRate. in the ranger from 0 to 100% for “airFlowRate”.

{
            "id": "airFlowRate",
            "label": "Gas Air Flow Rate",
            "type": "range",
            "min": 0,
            "max": 100,
            "step": 1
 },

In this way, the chip's programming will interpret the maximum and minimum airFlowRate as varying according to the value of K.

As a visual solution to the airFlowRate value, you could use the graphic resource on the chip itself, implemented in Framebuffer Chip - https://wokwi.com/projects/330503863007183442

"display": {
    "width": 128,
    "height": 50
}

image

Translated with DeepL.com

Thanks a lot. I'll try that out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants