quarree100 / qScope_infoscreen

0 stars 0 forks source link

buildings interaction mode #27

Closed dunland closed 2 years ago

dunland commented 2 years ago

highight selected decsion feature

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

dunland commented 2 years ago

image

dunland commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago
image

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

dunland commented 2 years ago

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": []
        }
    }
}