In this version, I solved the code conflict, but because a lot of code and files were added to upsteam/main, and I really couldn't merge this branch into the source branch of the previous pull request, I created this pull request and rewrite the documentation. You mentioned in the client meeting not to add other models, but I had already added the functions of PHS other than drawing before the meeting, so it is up to you to decide whether to delete it or not. I tried to implement other todo items, which mainly solved the problem of monitoring changes in input values.
Types of change
[x] add PHS index model without ploting chart
[x] listen to changes in the variables input
Implementation
Here I added PHS to the page. It and other models can change the input by directly modifying the value in the input box instead of only changing the input by clicking the button of the input box.
But because I did not add PHS-related plotting code, I will gain the error as shown in the figure.
First, I wanted to dynamically monitor changes in variable input, so I changed the id assigned when inputting parameters from static to dynamic, so that I can use ALL in Callback to input the parameters of all models.
As shown below, in the Callback of the update_store_inputs functions, I use dynamic listening input changes instead of listening for form clicks and capturing the value entered in the form.
Since the values captured from dynamic input is list rather than dictionary, they need to be processed into a dictionary named form_content as shown below before calling the get_inputs function in the update_chart function and the display_results function in the update_outputs function.
The get_inputs function is also called in the display_results function.
I did not use the find_dict_with_key_value function in the get_inputs function, but directly used form_content.get() to find the value corresponding to the key. The specific modifications are as follows:
back-end development
Description
In this version, I solved the code conflict, but because a lot of code and files were added to upsteam/main, and I really couldn't merge this branch into the source branch of the previous pull request, I created this pull request and rewrite the documentation. You mentioned in the client meeting not to add other models, but I had already added the functions of PHS other than drawing before the meeting, so it is up to you to decide whether to delete it or not. I tried to implement other todo items, which mainly solved the problem of monitoring changes in input values.
Types of change
Implementation
Here I added PHS to the page. It and other models can change the input by directly modifying the value in the input box instead of only changing the input by clicking the button of the input box. But because I did not add PHS-related plotting code, I will gain the error as shown in the figure.
First, I wanted to dynamically monitor changes in variable input, so I changed the id assigned when inputting parameters from static to dynamic, so that I can use ALL in Callback to input the parameters of all models.
As shown below, in the Callback of the update_store_inputs functions, I use dynamic listening input changes instead of listening for form clicks and capturing the value entered in the form.
Since the values captured from dynamic input is list rather than dictionary, they need to be processed into a dictionary named form_content as shown below before calling the get_inputs function in the update_chart function and the display_results function in the update_outputs function.
The get_inputs function is also called in the display_results function.
I did not use the find_dict_with_key_value function in the get_inputs function, but directly used form_content.get() to find the value corresponding to the key. The specific modifications are as follows: