Skip to content

Commit

Permalink
Update CameraAndPipelineSelect.vue
Browse files Browse the repository at this point in the history
  • Loading branch information
srimanachanta committed Jun 26, 2023
1 parent 83b5231 commit 96501e7
Showing 1 changed file with 0 additions and 141 deletions.
141 changes: 0 additions & 141 deletions photon-client/src/components/pipeline/CameraAndPipelineSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,26 +106,6 @@
/>
</v-list-item-title>
</v-list-item>
<v-list-item @click="() => showPipeImportDialog = true">
<v-list-item-title>
<CVicon
color="#c5c5c5"
:right="true"
text="mdi-import"
tooltip="Import Pipeline Settings from File"
/>
</v-list-item-title>
</v-list-item>
<v-list-item @click="exportPipelineToJson">
<v-list-item-title>
<CVicon
color="#c5c5c5"
:right="true"
text="mdi-export"
tooltip="Export Pipeline Settings to File"
/>
</v-list-item-title>
</v-list-item>
</v-list>
</v-menu>
</v-col>
Expand Down Expand Up @@ -228,85 +208,6 @@
</v-card-text>
</v-card>
</v-dialog>
<v-dialog
v-model="showPipeImportDialog"
width="600"
>
<v-card
color="primary"
dark
>
<v-card-title>Import Pipeline Settings</v-card-title>
<v-card-text>
Import a previously exported PhotonVision pipeline to this device.
<v-row>
<v-col cols="10">
<v-file-input
color="secondary"
accept=".json"
:error-messages="checkImportedPipelineFile"
@change="handlePipelineImportFile"
>
Select File
</v-file-input>
</v-col>
<v-col>
<v-icon
v-if="pipelineImportData === undefined"
color="red"
size="70"
>
mdi-close
</v-icon>
<v-icon
v-else
color="green"
size="70"
>
mdi-check-bold
</v-icon>
</v-col>
</v-row>
<div
v-if="pipelineImportData !== undefined && pipelineImportData !== null"
>
<hr>
<v-row class="ma-6">
<CVinput
v-model="importedPipelineName"
name="Pipeline Name"
:label-cols="4"
:input-cols="8"
:error-message="_checkPipelineName(importedPipelineName)"
/>
</v-row>
<v-row
class="mt-6"
style="display: flex; align-items: center; justify-content: center"
align="center"
>
<v-btn
class="mr-3"
color="red"
width="250"
:disabled="_checkPipelineName(importedPipelineName) !== ''"
@click="createPipelineFromImportedFile"
>
Import Pipeline
</v-btn>
<v-btn
class="ml-10"
color="secondary"
width="250"
@click="cancelPipelineImport"
>
No, take me back
</v-btn>
</v-row>
</div>
</v-card-text>
</v-card>
</v-dialog>
</div>
</template>

Expand Down Expand Up @@ -382,15 +283,6 @@ export default {
set(value) {
value; // nop, since we have the dialog for this
}
},
checkImportedPipelineFile() {
if(this.pipelineImportData === undefined) {
return "No File Uploaded"
} else if(this.pipelineImportData === null) {
return "Corrupt or Malformed JSON File"
} else {
return ""
}
}
},
methods: {
Expand Down Expand Up @@ -476,26 +368,6 @@ export default {
this.discardPipelineNameChange();
}
},
handlePipelineImportFile(event) {
// TODO, parse required info. null if malformed, else data
event;
this.pipelineImportData = {}
},
_checkPipelineName(name) {
const pipelineNameChangeRegex = RegExp("^[A-Za-z0-9_ \\-)(]*[A-Za-z0-9][A-Za-z0-9_ \\-)(.]*$")
if (pipelineNameChangeRegex.test(name)) {
for (let pipe in this.$store.getters.pipelineList) {
if (this.$store.getters.pipelineList.hasOwnProperty(pipe)) {
if (name === this.$store.getters.pipelineList[pipe]) {
return "A pipeline with this name already exists"
}
}
}
} else {
return "A pipeline name can only contain letters, numbers, and spaces"
}
return ""
},
duplicatePipeline() {
this.handleInputWithIndex("duplicatePipeline", this.currentPipelineIndex);
},
Expand All @@ -504,19 +376,6 @@ export default {
this.isPipelineNameEdit = false;
this.newPipelineName = "";
},
exportPipelineToJson() {
// TODO determine what data needs to be exported, and export it to JSON
},
createPipelineFromImportedFile() {
// this.pipelineImportData
// this.importedPipelineName
// TODO, create a new pipeline using the data, rename it using the name, then select it or whatever order the backend wants
},
cancelPipelineImport() {
this.showPipeImportDialog = false;
this.pipelineImportData = undefined;
this.importedPipelineName = ""
}
}
}
</script>

0 comments on commit 96501e7

Please sign in to comment.