Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into multiag-pnp
Browse files Browse the repository at this point in the history
  • Loading branch information
mcm001 committed Jul 28, 2023
2 parents b5007f7 + 24a0c9c commit a321fee
Show file tree
Hide file tree
Showing 112 changed files with 5,917 additions and 2,233 deletions.
37 changes: 37 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Set default behavior to automatically normalize line endings (LF on check-in).
* text=auto

# Force batch scripts to always use CRLF line endings so that if a repo is accessed
# in Windows via a file share from Linux, the scripts will work.
*.{cmd,[cC][mM][dD]} text eol=crlf
*.{bat,[bB][aA][tT]} text eol=crlf
*.{ics,[iI][cC][sS]} text eol=crlf

# Force bash scripts to always use LF line endings so that if a repo is accessed
# in Unix via a file share from Windows, the scripts will work.
*.sh text eol=lf

# Ensure Spotless does not try to use CRLF line endings on Windows in the local repo.
*.gradle text eol=lf
*.java text eol=lf
*.json text eol=lf
*.md text eol=lf
*.xml text eol=lf
*.h text eol=lf
*.hpp text eol=lf
*.inc text eol=lf
*.inl text eol=lf
*.cpp text eol=lf

# Frontend Files
*.js text eol=lf
*.vue text eol=lf

# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.so binary
*.dll binary
*.webp binary
5 changes: 3 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,9 @@ jobs:
include:
- os: windows-2022
artifact-name: Win64
- os: macos-11
artifact-name: macOS
# Mac builds are broken due to opencv class loading issues -- disable for now
# - os: macos-11
# artifact-name: macOS
- os: ubuntu-22.04
artifact-name: Linux

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ build/spotlessJava
build/*
build
photon-lib/src/main/java/org/photonvision/PhotonVersion.java
photon-lib/bin/main/images/*
/photonlib-java-examples/bin/
photon-lib/src/generate/native/include/PhotonVersion.h
.gitattributes
Expand All @@ -157,3 +158,4 @@ photonlib-java-examples/*/vendordeps/*
photonlib-cpp-examples/*/vendordeps/*

*/networktables.json
*.sqlite
1 change: 1 addition & 0 deletions .styleguide
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ modifiableFileExclude {
\.so$
\.dll$
\.webp$
gradlew
}

includeProject {
Expand Down
12 changes: 6 additions & 6 deletions photon-client/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

<v-list-item
link
to="dashboard"
to="/dashboard"
@click="rollbackPipelineIndex()"
>
<v-list-item-icon>
Expand All @@ -45,7 +45,7 @@
<v-list-item
ref="camerasTabOpener"
link
to="cameras"
to="/cameras"
@click="switchToDriverMode()"
>
<v-list-item-icon>
Expand All @@ -57,7 +57,7 @@
</v-list-item>
<v-list-item
link
to="settings"
to="/settings"
@click="switchToSettingsTab()"
>
<v-list-item-icon>
Expand All @@ -69,7 +69,7 @@
</v-list-item>
<v-list-item
link
to="docs"
to="/docs"
>
<v-list-item-icon>
<v-icon>mdi-bookshelf</v-icon>
Expand Down Expand Up @@ -197,7 +197,7 @@
<v-card-text>
PhotonVision cannot connect to the NetworkTables Server. Please visit the
<router-link
to="settings"
to="/settings"
class="accent--text"
@click="switchToSettingsTab"
>
Expand Down Expand Up @@ -345,7 +345,7 @@ export default {
this.previouslySelectedIndices = null;
},
switchToSettingsTab() {
this.axios.post('http://' + this.$address + '/api/sendMetrics', {})
this.axios.post('http://' + this.$address + '/api/utils/publishMetrics')
}
}
};
Expand Down
68 changes: 49 additions & 19 deletions photon-client/src/components/pipeline/CameraAndPipelineSelect.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
<template>
<div>
<v-snackbar
v-model="snack"
top
:color="snackbar.color"
:timeout="2000"
>
<span>{{ snackbar.text }}</span>
</v-snackbar>
<v-row
align="center"
style="padding: 12px 12px 12px 24px"
Expand Down Expand Up @@ -144,15 +152,15 @@
</v-menu>
</v-col>
<v-col
v-if="currentPipelineType >= 0"
v-if="_currentPipelineType >= 0"
cols="10"
md="11"
lg="10"
no-gutters
class="pa-0"
>
<CVselect
v-model="currentPipelineType"
v-model="_currentPipelineType"
name="Type"
tooltip="Changes the pipeline type, which changes the type of processing that will happen on input frames"
:list="['Reflective Tape', 'Colored Shape', 'AprilTag']"
Expand Down Expand Up @@ -269,7 +277,12 @@ export default {
duplicateDialog: false,
showPipeTypeDialog: false,
proposedPipelineType : 0,
pipeIndexToDuplicate: undefined
pipeIndexToDuplicate: undefined,
snack: false,
snackbar: {
color: "success",
text: "",
}
}
},
computed: {
Expand Down Expand Up @@ -321,7 +334,7 @@ export default {
this.$store.commit('currentPipelineIndex', value - (this.$store.getters.isDriverMode ? 1 : 0));
}
},
currentPipelineType: {
_currentPipelineType: {
get() {
return this.$store.getters.currentPipelineSettings.pipelineType - 2;
},
Expand All @@ -333,11 +346,11 @@ export default {
methods: {
showTypeDialog(idx) {
// Only show the dialog if it's a new type
this.showPipeTypeDialog = idx !== this.currentPipelineType;
this.showPipeTypeDialog = idx !== this._currentPipelineType;
this.proposedPipelineType = idx;
},
changePipeType(actuallyChange) {
const newIdx = actuallyChange ? this.proposedPipelineType : this.currentPipelineType
const newIdx = actuallyChange ? this.proposedPipelineType : this._currentPipelineType
this.handleInputWithIndex('pipelineType', newIdx);
this.showPipeTypeDialog = false;
},
Expand All @@ -347,16 +360,37 @@ export default {
},
saveCameraNameChange() {
if (this.checkCameraName === "") {
// this.handleInputWithIndex("changeCameraName", this.newCameraName);
this.axios.post('http://' + this.$address + '/api/setCameraNickname',
this.axios.post('http://' + this.$address + '/api/settings/camera/setNickname',
{name: this.newCameraName, cameraIndex: this.$store.getters.currentCameraIndex})
// eslint-disable-next-line
.then(r => {
this.$emit('camera-name-changed')
.then(response => {
this.$emit('camera-name-changed')
this.snackbar = {
color: "success",
text: response.data.text || response.data
}
this.snack = true;
})
.catch(e => {
console.log("HTTP error while changing camera name " + e);
this.$emit('camera-name-changed')
.catch(error => {
this.$emit('camera-name-changed')
if(error.response) {
this.snackbar = {
color: "error",
text: error.response.data.text || error.response.data
}
} else if(error.request) {
this.snackbar = {
color: "error",
text: "Error while trying to process the request! The backend didn't respond.",
};
} else {
this.snackbar = {
color: "error",
text: "An error occurred while trying to process the request.",
};
}
this.snack = true;
})
this.discardCameraNameChange();
}
Expand Down Expand Up @@ -387,7 +421,7 @@ export default {
if (this.isPipelineNameEdit) {
this.handleInputWithIndex("changePipelineName", this.newPipelineName);
} else {
this.handleInputWithIndex("addNewPipeline", [this.newPipelineName, this.currentPipelineType]); // 0 for reflective, 1 for colored shape
this.handleInputWithIndex("addNewPipeline", [this.newPipelineName, this._currentPipelineType]); // 0 for reflective, 1 for colored shape
}
this.discardPipelineNameChange();
}
Expand All @@ -404,7 +438,3 @@ export default {
}
</script>

<style scoped>
</style>
Loading

0 comments on commit a321fee

Please sign in to comment.