Skip to content
Snippets Groups Projects
Select Git revision
  • 0764662d61121fb1502ed5ebfb5105cd1f41a145
  • main default protected
  • Kelvinrr-patch-3
  • radius_update
  • revert-616-apollo_pan
  • vims
  • 0.10
  • Kelvinrr-patch-2
  • revert-563-minirf_fix
  • Kelvinrr-patch-1
  • 0.9
  • acpaquette-patch-3
  • acpaquette-patch-2
  • acpaquette-patch-1
  • spiceql
  • ci-coverage
  • 0.10.0
  • 0.9.1
  • 0.9.0
  • 0.8.7
  • 0.8.8
  • 0.8.6
  • 0.8.3
  • 0.8.4
  • 0.8.5
  • 0.8.2
  • 0.8.1
  • 0.8.0
  • 0.7.3
  • 0.7.2
  • 0.7.1
  • 0.7.0
  • 0.6.5
  • 0.6.4
  • 0.6.3
  • 0.6.2
36 results

AleTest.cpp

Blame
    • Kelvin Rodriguez's avatar
      0764662d
      ISD object without Rotation and State support. (#315) · 0764662d
      Kelvin Rodriguez authored
      * version tick
      
      * added headers
      
      * added isd
      
      * updated cmakelists
      
      * added header
      
      * removed print from cmakelists
      
      * changed rotation case
      
      * moved isd test to single module
      
      * added in line isd
      
      * Added failure tests. Commented out distortion tests.
      
      * added more tests to increase coverage
      
      * changed header file naming convention
      
      * updated source files and CMakeLists.txt
      
      * renamed isd_tests.cpp -> IsdTests.cpp
      
      * Updated tests based on comments.
      
      * Capitalized enum values.
      
      * added a few more asserts to check array size
      0764662d
      History
      ISD object without Rotation and State support. (#315)
      Kelvin Rodriguez authored
      * version tick
      
      * added headers
      
      * added isd
      
      * updated cmakelists
      
      * added header
      
      * removed print from cmakelists
      
      * changed rotation case
      
      * moved isd test to single module
      
      * added in line isd
      
      * Added failure tests. Commented out distortion tests.
      
      * added more tests to increase coverage
      
      * changed header file naming convention
      
      * updated source files and CMakeLists.txt
      
      * renamed isd_tests.cpp -> IsdTests.cpp
      
      * Updated tests based on comments.
      
      * Capitalized enum values.
      
      * added a few more asserts to check array size
    store.js 2.31 KiB
    /* Vuex store, for centralized state management */
    
    import Vue from 'vue';
    import Vuex from 'vuex';
    import client from 'api-client';
    import main from './main';
    
    Vue.use(Vuex);
    
    export default new Vuex.Store({
      state: {
        path: '',
        loading: true,
        tapeButtonEnabled: false,
        jobs: [],
        user: 'anonymous'
      },
      mutations: {
        setLoading(state, loading) {
          state.loading = loading;
        },
        setPath(state, value) {
          if (!value) {
            value = '';
          }
          state.path = value;
        },
        setTapeButtonEnabled(state, value) {
          state.tapeButtonEnabled = value;
        },
        setJobs(state, jobs) {
          // empty the array
          state.jobs.splice(0, jobs.length);
          // fill again
          for (let i = 0; i < jobs.length; i++) {
            state.jobs.push(jobs[i]);
          }
        },
        addJob(state, job) {
          state.jobs.push(job);
        },
        setUsername(state, username) {
          state.user = username;
        }
      },
      actions: {
        setPath({ state, commit, dispatch }, path) {
          commit('setPath', path);
          client.getNode(state.path)
            .then(res => {
              document.getElementById('nodes').outerHTML = res;
              let checkboxes = document.querySelectorAll('#nodes input[type="checkbox"]');
              for (let i = 0; i < checkboxes.length; i++) {
                checkboxes[i].addEventListener('change', function() {
                  dispatch('computeButtonVisibility');
                });
              }
              dispatch('computeButtonVisibility');
            });
        },
        computeButtonVisibility({ commit }) {
          commit('setTapeButtonEnabled', document.querySelectorAll('#nodes input.tape:checked').length > 0);
        },
        startRecallFromTapeJob({ commit }) {
          let tapeCheckboxes = document.querySelectorAll('#nodes input:checked'); // temporary: it should be input.tape
          let paths = [];
          for (let i = 0; i < tapeCheckboxes.length; i++) {
            paths.push(tapeCheckboxes[i].getAttribute('data-node'));
          }
          client.startRecallFromTapeJob(paths)
            .then(job => {
              main.showInfo('Job started');
              commit('addJob', job);
            });
        },
        loadJobs({ commit }) {
          client.loadJobs()
            .then(jobs => commit('setJobs', jobs));
        },
        loadUserInfo({ commit }) {
          client.getUserInfo()
            .then(res => commit('setUsername', res.username));
        }
      }
    });