diff --git a/firebase.json b/firebase.json index a377b93..798dc16 100644 --- a/firebase.json +++ b/firebase.json @@ -14,11 +14,14 @@ ] }, "emulators": { + "firestore": { + "port": 8081 + }, "hosting": { "port": 8000 }, "ui": { - "enabled": true + "enabled": false } } } diff --git a/src/main.js b/src/main.js index db0bebf..26ef355 100644 --- a/src/main.js +++ b/src/main.js @@ -5,6 +5,7 @@ import store from './store' import vuetify from './plugins/vuetify'; import './services/axios' import firebase from 'firebase/app' +import 'firebase/firestore' // ← ADD THIS LINE Vue.config.productionTip = false @@ -21,6 +22,12 @@ const firebaseConfig = { // Initialize Firebase firebase.initializeApp(firebaseConfig); +// Connect to Firestore emulator if in development +if (process.env.VUE_APP_USE_EMULATORS === 'true') { + const db = firebase.firestore(); + db.useEmulator('localhost', 8081); +} + new Vue({ router, store, diff --git a/src/store/calibration.js b/src/store/calibration.js index d3e14ba..19a890f 100644 --- a/src/store/calibration.js +++ b/src/store/calibration.js @@ -1,5 +1,6 @@ import axios from "axios"; import firebase from "firebase/app"; +import "firebase/firestore"; // ← ADD THIS LINE import router from "@/router"; export default { state: { diff --git a/src/views/DoubleCalibrationRecord.vue b/src/views/DoubleCalibrationRecord.vue index 2043dd5..c9a7c78 100644 --- a/src/views/DoubleCalibrationRecord.vue +++ b/src/views/DoubleCalibrationRecord.vue @@ -287,30 +287,26 @@ export default { }, }, async created() { - console.log("rodou created"); - await this.verifyFromRuxailab() - this.$store.commit('setIndex', 0) - this.usedPattern = this.generateRuntimePattern() - - if (this.usedPattern.length === 0) { - const width = window.innerWidth - const height = window.innerHeight - const offset = this.offset || 100 - const pointCount = this.$store.state.calibration.pointNumber - - const generatedPattern = this.generateCalibrationPattern(pointCount, width, height, offset) - - this.$store.commit('setMockPattern', generatedPattern) - this.usedPattern = generatedPattern - - } - await this.startWebCamCapture(); - console.log("chamou drawPoint no created com os valores:", this.usedPattern[0].x, this.usedPattern[0].y); - this.drawPoint(this.usedPattern[0].x, this.usedPattern[0].y, 1) - this.advance(this.usedPattern, this.circleIrisPoints, this.msPerCapture) - console.log("UsedPattern inteiro", this.usedPattern); - - }, + console.log("rodou created"); + await this.verifyFromRuxailab() + this.$store.commit('setIndex', 0) + + // ✅ USE THE WORKING METHOD + const pointCount = this.$store.state.calibration.pointNumber || 9; + this.usedPattern = this.generateCalibrationPattern( + pointCount, + window.innerWidth, + window.innerHeight, + this.offset || 100 + ); + + await this.startWebCamCapture(); + console.log("chamou drawPoint no created com os valores:", this.usedPattern[0].x, this.usedPattern[0].y); + this.drawPoint(this.usedPattern[0].x, this.usedPattern[0].y, 1) + this.advance(this.usedPattern, this.circleIrisPoints, this.msPerCapture) + console.log("UsedPattern inteiro", this.usedPattern); +} +, methods: { generateCalibrationPattern(pointCount, width, height, offset) { const patterns = [];