Skip to content

Commit

Permalink
refactor: unwanted logs and warnings removed from console (CircuitVer…
Browse files Browse the repository at this point in the history
…se#287)

* console logs removed

* fix: removed one transition warning

* removed unused code
  • Loading branch information
niladrix719 authored Mar 18, 2024
1 parent 68b7608 commit 594cb5b
Show file tree
Hide file tree
Showing 23 changed files with 1 addition and 85 deletions.
1 change: 0 additions & 1 deletion src/components/ContextMenu/ContextMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ export default {
menuItemClicked(event) {
this.hideContextMenu()
const id = event.target.dataset.index
console.log('Hello From Context Menu' + id)
if (id == 0) {
document.execCommand('copy')
} else if (id == 1) {
Expand Down
2 changes: 0 additions & 2 deletions src/components/DialogBox/BooleanTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,4 @@ const props = defineProps({
tableHeader: { type: Array, default: () => [] },
tableBody: { type: Array, default: () => [] },
})
console.log(props.tableHeader)
console.log(props.tableBody)
</script>
24 changes: 0 additions & 24 deletions src/components/DialogBox/CombinationalAnalysis.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,11 @@ function clearData() {
function dialogBoxConformation(selectedOption, circuitItem) {
// SimulatorState.dialogBox.combinationalanalysis_dialog = false
console.log(inputArr.value)
console.log(selectedOption)
// use the above value to show tables and later clear it all
if (selectedOption == 'showLogicTable') {
createLogicTable()
}
if (selectedOption == 'closeMessageBox') {
// console.log('Circuit was not closed')
for (var ind = 0; ind < inputArr.value.length; ind++) {
if (inputArr.value[ind].type == 'text') {
inputArr.value[ind].val = ''
Expand All @@ -150,14 +147,12 @@ function dialogBoxConformation(selectedOption, circuitItem) {
SimulatorState.dialogBox.combinationalanalysis_dialog = false
}
if (selectedOption == 'generateCircuit') {
console.log('Generate Cirucit')
SimulatorState.dialogBox.combinationalanalysis_dialog = false
generateCircuit()
clearData()
SimulatorState.dialogBox.combinationalanalysis_dialog = false
}
if (selectedOption == 'printTruthTable') {
console.log('Print Truth Table')
printBooleanTable()
clearData()
SimulatorState.dialogBox.combinationalanalysis_dialog = false
Expand All @@ -175,9 +170,6 @@ function createLogicTable() {
outputList = outputList.filter((e) => e)
booleanExpression = booleanExpression.replace(/ /g, '')
booleanExpression = booleanExpression.toUpperCase()
console.log(inputList)
console.log(outputList)
console.log(booleanExpression)
var booleanInputVariables = []
for (var i = 0; i < booleanExpression.length; i++) {
Expand All @@ -189,10 +181,6 @@ function createLogicTable() {
}
booleanInputVariables.sort()
console.log(inputList)
console.log(outputList)
console.log(booleanExpression)
if (
inputList.length > 0 &&
outputList.length > 0 &&
Expand Down Expand Up @@ -260,11 +248,9 @@ function createBooleanPrompt(inputList, outputList, scope = globalScope) {
}
if (output.value == null) {
for (var i = 0; i < outputListNames.value.length; i++) {
console.log(outputListNames.value[i])
tableHeader.value.push(outputListNames.value[i])
}
} else {
console.log(outputListNames.value)
tableHeader.value.push(outputListNames.value)
}
Expand Down Expand Up @@ -295,8 +281,6 @@ function createBooleanPrompt(inputList, outputList, scope = globalScope) {
output.value[j]
}
}
console.log(tableHeader.value)
console.log(tableBody.value)
// display Message Box
SimulatorState.dialogBox.combinationalanalysis_dialog = true
buttonArr.value = [
Expand Down Expand Up @@ -333,7 +317,6 @@ function drawCombinationalAnalysis(
outputList,
scope = globalScope
) {
console.log('inside draw CA')
findDimensions(scope)
var inputCount = inputList.length
var maxTerms = 0
Expand Down Expand Up @@ -641,12 +624,10 @@ function solveBooleanFunction(inputListNames, booleanExpression) {
return ''
}
}
console.log(output.value)
}
function generateCircuit() {
var data = generateBooleanTableData(outputListNamesInteger.value)
console.log(data)
var minimizedCircuit = []
let inputCount = inputListNames.value.length
for (const output in data) {
Expand All @@ -668,7 +649,6 @@ function generateCircuit() {
minimizedCircuit.push(temp.result)
}
}
console.log(output.value)
if (output.value == null) {
drawCombinationalAnalysis(
minimizedCircuit,
Expand All @@ -677,7 +657,6 @@ function generateCircuit() {
globalScope
)
} else {
console.log('HI')
drawCombinationalAnalysis(
minimizedCircuit,
inputListNames.value,
Expand All @@ -688,10 +667,7 @@ function generateCircuit() {
}
function printBooleanTable() {
console.log($('.messageBox .v-card-text')[0])
var sTable = $('.messageBox .v-card-text')[0].innerHTML
console.log('This is the table')
console.log(sTable)
var style =
`<style>
Expand Down
2 changes: 0 additions & 2 deletions src/components/DialogBox/CustomShortcut.vue
Original file line number Diff line number Diff line change
Expand Up @@ -222,13 +222,11 @@ function updateEdit(e: KeyboardEvent) {
}
async function resetKeybinding() {
console.log('Reset Keybinding')
if (await confirmOption('Remove all custom keys & set the default keys?'))
setDefault()
}
function saveKeybinding() {
console.log('Save Keybinding')
submit()
SimulatorState.dialogBox.customshortcut_dialog = false
}
Expand Down
1 change: 0 additions & 1 deletion src/components/DialogBox/ImportProject.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ function addDropFile(e: DragEvent) {
const fileExtension = droppedFile.name.split('.').pop()
if (fileExtension === 'cv') {
console.log('file dropped')
file.value[0] = droppedFile
document
.querySelector('.fileInput')
Expand Down
10 changes: 0 additions & 10 deletions src/components/DialogBox/OpenOffline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,24 +72,14 @@ onMounted(() => {
})
onUpdated(() => {
console.log('on updated')
var data = localStorage.getItem('projectList')
console.log(data)
projectList.value = JSON.parse(localStorage.getItem('projectList')) || {}
console.log(toRaw(projectList.value))
if (JSON.stringify(projectList.value) == '{}') {
console.log('true')
} else {
console.log('false')
}
})
function deleteOfflineProject(id) {
console.log('Hello from ok')
localStorage.removeItem(id)
const temp = JSON.parse(localStorage.getItem('projectList')) || {}
delete temp[id]
console.log(temp)
projectList.value = temp
localStorage.setItem('projectList', JSON.stringify(temp))
}
Expand Down
10 changes: 0 additions & 10 deletions src/components/DialogBox/Themes/ApplyThemes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,11 @@ onMounted(() => {
selectedTheme.value = localStorage.getItem('theme')
themes.value = Object.keys(themeOptions)
themes.value.splice(-1, 1)
console.log(themes.value)
customThemesList.value = CreateAbstraction(themeOptions['Custom Theme'])
customThemes.value = Object.keys(customThemesList.value)
console.log(customThemesList.value)
console.log(customThemes.value)
})
function changeTheme(e) {
console.log(e)
e.preventDefault()
$('.selected').removeClass('selected')
let themeCard = $(e.target.parentElement)
Expand All @@ -186,8 +182,6 @@ function changeTheme(e) {
}
function changeCustomTheme(e) {
console.log('update custom theme')
console.log(e)
customThemesList.value[e.target.name].color = e.target.value
customThemesList.value[e.target.name].ref.forEach((property) => {
themeOptions['Custom Theme'][property] = e.target.value
Expand All @@ -197,7 +191,6 @@ function changeCustomTheme(e) {
}
function applyTheme() {
console.log('Apply Theme')
if (iscustomTheme.value == false) {
if ($('.selected label').text()) {
localStorage.removeItem('Custom Theme')
Expand All @@ -219,7 +212,6 @@ function applyTheme() {
}
function applyCustomTheme() {
iscustomTheme.value = true
console.log('Apply Custom Theme')
updateThemeForStyle(localStorage.getItem('theme'))
updateBG()
localStorage.setItem('theme', 'Custom Theme')
Expand Down Expand Up @@ -250,7 +242,6 @@ function receivedText(e) {
}
function importCustomTheme() {
console.log('Import Custom Theme')
$('#importThemeFile').click()
$('#importThemeFile').on('change', (event) => {
Expand All @@ -267,7 +258,6 @@ function importCustomTheme() {
})
}
function exportCustomTheme() {
console.log('Export Custom Theme')
const dlAnchorElem = document.getElementById('downloadThemeFile')
dlAnchorElem.setAttribute(
'href',
Expand Down
2 changes: 0 additions & 2 deletions src/components/Dropdown/DropDown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,5 @@ const props = defineProps({
dropDownHeader: { type: String, default: '' },
dropDownType: { type: String, default: '' },
})
console.log(props.dropDownHeader)
console.log(props.listItems)
const userId = useAuthStore().getUserId
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ type SimulatorStateType = {
// () => {
// circuitName.value = SimulatorState.activeCircuit.name
// circuitId.value = SimulatorState.activeCircuit.id
// console.log(circuitName.value, circuitId.value)
// },
// { deep: true }
// )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ const plotRef = ref<HTMLElement | null>(null)
const cycleUnits = ref(1000)
function handleButtonClick(button: string) {
console.log('clicked', button)
if (button === 'smaller') {
if (plotRef.value) {
plotRef.value.style.width = `${Math.max(
Expand Down
1 change: 1 addition & 0 deletions src/components/TabsBar/TabsBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
>
<draggable
:key="updateCount"
:item-key="updateCount.toString()"
v-model="SimulatorState.circuit_list"
class="list-group"
tag="transition-group"
Expand Down
2 changes: 0 additions & 2 deletions src/pages/embed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -226,14 +226,12 @@ watch(clockEnabled, (val) => {
onBeforeMount(() => {
window.embed = true
window.logixProjectId = route.params.projectId
console.log(window.logixProjectId)
})
onMounted(() => {
// $('#zoom-in-embed').on('click', () => ZoomIn())
// $('#zoom-out-embed').on('click', () => ZoomOut())
console.log('embed setup')
startListeners()
setup()
})
Expand Down
6 changes: 0 additions & 6 deletions src/pages/simulatorHandler.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,8 @@ async function checkEditAccess() {
// if user has edit access load circuit data
if (res.ok) {
res.json().then((data) => {
console.log('all good to go')
authStore.setUserInfo(data.data)
;(window as any).isUserLoggedIn = true
console.log(
authStore.getIsLoggedIn,
authStore.getUsername,
authStore.getUserId
)
isLoading.value = false
})
} else if (res.status === 403) {
Expand Down
1 change: 0 additions & 1 deletion src/simulator/src/combinationalAnalysis.js
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,5 @@ export function createCombinationalAnalysisPrompt(scope = globalScope) {
// }
// }

// console.log(output)
// return output
// }
1 change: 0 additions & 1 deletion src/simulator/src/hotkey_binder/keyBinder.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
// export function keyBinder() {
// const simulatorStore = SimulatorStore()
// simulatorStore.dialogBox.customshortcut_dialog = true
// console.log(simulatorStore.dialogBox.customshortcut_dialog)
// $('#customShortcutDialog').append(editPanel)
// $('#customShortcutDialog').append(heading)
// $('#customShortcutDialog').append(markUp)
Expand Down
3 changes: 0 additions & 3 deletions src/simulator/src/modules/Splitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ export default class Splitter extends CircuitElement {
simulationArea.simulationQueue.add(this.inp1)
}
// else if (this.inp1.value !== n) {
// console.log("CONTENTION");
// }
}
this.prevInpValue = this.inp1.value
Expand All @@ -190,7 +189,6 @@ export default class Splitter extends CircuitElement {
* @return {JSON}
*/
processVerilog() {
// console.log(this.inp1.verilogLabel +":"+ this.outputs[0].verilogLabel);
if (
this.inp1.verilogLabel !== '' &&
this.outputs[0].verilogLabel === ''
Expand Down Expand Up @@ -218,7 +216,6 @@ export default class Splitter extends CircuitElement {
const label = `{${this.outputs
.map((x) => x.verilogLabel)
.join(',')}}`
// console.log("HIT",label)
if (this.inp1.verilogLabel !== label) {
this.inp1.verilogLabel = label
this.scope.stack.push(this.inp1)
Expand Down
2 changes: 0 additions & 2 deletions src/simulator/src/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import { getToken } from '#/pages/simulatorHandler.vue'
* @category setup
*/
export function resetup() {
console.log('hello from re setup')
DPR = window.devicePixelRatio || 1
if (lightMode) {
DPR = 1
Expand Down Expand Up @@ -105,7 +104,6 @@ function setupEnvironment() {
* @category setup
*/
function setupElementLists() {
// console.log('hello from elements list panel setup')
// $('#menu').empty()

window.circuitElementList = metadata.circuitElementList
Expand Down
2 changes: 0 additions & 2 deletions src/simulator/src/subcircuit.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export function loadSubCircuit(savedData, scope) {
* @category subcircuit
*/
export function createSubCircuitPrompt(scope = globalScope) {
console.log('Hello')
if (verilogModeGet() || layoutModeGet()) {
showError('Subcircuit cannot be inserted in this mode')
return
Expand Down Expand Up @@ -689,7 +688,6 @@ export default class SubCircuit extends CircuitElement {
)
}
} else {
console.log('Unknown Version: ', this.version)
}

for (var i = 0; i < subcircuitScope.Input.length; i++) {
Expand Down
1 change: 0 additions & 1 deletion src/simulator/src/testbench.js
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,6 @@ export function runAll(data, scope = globalScope) {
const results = {}
results.detailed = data
results.summary = { passed: passedCases, total: totalCases }
// console.log(JSON.stringify(results.detailed));
return results
}

Expand Down
2 changes: 0 additions & 2 deletions src/simulator/src/themer/customThemer.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
// // downloadAnchor.setAttribute('id', 'downloadThemeFile')
// // downloadAnchor.setAttribute('style', 'display:none')
// // propertiesContainer.appendChild(downloadAnchor)
// // console.log(propertiesContainer)
// // return propertiesContainer
// // }

Expand All @@ -46,7 +45,6 @@
// */
// // export const CustomColorThemes = () => {
// // $('#CustomColorThemesDialog').empty()
// // console.log(getCustomThemeCard())
// // $('#CustomColorThemesDialog').append(getCustomThemeCard())
// // $('#CustomColorThemesDialog').dialog({
// // resizable: false,
Expand Down
Loading

0 comments on commit 594cb5b

Please sign in to comment.