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

buildings interaction mode #27

Closed
3 tasks done
dunland opened this issue Sep 4, 2022 · 6 comments
Closed
3 tasks done

buildings interaction mode #27

dunland opened this issue Sep 4, 2022 · 6 comments
Assignees

Comments

@dunland
Copy link
Member

dunland commented Sep 4, 2022

highight selected decsion feature

  • using renderer.js:116 processSliderHandle(), underline the decision parameter that is selected via slider:

frontend sends a json string like this:
{"sliders": {"id": "slider0", "handle": "num_connections", "group": -1}}
the slider id does not matter, but the "group" should be used to allocate the handle to the different divs:

<div id="buildings_group_0" class="buildings_group">
</div>
<div id="buildings_group_1" class="buildings_group">
</div>
<div id="buildings_group_2" class="buildings_group">
</div>
<div id="buildings_group_3" class="buildings_group">
</div>

within these divs, pick the corresponding item and underline it (de-underline it, when no slider handle or group points to this feature anymore).

if (handle == "refurbished" ) { select and underline item <li class="refurbished">}
if (handle == "connection_to_heat_grid" ) { select and underline item <li class="connectoin_to_heat_grid">}
if (handle == "environmental_engagement" ) { select and underline item <li class="environmental_engagement">}

more beautifications

  • the home.png image is changing from white to green with variable environmental_engagement. please link thsis to the incoming connection_to_heat_grid instead.
  • frame around the whole infoscreen to show 'iteration'round #28
    • {"mode": "total_data_view", "scenario_energy_prices": 2018, "iteration_round": 0, "active_scenario_handle": "Ref"}
    • colors shall be
    [(0, 117, 180),   # Quarree-blue, round 1
    (253, 193, 19),  # Quarree-yellow, round 2
    (0, 168, 78),    # Quarree-dark-green, round 3
    (186, 212, 50),  # Quarree-light-green, round 4
@dunland
Copy link
Member Author

dunland commented Sep 5, 2022

  • another thing:
    I implemented a field on the right side, showing num of connections for selected buildings ($s) and additional num of connections for forced buildings ($a). the latter one works fine, but I want to update $s with the sum of all buildings_groups.group_X.connections (whenever buildings_groups is received). Should be a simple thing, but it messes me up.. Can you do this?

image

@dunland
Copy link
Member Author

dunland commented Sep 8, 2022

  • show buildings ø-consumption data

using
"avg_spec_heat_consumption" and "avg_spec_power_consumption":

        "group_1": {
            "buildings": [
                {
                    "address": "R\u00fcsdorfer Stra\u00dfe 47",
                    "avg_spec_heat_consumption": 147.10931,
                    "avg_spec_power_consumption": 33.40084,
                    "cluster_size": 2,
                    "emissions_graphs": "",
                    "energy_prices_graphs": "",
                    "CO2": 0.009385106,
                    "connection_to_heat_grid": false,
                    "connection_to_heat_grid_prior": false,
                    "refurbished": false,
                    "refurbished_prior": false,
                    "environmental_engagement": true,
                    "environmental_engagement_prior": true,
                    "energy_source": "Strom",
                    "cell": ""
                },

@kazux2
Copy link
Collaborator

kazux2 commented Sep 10, 2022

Hi David, I implemented the first two features. For the 4th one, to update $s ausgewählte, could you specify the incoming json structure from root level? What I have in the sampleData.js "data_view_individual_data" at the top. Will the UDP be like this for this feature?

"""
{
"data_view_individual_data": {
"buildings_groups": {
"""

@dunland
Copy link
Member Author

dunland commented Sep 15, 2022

There are two implementations. The relevant one (for the buildings_interaction mode) looks like this:

{
    "buildings_groups": {
        "group_0": {
            "buildings": [
                {
                    "address": "R\u00fcsdorfer Stra\u00dfe 28",
                    "avg_spec_heat_consumption": 224.0,
                    "avg_spec_power_consumption": 19.678693,
                    "cluster_size": 10.0,
                    "emissions_graphs": "data/outputs/output_20220915_08-16-27/emissions/CO2_emissions_7.50.png",
                    "energy_prices_graphs": "data/outputs/output_20220915_08-16-27/energy_prices/energy_prices_7.50.png",
                    "CO2": 0.0125813315,
                    "connection_to_heat_grid": false,
                    "connection_to_heat_grid_prior": false,
                    "refurbished": false,
                    "refurbished_prior": false,
                    "environmental_engagement": false,
                    "environmental_engagement_prior": false,
                    "energy_source": "\u00d6l",
                    "cell": ""
                }
            ],
            "connections": 0
        },
        "group_1": {
            "buildings": [
                {
                    "address": "R\u00fcsdorfer Stra\u00dfe 40",
                    "avg_spec_heat_consumption": 196.4097951852,
                    "avg_spec_power_consumption": 36.5880559259,
                    "cluster_size": 27.0,
                    "emissions_graphs": "data/outputs/output_20220915_08-16-27/emissions/CO2_emissions_7.55.png",
                    "energy_prices_graphs": "data/outputs/output_20220915_08-16-27/energy_prices/energy_prices_7.55.png",
                    "CO2": 0.0120015825,
                    "connection_to_heat_grid": false,
                    "connection_to_heat_grid_prior": false,
                    "refurbished": false,
                    "refurbished_prior": false,
                    "environmental_engagement": true,
                    "environmental_engagement_prior": true,
                    "energy_source": "Gas",
                    "cell": ""
                }
            ],
            "connections": 0
        },
        "group_2": [
            ""
        ],
        "group_3": [
            ""
        ]
    }
}

The other one, sent right after the simulation, has a wrapper "data_view_individual_data" around it and looks like this:

{
    "data_view_individual_data": {
        "buildings_groups": {
            "group_0": {
                "buildings": [
                    {
                        "address": "Rüsdorfer Straße 28",
                        "avg_spec_heat_consumption": 224.0,
                        "avg_spec_power_consumption": 19.678693,
                        "cluster_size": 10.0,
                        "emissions_graphs": "data/outputs/output_20220915_08-16-27/emissions/CO2_emissions_7.50.png",
                        "energy_prices_graphs": "data/outputs/output_20220915_08-16-27/energy_prices/energy_prices_7.50.png",
                        "CO2": 0.0125813315,
                        "connection_to_heat_grid": false,
                        "connection_to_heat_grid_prior": false,
                        "refurbished": false,
                        "refurbished_prior": false,
                        "environmental_engagement": false,
                        "environmental_engagement_prior": false,
                        "energy_source": "Öl",
                        "cell": ""
                    }
                ],
                "connections": 0
            },
            "group_1": {
                "buildings": [
                    {
                        "address": "Rüsdorfer Straße 40",
                        "avg_spec_heat_consumption": 196.4097951852,
                        "avg_spec_power_consumption": 36.5880559259,
                        "cluster_size": 27.0,
                        "emissions_graphs": "data/outputs/output_20220915_08-16-27/emissions/CO2_emissions_7.55.png",
                        "energy_prices_graphs": "data/outputs/output_20220915_08-16-27/energy_prices/energy_prices_7.55.png",
                        "CO2": 0.0120015825,
                        "connection_to_heat_grid": false,
                        "connection_to_heat_grid_prior": false,
                        "refurbished": false,
                        "refurbished_prior": false,
                        "environmental_engagement": true,
                        "environmental_engagement_prior": true,
                        "energy_source": "Gas",
                        "cell": ""
                    }
                ],
                "connections": 0
            },
            "group_2": [
                ""
            ],
            "group_3": [
                ""
            ]
        }
    }
}

@kazux2
Copy link
Collaborator

kazux2 commented Oct 1, 2022

image

Hello. I worked on the 4th task of updating sum of selected connections on workshop_prototype brach. Could you check?

@dunland
Copy link
Member Author

dunland commented Oct 6, 2022

I added "slider_handles" as a list containing the selected decisions per group. I think using this one instead of the struct containing "sliders" is better, because otherwise - as with your proposed solution - the underlined text style will be overwritten instantly by the renderHouseInfo function.

{
    "buildings_groups": {
        "group_0": {
            "buildings": [
                {
                    "address": "R\u00fcsdorfer Stra\u00dfe 18",
                    "avg_spec_heat_consumption": 417.4165075,
                    "avg_spec_power_consumption": 35.305475,
                    "cluster_size": 4,
                    "emissions_graphs": "",
                    "energy_prices_graphs": "",
                    "CO2": 0.022635805,
                    "connection_to_heat_grid": false,
                    "connection_to_heat_grid_prior": false,
                    "refurbished": false,
                    "refurbished_prior": false,
                    "save_energy": false,
                    "save_energy_prior": false,
                    "energy_source": "Gas",
                    "cell": ""
                },
                {
                    "address": "R\u00fcsdorfer Stra\u00dfe 40",
                    "avg_spec_heat_consumption": 197.379868,
                    "avg_spec_power_consumption": 36.4716976,
                    "cluster_size": 25,
                    "emissions_graphs": "",
                    "energy_prices_graphs": "",
                    "CO2": 0.0120015825,
                    "connection_to_heat_grid": false,
                    "connection_to_heat_grid_prior": false,
                    "refurbished": false,
                    "refurbished_prior": false,
                    "save_energy": false,
                    "save_energy_prior": false,
                    "energy_source": "Gas",
                    "cell": ""
                }
            ],
            "connections": 0,
            "slider_handles": [
                "connection_to_heat_grid"
            ]
        },
        "group_1": {
            "buildings": [
                {
                    "address": "R\u00fcsdorfer Stra\u00dfe 61",
                    "avg_spec_heat_consumption": 119.17281,
                    "avg_spec_power_consumption": 16.1021586364,
                    "cluster_size": 22,
                    "emissions_graphs": "",
                    "energy_prices_graphs": "",
                    "CO2": 0.006376463,
                    "connection_to_heat_grid": false,
                    "connection_to_heat_grid_prior": false,
                    "refurbished": false,
                    "refurbished_prior": false,
                    "save_energy": false,
                    "save_energy_prior": false,
                    "energy_source": "Gas",
                    "cell": ""
                }
            ],
            "connections": 0,
            "slider_handles": []
        },
        "group_2": {
            "buildings": [
                {
                    "address": "R\u00fcsdorfer Stra\u00dfe 47",
                    "avg_spec_heat_consumption": 147.10931,
                    "avg_spec_power_consumption": 33.40084,
                    "cluster_size": 2,
                    "emissions_graphs": "",
                    "energy_prices_graphs": "",
                    "CO2": 0.009385106,
                    "connection_to_heat_grid": false,
                    "connection_to_heat_grid_prior": false,
                    "refurbished": false,
                    "refurbished_prior": false,
                    "save_energy": false,
                    "save_energy_prior": false,
                    "energy_source": "Strom",
                    "cell": ""
                }
            ],
            "connections": 0,
            "slider_handles": []
        },
        "group_3": {
            "buildings": [
                {
                    "address": "R\u00fcsdorfer Stra\u00dfe 16",
                    "avg_spec_heat_consumption": 344.119725,
                    "avg_spec_power_consumption": 50.34868,
                    "cluster_size": 4,
                    "emissions_graphs": "",
                    "energy_prices_graphs": "",
                    "CO2": 0.0191294115,
                    "connection_to_heat_grid": false,
                    "connection_to_heat_grid_prior": false,
                    "refurbished": false,
                    "refurbished_prior": false,
                    "save_energy": false,
                    "save_energy_prior": false,
                    "energy_source": "Gas",
                    "cell": ""
                }
            ],
            "connections": 0,
            "slider_handles": []
        }
    }
}

@dunland dunland closed this as completed Oct 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants