Settings.vue 6.22 KB
Newer Older
TOUZE Francois's avatar
TOUZE Francois committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234
<template>

  <div id="computing-holder">
  
    <div id="computing-menu" class="border-bottom border-light d-flex flex-row justify-content-between">
        <div id="computing-title">
	    <h2 @click="showConfig">Settings</h2>
	    <span class="ml-3" @click="showPlots">Plots</span>
        </div>	
    </div>
   
    <div id="computing-block" v-if="isConfig">

        <!--div class="instruction-block d-flex flex-row">
            <p>First, select an output</p>
	</div-->
	
        <!--div class="choice-block flex-row"-->
	<div id="radiobox">
	
            <p>Select a plot option :</p>
	    
	    <div>
	        <input type="radio" id="choice1" value="rms-emittance" v-on:click="say('rms-emittance')" v-model="picked">
                <label for="choice1">transverse emittance</label>

                <input type="radio" id="choice5" value="beta-functions" v-on:click="say('beta-functions')" v-model="picked">
                <label for="choice5">beta functions</label>

                 <input type="radio" id="choice9" value="tune-functions" v-on:click="say('tune-functions')" v-model="picked">
                <label for="choice9">tune functions</label>		
	    </div>
	    
	    <div>
	        <input type="radio" id="choice2" value="bunch-length" v-on:click="say('bunch-length')" v-model="picked">
                <label for="choice2">bunch length</label>
		
                <input type="radio" id="choice6" value="alfa-functions" v-on:click="say('alfa-functions')" v-model="picked">
                <label for="choice6">alpha functions</label>
		
		<input type="radio" id="choice10" value="H-function" v-on:click="say('H-function')" v-model="picked">
                <label for="choice10">Hx invariant</label>
	    </div>
	    
            <div>
	         <input type="radio" id="choice3" value="energy-spread" v-on:click="say('energy-spread')" v-model="picked">
                <label for="choice3">energy spread</label>
		
		<input type="radio" id="choice7" value="phase-functions" v-on:click="say('phase-functions')" v-model="picked">
                <label for="choice7">phase functions</label>

                <input type="radio" id="choice11" value="phase-space" v-on:click="say('phase-space')" v-model="picked">
                <label for="choice11">ellipse</label>
	    </div>
	    
	    <div>
	        <input type="radio" id="choice4" value="beam-size"  v-on:click="say('beam-size')" v-model="picked">
                <label for="choice4">beam size</label>
		
		<input type="radio" id="choice8" value="chromatic-functions" v-on:click="say('chromatic-functions')" v-model="picked">
                <label for="choice7">chromatic functions</label>               
	    </div>
	    
            <!--span>Choisi => {{ picked }}</span-->
            
        </div>

        <div class="d-flex flex-row justify-content-between mb-3">
            <button size="md" type="button" class="white-button ml-4">
                <router-link to="/Simulate">Back to simulate</router-link>
            </button>	    
            <button size="md" type="button" id="start-simulation" class="btn new-sector border border-success text-white bg-success mr-4" @click="showPlots" v-if="isDraw">Draw
             </button>
             <!--<b-button size="md"w type="button" id="start-simulation" class="btn new-sector border border-success text-white bg-success mr-4" v-on:click="showConsole" v-if="isSimulationSucceed">Analyze outputs</b-button>--> 
        </div>
    </div>
    <plots v-if="isPlots"></plots>
  </div>
  
</template>

<script>
import plots from '@/components/analyze-page/Plots.vue';
import axios from 'axios';

export default {
       components: {
         plots
       },
       data () {
         return {
           isConfig: true,
           isPlots : false,
           isDraw : true,
           picked: null
         }
       },
       created() {
          console.log('Settings:created => ', this.isConfig);
	  console.log('Settings:created => ', this.isPlots);
       },
       methods: {
         say:function (option) {
	    console.log('say:picked => ', option)
	    this.picked= option
	    this.$store.commit('setPickedPlot', this.picked);
	 },   
         showConfig: function()   {
	   console.log('showConfig => ',this.picked);
	   this.isConfig = true;
	   this.isPlots = false;
	 },
	 showPlots: function() {
	   console.log('showPlots:: option => ',this.picked);
	   this.isConfig = false;
	   this.isPlots = true;
	 }
       }
};
</script>

<style scoped>

#computing-holder {
	width: 70%;
	height: auto;
	flex-grow: 5;
	box-shadow: 0px 4px 10px rgba(34, 47, 62, 0.2);
	background-color: white;
	padding-top: 20px;
	border-radius: 3px;
	padding-bottom: 10px;
	margin-right: 10px;
}

#computing-block {
	overflow: auto;	
}

#radiobox {
   background-color: lightcyan;
   border: 3px solid #999;
   margin-bottom: .4rem;
}

#radiobox input {
   margin-left: 25px;
}

#radiobox p {
   font-size: 24px;
   color: #008000;
   margin-left: 25px;
}

#computing-block .choice-block {
        height: 350px;
        background-color: yellow;
}

#computing-block .choice-block p {  
    font-weight: bold;
    font-size: 24px;
    color: #008000;
    vertical-align: middle;
    //position: absolute;
    //top: 180px;
    margin-left: 25px;
}

#computing-block .choice-block input {
    margin-left: 25px;
    margin-bottom: 0em;
    margin-top: 0em;
 }

#computing-block .instruction-block {
    height: 150px;
    position: relative;
}
#computing-block .instruction-block p {
    font-weight: bold;
    font-size: 24px;
    color: #008000;
    vertical-align: middle;
    position: absolute;
    top: 10px;
    margin-left: 25px;
}
#computing-block::-webkit-scrollbar {
    width: 8px;
}
#computing-block::-webkit-scrollbar-track {
    background: #f2f2f2; 
}
#computing-block::-webkit-scrollbar-thumb {
    background: #888; 
}
#computing-block::-webkit-scrollbar-thumb:hover {
    background: #888; 
}
#computing-menu {
	margin-left: 25px;
}
#computing-title h2 {
	display: inline-block;
	font-size: 24px;
	font-weight: bold;
	cursor: pointer;
	color: #0000ff;
}
#computing-title span:nth-child(2) {
	color: #ff0000;
	font-weight: 400;
	font-size: 24px;
	cursor: pointer;
}

input {
	background: #FFFFFF;
	border: 1px solid rgba(34, 47, 62, 0.5);
	border-radius: 3px
}

label {
  margin-right: 15px;
  line-height: 50px;
}





</style>