Skip to content

Commit

Permalink
fix build error
Browse files Browse the repository at this point in the history
  • Loading branch information
AmyangXYZ committed Dec 30, 2023
1 parent 4722373 commit 366080c
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 27 deletions.
3 changes: 1 addition & 2 deletions src/components/FlowsPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
import { ref, watch, nextTick } from 'vue'
import { Network } from '@/hooks/useStates'
const columns: any = [
{
key: 'flow_id',
title: 'Flow ID',
title: 'ID',
dataKey: 'flow_id',
width: 60,
align: 'center',
Expand Down
4 changes: 2 additions & 2 deletions src/components/NodeStats.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import { Network, SelectedNode } from '@/hooks/useStates'
- {{ SelectedNode == 1 ? 'Raspberry Pi 4B' : 'CC2650 SensorTag' }} <br />
- TX: {{ Network.Nodes.value[SelectedNode].tx_cnt }} , RX:
{{ Network.Nodes.value[SelectedNode].rx_cnt }}<br />
- Queue length: {{ Network.Nodes.value[SelectedNode].queueLen }}<br />
- Rank in topology: {{ Network.Nodes.value[SelectedNode].rank }}
<!-- - Queue length: {{ (Network.Nodes.value[SelectedNode].queueLen }}<br />
- Rank in topology: {{ Network.Nodes.value[SelectedNode].rank }} -->
</el-col>
</el-row>
</el-card>
Expand Down
2 changes: 1 addition & 1 deletion src/components/PacketSniffer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,4 @@ Row.inheritAttrs = false
width: 100%;
text-align: center;
}
</style>
</style>
24 changes: 8 additions & 16 deletions src/hooks/useDrawMiniMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import * as echarts from 'echarts'

import { Network } from './useStates'
import { MiniMapMode } from './useStates'
import { LINK_TYPE } from '@/networks/common'
import { LINK_TYPE, NETWORK_TYPE } from '@/networks/common'
import type { TSCHNodeMeta } from '@/networks/TSCH/typedefs'
export function useDrawMiniMap(chartDom: HTMLElement) {
const chart = echarts.init(chartDom, { useDirtyRect: true })

Expand Down Expand Up @@ -110,17 +111,8 @@ export function useDrawMiniMap(chartDom: HTMLElement) {
for (const l of Object.values(Network.Links.value)) {
if (drawnLinks[l.uid] == undefined) {
drawnLinks[l.uid] = true
let coord1: [number, number], coord2: [number, number]
if (l.v1 <= Network.TopoConfig.value.num_nodes) {
coord1 = Network.Nodes.value[l.v1].pos
} else {
coord1 = Network.EndSystems.value[l.v1 - Network.TopoConfig.value.num_nodes - 1].pos
}
if (l.v2 <= Network.TopoConfig.value.num_nodes) {
coord2 = Network.Nodes.value[l.v2].pos
} else {
coord2 = Network.EndSystems.value[l.v2 - Network.TopoConfig.value.num_nodes - 1].pos
}
const coord1 = Network.Nodes.value[l.v1].pos
const coord2 = Network.Nodes.value[l.v2].pos

option.series[0].markLine.data.push([
{
Expand All @@ -142,13 +134,13 @@ export function useDrawMiniMap(chartDom: HTMLElement) {
}
function drawMinimapTree() {
for (const n of Network.Nodes.value) {
if (n.joined && n.parent != 0) {
if (n.type==NETWORK_TYPE.TSCH && (<TSCHNodeMeta>n).joined && (<TSCHNodeMeta>n).parent != 0) {
if (treeNodes[n.id] == undefined) {
treeNodes[n.id] = { name: n.id, children: [] }
if (treeNodes[n.parent] != undefined) {
treeNodes[n.parent].children.push(treeNodes[n.id])
if (treeNodes[(<TSCHNodeMeta>n).parent] != undefined) {
treeNodes[(<TSCHNodeMeta>n).parent].children.push(treeNodes[n.id])
} else {
treeNodes[n.parent] = { name: n.id, children: [treeNodes[n.id]] }
treeNodes[(<TSCHNodeMeta>n).parent] = { name: n.id, children: [treeNodes[n.id]] }
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useDrawTopology.ts
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ export function useDrawTopology(dom: HTMLElement) {
1.6,
Network.Nodes.value[l.v2].pos[1]
)

const x2 = (p1.x + p3.x) / 2
const z2 = (p1.z + p3.z) / 2
const h = 5
Expand Down
2 changes: 1 addition & 1 deletion src/networks/5G/network.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ref } from 'vue'
import { LINK_TYPE, NETWORK_TYPE, NODE_TYPE } from '../common'
import { LINK_TYPE, NETWORK_TYPE, NODE_TYPE } from '../common'
import type { ScheduleConfig, FiveGNodeMeta } from './typedefs'
import { KDNode } from '../kdtree'
import { Network } from '../network'
Expand Down
10 changes: 8 additions & 2 deletions src/networks/TSCH/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ class TSCHNode {
}

respondAck(pkt: Packet) {
if (pkt.mac_dst != ADDR.BROADCAST && pkt.mac_src != ADDR.CONTROLLER && pkt.type != TSCH_PKT_TYPE.ACK) {
if (
pkt.mac_dst != ADDR.BROADCAST &&
pkt.mac_src != ADDR.CONTROLLER &&
pkt.type != TSCH_PKT_TYPE.ACK
) {
const ack: Packet = { ...pkt }
ack.type = TSCH_PKT_TYPE.ACK
ack.mac_src = this.id
Expand Down Expand Up @@ -138,7 +142,9 @@ class TSCHNode {
for (const cell of this.schedule[slot]) {
if (
cell != undefined &&
(cell.mac_src == pkt.mac_src || pkt.mac_dst == ADDR.BROADCAST || cell.type == CELL_TYPES.SHARED)
(cell.mac_src == pkt.mac_src ||
pkt.mac_dst == ADDR.BROADCAST ||
cell.type == CELL_TYPES.SHARED)
) {
this.rx_cnt++
return true
Expand Down
2 changes: 1 addition & 1 deletion src/networks/TSN/network.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ref, toRaw } from 'vue'
import { NETWORK_TYPE, NODE_TYPE, type Message, LINK_TYPE, MSG_TYPE } from '../common'
import { NETWORK_TYPE, NODE_TYPE, type Message, LINK_TYPE, MSG_TYPE } from '../common'
import { type ScheduleConfig, type TSNNodeMeta, type TSN_INIT_MSG_PAYLOAD } from './typedefs'
import { KDNode } from '../kdtree'
import { Network } from '../network'
Expand Down
1 change: 0 additions & 1 deletion src/networks/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export enum LINK_TYPE {
WIRELESS
}


export interface FlowMeta {
id: number
src: number
Expand Down

0 comments on commit 366080c

Please sign in to comment.