Bläddra i källkod

add styling for physics.itmo.ru

Konstantin Ladutenko 3 år sedan
förälder
incheckning
ec48cf99fa

+ 1 - 0
Makefile

@@ -61,6 +61,7 @@ wasm: $(SRCDIR)/nmie-js-wrapper.cc $(CXX_NMIE_HEADERS)
 	emcc --bind -lm -Wall -pedantic -O2 -std=c++11 -s NO_DISABLE_EXCEPTION_CATCHING -s MODULARIZE=1 -s ASSERTIONS=1 -s WASM=1 -s ALLOW_MEMORY_GROWTH=1 -s EXPORT_NAME="nmiejs" -s ENVIRONMENT="web" -o nmiejs.js $(SRCDIR)/nmie-js-wrapper.cc
 #	emcc --bind -lm -Wall -pedantic -Oz -std=c++11 -s NO_DISABLE_EXCEPTION_CATCHING -s MODULARIZE=1 -s ASSERTIONS=1 -s WASM=1 -s ALLOW_MEMORY_GROWTH=1 -s EXPORT_NAME="nmiejs" -s ENVIRONMENT="web" -o nmiejs.js $(SRCDIR)/nmie-js-wrapper.cc
 #	emcc --bind -lm -Wall -pedantic -Oz -std=c++11 -s NO_DISABLE_EXCEPTION_CATCHING -s MODULARIZE=1 -s EXPORT_ES6=1 -s ASSERTIONS=1 -s WASM=1 -s ALLOW_MEMORY_GROWTH=1 -s EXPORT_NAME="nmiejs" -s ENVIRONMENT="web" -o nmiejs.js $(SRCDIR)/nmie-js-wrapper.cc
+#	emcc --bind -lm -Wall -pedantic -O2 -std=c++11 -s NO_DISABLE_EXCEPTION_CATCHING -s MODULARIZE=1 -s EXPORT_ES6=1 -s ASSERTIONS=1 -s WASM=1 -s ALLOW_MEMORY_GROWTH=1 -s EXPORT_NAME="nmiejs" -s ENVIRONMENT="web" -o nmiejs.js $(SRCDIR)/nmie-js-wrapper.cc
 
 #	emcc --bind -lm -Wall -O3 -std=c++11 -s WASM=1 -s EXTRA_EXPORTED_RUNTIME_METHODS='["cwrap"]' -s ALLOW_MEMORY_GROWTH=1 -s MODULARIZE=1 -s 'EXPORT_NAME="nmiejs"' -o ./nmiejs.js $(SRCDIR)/nmie-js-wrapper.cc
 # 	emcc -g --bind -lm -Wall -std=c++11 -s WASM=1 -s NO_EXIT_RUNTIME=1 -s "EXTRA_EXPORTED_RUNTIME_METHODS=['addOnPostRun']" -o nmie.js $(SRCDIR)/nmie-js-wrapper.cc

+ 4 - 0
guiapp/quasar.conf.js

@@ -53,6 +53,10 @@ module.exports = configure(function (ctx) {
 
     // Full list of options: https://v2.quasar.dev/quasar-cli/quasar-conf-js#Property%3A-build
     build: {
+      publicPath: process.env.NODE_ENV === 'production'
+          ? '/themes/custom/physics/mie-next/' //deploy path in Drupal setup at physics.ifmo.ru
+          : '/',
+
       // extendWebpack (cfg, { isServer, isClient }) {
       //   cfg.module.rules.push({
       //     enforce: 'pre',

+ 2 - 1
guiapp/src/components/RunSimulationSpectrum.vue

@@ -17,6 +17,7 @@
 
         <div class="col-auto">
           <q-btn
+              color="primary"
               no-caps
               @click="saveSpectrumSimulation"
           >Save</q-btn>
@@ -152,7 +153,7 @@ export default defineComponent({
           console.log(e)
         }
         isRunning.value = false
-      },50)
+      },200)
     }
 
     watch(isNmieLoaded, ()=>{

+ 33 - 0
guiapp/src/index.template.html

@@ -16,6 +16,39 @@
     <link rel="icon" type="image/ico" href="favicon.ico">
   </head>
   <body>
+  <style> /*to make it compatible with physics.itmo.ru*/
+#q-app .row, .q-item.row  {
+    margin-left: unset;
+    margin-right: unset;
+    margin-bottom: unset;
+}
+.q-gutter-x-md > *, .q-gutter-md > * {
+    margin-left: 16px !important;
+}
+.q-ml-md {
+    margin-left: 16px !important;
+}
+#q-app header.fixed-top {position: absolute;}
+      .q-header {
+          z-index: 1000 !important;
+      }
+      .q-field__control::before, .q-field__control::after {
+    content: "" !important;
+    }
+      #q-app .row::before, #q-app .row::after {
+          content: none;
+          display: flex; 
+      }
+      #q-app button:hover {
+          font-family: Roboto,-apple-system,Helvetica Neue,Helvetica,Arial,sans-serif;
+      }
+      #q-app a {
+          text-decoration: none;
+      }
+      #q-app a:hover, #q-app a:focus {
+          color: inherit;
+      }
+  </style>
     <!-- DO NOT touch the following DIV -->
     <div id="q-app"></div>
   </body>

+ 1 - 0
guiapp/src/pages/Near-field.vue

@@ -1,5 +1,6 @@
 <template>
   <q-page class="column q-px-md">
+    Under construction!
     <div class="q-ma-sm"/>
     <GetSourceParameters/>
     <GetHostIndex/>

+ 1 - 0
guiapp/src/router/routes.ts

@@ -10,6 +10,7 @@ const routes: RouteRecordRaw[] = [
       { path: 'nearfield', component: () => import('pages/Near-field.vue') },
       { path: 'farfield', component: () => import('pages/Far-field.vue') },
       { path: 'info', component: () => import('pages/Info.vue') },
+      { path: 'materials', component: () => import('pages/Materials.vue') },
     ],
   },
 

+ 21 - 21
guiapp/src/store/simulation-setup/actions.ts

@@ -9,27 +9,27 @@ const actions: ActionTree<simulationSetupStateInterface, StateInterface> = {
     const module = await nmiejs()
     const nmie = new module.nmie()
     commit('setNmie', nmie)
-    // Test nmiejs if working
-    if (state.nmie && !state.isNmieRunning) {
-      commit('markNmieAsStarted')
-      state.nmie.ClearTarget()
-      const R = 100.0
-      const reN = 4.0
-      const imN = 0.01
-      state.nmie.AddTargetLayerReIm(R, reN, imN)
-      state.nmie.SetModeNmaxAndType(-1, -1)
-      const WL = 800
-      state.nmie.SetWavelength(WL)
-      state.nmie.RunMieCalculation()
-      console.log(state.nmie.GetQsca())
-      // outer_arc_points, radius_points, from_Rho, to_Rho,
-      // from_Theta, to_Theta, from_Phi, to_Phi, isIgnoreAvailableNmax
-      state.nmie.RunFieldCalculationPolar(2, 2,
-          0.1, 1.5, 0, 3.1415, 0, 3.1415,
-          0)
-      console.log('Field Eabs:', state.nmie.GetFieldEabs())
-      commit('markNmieAsFinished')
-    }
+    // // Test nmiejs if working
+    // if (state.nmie && !state.isNmieRunning) {
+    //   commit('markNmieAsStarted')
+    //   state.nmie.ClearTarget()
+    //   const R = 100.0
+    //   const reN = 4.0
+    //   const imN = 0.01
+    //   state.nmie.AddTargetLayerReIm(R, reN, imN)
+    //   state.nmie.SetModeNmaxAndType(-1, -1)
+    //   const WL = 800
+    //   state.nmie.SetWavelength(WL)
+    //   state.nmie.RunMieCalculation()
+    //   console.log(state.nmie.GetQsca())
+    //   // outer_arc_points, radius_points, from_Rho, to_Rho,
+    //   // from_Theta, to_Theta, from_Phi, to_Phi, isIgnoreAvailableNmax
+    //   state.nmie.RunFieldCalculationPolar(2, 2,
+    //       0.1, 1.5, 0, 3.1415, 0, 3.1415,
+    //       0)
+    //   console.log('Field Eabs:', state.nmie.GetFieldEabs())
+    //   commit('markNmieAsFinished')
+    // }
     if (state.nmie) {
       commit('markNmieAsLoaded')
     }