Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
681e355
Naming, viewMananger delegation, and guide tool paperLayer handling f…
MurrayLF Sep 18, 2021
1c71ac4
Format code with standardjs and prettier (#403)
deepsource-autofix[bot] Sep 28, 2021
a9aa7bc
Created new layout for GUIDE Tool and switched default loading
rkrishnasanka Sep 24, 2021
59a82e2
s
zyrrron Sep 22, 2021
3136d78
change for guide tool step1
zyrrron Sep 24, 2021
68756d1
new changes
zyrrron Sep 27, 2021
7e50ca4
step1 done
zyrrron Oct 5, 2021
1e1278d
step2 createing variables
zyrrron Oct 5, 2021
415c650
step2
zyrrron Oct 6, 2021
3e04102
Created new viewmanager for guide tool
zyrrron Oct 6, 2021
1c743af
create new classes
zyrrron Oct 6, 2021
2cc9541
add functions into new classes
zyrrron Oct 6, 2021
e509364
add some functions into step2, change some methods inside Devicestate…
zyrrron Oct 7, 2021
7c451f2
import function correctly
zyrrron Oct 7, 2021
4a546c2
use console.log to test
zyrrron Oct 7, 2021
eeb570d
took out duplicate import
zyrrron Oct 8, 2021
c428f8f
commmiting to apply stash
zyrrron Oct 8, 2021
4e03d57
new UI parts
zyrrron Oct 13, 2021
98fe6c8
UI change
zyrrron Oct 14, 2021
6ef1307
format changes
zyrrron Oct 14, 2021
9a0c56d
user can check all components or some types of them by clicking the b…
zyrrron Oct 19, 2021
c5be2c2
add property layer inside component
zyrrron Oct 20, 2021
686c68e
separately show components in different types
zyrrron Oct 20, 2021
ea93925
new button
zyrrron Oct 20, 2021
dfe55d0
Co-authored-by: Radhakrishna Sanka <[email protected]>
zyrrron Oct 20, 2021
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
6 changes: 3 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ module.exports = {
SharedArrayBuffer: 'readonly'
},

// Position is important, the last rules take precident here. For the least amount of prettier conficts with other eslint plugins.
// it has to come last
extends: ['eslint:recommended', 'plugin:vue/recommended', '@vue/typescript', 'prettier/vue'],
// Position is important, the last rules take precident here. For the least amount of prettier conficts with other eslint plugins.
// it has to come last
extends: ["eslint:recommended", "plugin:vue/recommended", "@vue/typescript"],

parserOptions: {
ecmaVersion: 2018,
Expand Down
7 changes: 7 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Attach to Chrome",
"port": 9222,
"request": "attach",
"type": "pwa-chrome",
"webRoot": "${workspaceFolder}"
},
{
"type": "chrome",
"request": "launch",
Expand Down
1,081 changes: 788 additions & 293 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"vue-select": "^3.13.0",
"vuetify": "^2.5.8",
"vuex": "^3.6.2",
"webpack-build": "^1.0.1",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why this got added to the dependencies, please revert this back to whats in webpack-build branch.

"wnumb": "^1.2.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<script>
import Visualiser from "./components/Visualiser.vue";
import LayoutSidebar from "./views/layouts/SplitLayout.vue";
import LayoutSidebar from "./views/layouts/GuideToolLayout.vue";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will need to create a router and make sure your app is navigable.

  • Add vue router
  • Add button on the design page

export default {
name: "App",
Expand Down
29 changes: 24 additions & 5 deletions src/app/core/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import { ConnectionInterchangeV1, Point } from "./init";
import ComponentUtils from "../utils/componentUtils";
import { ComponentAPI } from "@/componentAPI";
import MapUtils from "../utils/mapUtils";
import Layer from "./layer";
import Device from "./device";

/**
* This class contains the component abstraction used in the interchange format and the
Expand All @@ -28,6 +30,15 @@ export default class Component {
protected _componentPortTRenders: Map<string, Port>;
protected _xspan: number;
protected _yspan: number;
protected _layers: Array<Layer>;

get layers(){
return this._layers;
}

set layer(value:Array<Layer>){
this._layers = value;
}
/**
* Default Constructor
* @param {string} type
Expand All @@ -36,11 +47,12 @@ export default class Component {
* @param {string} mint
* @param {String} id
*/
constructor(params: Params, name: string, mint: string, id: string = Component.generateID()) {
constructor(params: Params, name: string, mint: string, layer:Array<Layer>, id: string = Component.generateID()) {
this._params = params;
this._name = name;
this._id = id;
this._entity = mint;
this._layers = layer;
// This stores the features that are a part of the component
this._featureIDs = [];
// TODO: Need to figure out how to effectively search through these
Expand Down Expand Up @@ -388,7 +400,7 @@ export default class Component {
const unique_map = MapUtils.toMap(definition.unique);
const heritable_map = MapUtils.toMap(definition.heritable);
const replicaparams = new Params(cleanparamdata, unique_map, heritable_map);
const ret = new Component(replicaparams, name, this._entity);
const ret = new Component(replicaparams, name, this._entity, this.layer);
console.log("Checking what the new component params are:", ret._params);
// Generate New features
for (const i in this._featureIDs) {
Expand Down Expand Up @@ -433,7 +445,7 @@ export default class Component {
* @returns {*}
* @memberof component
*/
static fromInterchangeV1(json: ComponentInterchangeV1): Component {
static fromInterchangeV1(json: ComponentInterchangeV1, device: Device): Component {
// let set;
// if (json.hasOwnProperty("set")) set = json.set;
// else set = "Basic";
Expand All @@ -448,7 +460,7 @@ export default class Component {
// It was originially this._span = this.span which threw several errors so I patterned in off the above const var
const xspan = json["x-span"];
const yspan = json["y-span"];

const params = json.params;

console.log("new entity:", entity);
Expand Down Expand Up @@ -496,7 +508,14 @@ export default class Component {
const unique_map = MapUtils.toMap(definition.unique);
const heritable_map = MapUtils.toMap(definition.heritable);
const paramstoadd = new Params(params, unique_map, heritable_map);
const component = new Component(paramstoadd, name, entity, id);
let layers: Array<Layer> =[]
for(let i in json.layers){
let layer = device.getLayer(json.layers[i]);
if (layer !== null){
layers.push(layer);
}
}
const component = new Component(paramstoadd, name, entity, layers, id);

// Deserialize the component ports
const portdata = new Map();
Expand Down
3 changes: 2 additions & 1 deletion src/app/core/device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,8 @@ export default class Device {
let componenttoadd;

for (let i in components) {
componenttoadd = Component.fromInterchangeV1(components[i]);
componenttoadd = Component.fromInterchangeV1(components[i],this);
console.log(components[i]);
this.__components.push(componenttoadd);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Registry {
currentTextLayer = null;
currentGrid: AdaptiveGrid | null = null;
view = null;
viewManager: ViewManager | null = null;
viewManager: null | ViewManager = null;
featureSet = null;
}

Expand Down
2 changes: 1 addition & 1 deletion src/app/examples/jsonExamples.js

Large diffs are not rendered by default.

15 changes: 12 additions & 3 deletions src/app/view/loadUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
ComponentPortInterchangeV1,
LogicalLayerType
} from "@/app/core/init";
import device from "@/app/core/device";

export default class LoadUtils {
constructor() {}
Expand Down Expand Up @@ -117,7 +118,7 @@ export default class LoadUtils {
//TODO: Use this to dynamically create enough layers to scroll through
//TODO: Use these to generate a rat's nest
for (const i in json.components) {
const newComponent = LoadUtils.loadComponentFromInterchangeV1(json.components[i]);
const newComponent = LoadUtils.loadComponentFromInterchangeV1(json.components[i], newDevice);
newDevice.addComponent(newComponent);
}

Expand Down Expand Up @@ -276,7 +277,7 @@ export default class LoadUtils {
* @returns {Component}
* @memberof LoadUtils
*/
static loadComponentFromInterchangeV1(json: ComponentInterchangeV1): Component {
static loadComponentFromInterchangeV1(json: ComponentInterchangeV1, device: Device): Component {
const iscustomcompnent = false;
const name = json.name;
const id = json.id;
Expand Down Expand Up @@ -334,7 +335,15 @@ export default class LoadUtils {
const unique_map = MapUtils.toMap(definition.unique);
const heritable_map = MapUtils.toMap(definition.heritable);
const paramstoadd = new Params(params, unique_map, heritable_map);
const component = new Component(paramstoadd, name, entity, id);

let layers: Array<Layer> =[]
for(let i in json.layers){
let layer = device.getLayer(json.layers[i]);
if (layer !== null){
layers.push(layer);
}
}
const component = new Component(paramstoadd, name, entity, layers, id);

// Deserialize the component ports
const portdata = new Map();
Expand Down
4 changes: 2 additions & 2 deletions src/app/view/viewManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -391,11 +391,11 @@ export default class ViewManager {
let groupNum = Registry.currentDevice.layers.length;
if (groupNum != 0) groupNum = groupNum / 3;

const newlayers = [];
let newlayers = [];
newlayers[0] = new Layer({ z_offset: 0, flip: false }, this.currentDevice.generateNewName("LayerFlow"), LogicalLayerType.FLOW, groupNum.toString());
newlayers[1] = new Layer({ z_offset: 0, flip: false }, this.currentDevice.generateNewName("LayerControl"), LogicalLayerType.CONTROL, groupNum.toString());
newlayers[2] = new Layer({ z_offset: 0, flip: false }, this.currentDevice.generateNewName("LayerIntegration"), LogicalLayerType.INTEGRATION, groupNum.toString());
// Add model layers to current device
//Add model layers to current device
Registry.currentDevice.createNewLayerBlock(newlayers);

Comment on lines +394 to 400
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can revert these changes, there's no use for them

// Find all the edge features
Expand Down
31 changes: 22 additions & 9 deletions src/components/ChangeAllDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,42 @@
</template>

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can revert all the changes in this file too

<v-card>
<v-card-title class="text-h5 lighten-2"> Change All Components: </v-card-title>
<v-card-title class="text-h5 lighten-2">
Change All Components:
</v-card-title>

<v-card-text> </v-card-text>
<v-card-text />
<table>
<tr>
<th class="font-weight-bold pl-10 pt-4 pb-2">
<input v-model="selectAll" type="checkbox" />
<span class="pl-1">Select</span>
</th>
<th class="font-weight-bold pl-15 pt-4 pb-2">Name</th>
<th class="font-weight-bold pl-15 pt-4 pb-2">
Name
</th>
</tr>
<tr v-for="comp in components" :key="comp.id">
<td class="pl-15 pb-2"><input v-model="selected" type="checkbox" :value="comp.id" /></td>
<td class="pl-15 pb-2">{{ comp.name }}</td>
<td class="pl-15 pb-2">
<input v-model="selected" type="checkbox" :value="comp.id" >
</td>

<td class="pl-15 pb-2">
{{ comp.name }}
</td>
</tr>
</table>

<v-divider></v-divider>
<v-divider />

<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="green" class="white--text" @click="onSave"> Change </v-btn>
<v-btn color="red" class="white--text ml-9" @click="dialog = false"> Cancel </v-btn>
<v-spacer />
<v-btn color="green" class="white--text" @click="onSave">
Change
</v-btn>
<v-btn color="red" class="white--text ml-9" @click="dialog = false">
Cancel
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
Expand Down
2 changes: 1 addition & 1 deletion src/components/ComponentContextMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<thead v-show="showRename">
<v-col>
<v-row align-start>
<v-text-field v-model="componentName" label="Name" type="input"> </v-text-field>
<v-text-field v-model="componentName" label="Name" type="input" />
<v-btn x-small depressed @click="cancelRename">
Comment on lines +7 to 8
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can revert these changes too

<span class="material-icons">close</span>
</v-btn>
Expand Down
2 changes: 1 addition & 1 deletion src/components/ConnectionContextMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<thead v-show="showRename">
<v-col>
<v-row align-start>
<v-text-field v-model="connectionName" label="Name" type="input"> </v-text-field>
<v-text-field v-model="connectionName" label="Name" type="input" />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can revert this

<v-btn x-small depressed @click="cancelRename">
<span class="material-icons">close</span>
</v-btn>
Expand Down
22 changes: 13 additions & 9 deletions src/components/ConnectionPropertyDrawer.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<template>
<div class="property-drawer-parent">
<v-btn ref="activator" :class="buttonClasses" @click="showProperties()">Connection </v-btn>
<v-btn ref="activator" :class="buttonClasses" @click="showProperties()">
Connection
</v-btn>
<div ref="drawer" class="connection-property-drawer">
<v-card v-if="activated">
<v-card-text>
Expand All @@ -18,7 +20,7 @@
</v-row>
</v-card-text>
</v-col>
<v-divider vertical inset></v-divider>
<v-divider vertical inset />
<v-col>
<v-card-text>
<v-row>
Expand Down Expand Up @@ -69,31 +71,33 @@
<v-row no-gutters>
Source:
<v-col v-for="source in sources" :key="source.name" cols="4">
<v-chip v-if="chip1" small close color="green" text-color="white" closable @click:close="chip1 = false">{{
source.name
}}</v-chip>
<v-chip v-if="chip1" small close color="green" text-color="white" closable @click:close="chip1 = false">
{{ source.name }}
</v-chip>
</v-col>
</v-row>
<v-row no-gutters>
Sinks:
</v-row>
<v-row no-gutters>
<v-col v-for="sink in sinks" :key="sink.name" cols="4">
<v-chip v-if="chip2" small close color="green" text-color="white" @click:close="chip2 = false">{{ sink.name }}</v-chip>
<v-chip v-if="chip2" small close color="green" text-color="white" @click:close="chip2 = false">
{{ sink.name }}
</v-chip>
</v-col>
</v-row>
</v-card-text>
</v-col>
<v-divider vertical inset></v-divider>
<v-divider vertical inset />
<v-col cols="3">
<v-row no-gutters>
Connection Profile
</v-row>
<v-row no-gutters>
<v-select v-model="selectedProfile" :items="connectionProfiles"></v-select>
<v-select v-model="selectedProfile" :items="connectionProfiles" />
</v-row>
<v-row>
<v-img max-height="150" max-width="150" src="@/assets/technology/CHANNEL.png" class="image-placeholder"></v-img>
<v-img max-height="150" max-width="150" src="@/assets/technology/CHANNEL.png" class="image-placeholder" />
</v-row>
</v-col>
</v-row>
Expand Down
12 changes: 9 additions & 3 deletions src/components/DOEDialog.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<template>
<dialog id="doe_dialog" class="mdl-dialog">
<div class="mdl-card__title">
<h2 class="mdl-card__title-text">Generate Design of Experiments for a Single Component</h2>
<h2 class="mdl-card__title-text">
Generate Design of Experiments for a Single Component
</h2>
</div>
<div class="mdl-dialog__content">
<input id="doe_input" type="file" class="upload" />
Expand All @@ -15,8 +17,12 @@
<!--</form>-->
<br />
<div class="mdl-dialog__actions mdl-dialog__actions--full-width">
<button id="download-doe-button" type="button" class="mdl-button">Download Designs</button>
<button type="button" class="mdl-button close">Cancel</button>
<button id="download-doe-button" type="button" class="mdl-button">
Download Designs
</button>
<button type="button" class="mdl-button close">
Cancel
</button>
</div>
</dialog>
</template>
Expand Down
14 changes: 10 additions & 4 deletions src/components/EditBorderDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,21 @@
<template #content>
<h4>Drag Drop the DXF Border File:</h4>
<div class="mdl-dialog__content">
<v-card id="border_import_panel" class="mx-auto" tile outlined width="400" color="grey lighten-2" height="200"> </v-card>
<v-card id="border_import_panel" class="mx-auto" tile outlined width="400" color="grey lighten-2" height="200" />
<br />
<input id="file_input" ref="file" type="file" class="upload" @change="addFile()" />
</div>
</template>
<template v-slot:actions="{ callbacks }">
<v-btn dark color="green dark" @click="importBorderButton()"> Import Border </v-btn>
<v-btn dark color="red dark" @click="deleteBorderButton()"> Delete Border </v-btn>
<v-btn color="white" @click="callbacks.close(onSave)"> Okay </v-btn>
<v-btn dark color="green dark" @click="importBorderButton()">
Import Border
</v-btn>
<v-btn dark color="red dark" @click="deleteBorderButton()">
Delete Border
</v-btn>
<v-btn color="white" @click="callbacks.close(onSave)">
Okay
</v-btn>
</template>
</Dialog>
</template>
Expand Down
Loading