|  | @@ -2,32 +2,35 @@
 | 
											
												
													
														|  |    <q-page class="row items-center justify-evenly">
 |  |    <q-page class="row items-center justify-evenly">
 | 
											
												
													
														|  |      <!--    Your code-->
 |  |      <!--    Your code-->
 | 
											
												
													
														|  |      <h4>Spectrum</h4>
 |  |      <h4>Spectrum</h4>
 | 
											
												
													
														|  | -    <input-with-units
 |  | 
 | 
											
												
													
														|  | -        v-model:input-result="someValue"
 |  | 
 | 
											
												
													
														|  | -        v-model:is-showing-help="isShowingHelpForInputWithUnits"
 |  | 
 | 
											
												
													
														|  | -        :initial-expression="someExpr"
 |  | 
 | 
											
												
													
														|  | -        title="Re(n)"
 |  | 
 | 
											
												
													
														|  | -        units="nm"
 |  | 
 | 
											
												
													
														|  | -    ></input-with-units>
 |  | 
 | 
											
												
													
														|  | -    <input-with-units
 |  | 
 | 
											
												
													
														|  | -        v-model:input-result="someValue"
 |  | 
 | 
											
												
													
														|  | -        v-model:is-showing-help="isShowingHelpForInputWithUnits"
 |  | 
 | 
											
												
													
														|  | -        :initial-expression="someExpr"
 |  | 
 | 
											
												
													
														|  | -        title=""
 |  | 
 | 
											
												
													
														|  | -        units=""
 |  | 
 | 
											
												
													
														|  | -        active
 |  | 
 | 
											
												
													
														|  | -    ></input-with-units>
 |  | 
 | 
											
												
													
														|  | -    Input result: {{someValue}}
 |  | 
 | 
											
												
													
														|  | 
 |  | +          Wavelength
 | 
											
												
													
														|  | 
 |  | +          <input-with-units
 | 
											
												
													
														|  | 
 |  | +              v-model:input-result="simulationSetupGui.fromWL"
 | 
											
												
													
														|  | 
 |  | +              v-model:is-showing-help="isShowingHelpForInputWithUnits"
 | 
											
												
													
														|  | 
 |  | +              :initial-expression="simulationSetupGui.fromWL.toString()"
 | 
											
												
													
														|  | 
 |  | +              title="from"
 | 
											
												
													
														|  | 
 |  | +              units="nm"
 | 
											
												
													
														|  | 
 |  | +          />
 | 
											
												
													
														|  | 
 |  | +          <input-with-units
 | 
											
												
													
														|  | 
 |  | +              v-model:input-result="someValue"
 | 
											
												
													
														|  | 
 |  | +              v-model:is-showing-help="isShowingHelpForInputWithUnits"
 | 
											
												
													
														|  | 
 |  | +              :initial-expression="someExpr"
 | 
											
												
													
														|  | 
 |  | +              title=""
 | 
											
												
													
														|  | 
 |  | +              units=""
 | 
											
												
													
														|  | 
 |  | +              active
 | 
											
												
													
														|  | 
 |  | +          />
 | 
											
												
													
														|  | 
 |  | +    Input result: {{$store.state.simulationSetup.gui.fromWL}}
 | 
											
												
													
														|  |  <!--    tooltip_text="help text"-->
 |  |  <!--    tooltip_text="help text"-->
 | 
											
												
													
														|  |    </q-page>
 |  |    </q-page>
 | 
											
												
													
														|  |  </template>
 |  |  </template>
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  <script lang='ts'>
 |  |  <script lang='ts'>
 | 
											
												
													
														|  | -import { defineComponent, ref,
 |  | 
 | 
											
												
													
														|  | -  computed
 |  | 
 | 
											
												
													
														|  | -} from 'vue';
 |  | 
 | 
											
												
													
														|  | -import { useStore } from 'src/store';
 |  | 
 | 
											
												
													
														|  | -import InputWithUnits from 'components/InputWithUnits.vue';
 |  | 
 | 
											
												
													
														|  | 
 |  | +import {
 | 
											
												
													
														|  | 
 |  | +  defineComponent, ref,
 | 
											
												
													
														|  | 
 |  | +  computed, watch, reactive
 | 
											
												
													
														|  | 
 |  | +} from 'vue'
 | 
											
												
													
														|  | 
 |  | +import { useStore } from 'src/store'
 | 
											
												
													
														|  | 
 |  | +import InputWithUnits from 'components/InputWithUnits.vue'
 | 
											
												
													
														|  | 
 |  | +import { cloneDeep } from 'lodash'
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  export default defineComponent({
 |  |  export default defineComponent({
 | 
											
										
											
												
													
														|  | @@ -35,17 +38,19 @@ export default defineComponent({
 | 
											
												
													
														|  |    components: {InputWithUnits },
 |  |    components: {InputWithUnits },
 | 
											
												
													
														|  |    setup() {
 |  |    setup() {
 | 
											
												
													
														|  |      const $store = useStore()
 |  |      const $store = useStore()
 | 
											
												
													
														|  | -    let someValue = ref(10);
 |  | 
 | 
											
												
													
														|  | -    let someExpr = ref('10');
 |  | 
 | 
											
												
													
														|  | 
 |  | +    let someValue = ref(10)
 | 
											
												
													
														|  | 
 |  | +    let someExpr = ref('10')
 | 
											
												
													
														|  |      // InputWithUnits component will disable showing help after first input
 |  |      // InputWithUnits component will disable showing help after first input
 | 
											
												
													
														|  |      const isShowingHelpForInputWithUnits = computed({
 |  |      const isShowingHelpForInputWithUnits = computed({
 | 
											
												
													
														|  | -      get: () => $store.state.guiRuntime.isShowingHelpForInputWithUnits,
 |  | 
 | 
											
												
													
														|  | -      set: val => {
 |  | 
 | 
											
												
													
														|  | -        $store.commit('guiRuntime/setIsShowingHelpForInputWithUnits', val)
 |  | 
 | 
											
												
													
														|  | -      }
 |  | 
 | 
											
												
													
														|  | 
 |  | +      get: () => $store.state.plotRuntime.isShowingHelpForInputWithUnits,
 | 
											
												
													
														|  | 
 |  | +      set: val => $store.commit('plotRuntime/setIsShowingHelpForInputWithUnits', val)
 | 
											
												
													
														|  |      })
 |  |      })
 | 
											
												
													
														|  | -    // let isShowingHelpForInputWithUnits = ref(true)
 |  | 
 | 
											
												
													
														|  | -    return { someValue, someExpr, isShowingHelpForInputWithUnits};
 |  | 
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +    const simulationSetupGui = reactive(cloneDeep($store.state.simulationSetup.gui))
 | 
											
												
													
														|  | 
 |  | +    watch(simulationSetupGui, () => $store.commit('simulationSetup/setGuiState',simulationSetupGui))
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +    // console.log($store.state.simulationSetup.gui.toWL)
 | 
											
												
													
														|  | 
 |  | +    return { someValue, someExpr, isShowingHelpForInputWithUnits, simulationSetupGui}
 | 
											
												
													
														|  |    }
 |  |    }
 | 
											
												
													
														|  | -});
 |  | 
 | 
											
												
													
														|  | 
 |  | +})
 | 
											
												
													
														|  |  </script>
 |  |  </script>
 |