Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@
]
},
"emulators": {
"firestore": {
"port": 8081
},
"hosting": {
"port": 8000
},
"ui": {
"enabled": true
"enabled": false
}
}
}
7 changes: 7 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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,
Expand Down
1 change: 1 addition & 0 deletions src/store/calibration.js
Original file line number Diff line number Diff line change
@@ -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: {
Expand Down
44 changes: 20 additions & 24 deletions src/views/DoubleCalibrationRecord.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand Down