Skip to content

Commit

Permalink
Merge pull request #10 from AmyangXYZ/united
Browse files Browse the repository at this point in the history
Change to a united network with different protocols
  • Loading branch information
AmyangXYZ authored Dec 31, 2023
2 parents 4b3ea98 + f88e63d commit 012f546
Show file tree
Hide file tree
Showing 35 changed files with 1,116 additions and 2,315 deletions.
5 changes: 2 additions & 3 deletions src/components/ChannelChart.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<script setup lang="ts">
import { ref, onMounted } from 'vue'
import { useDrawChannels } from '@/hooks/useDrawChannels'
// import { useDrawChannels } from '@/hooks/useDrawChannels'
const chartDom = ref()
onMounted(() => {
useDrawChannels(chartDom.value)
// useDrawChannels(chartDom.value)
})
</script>

Expand All @@ -19,4 +19,3 @@ onMounted(() => {
margin-top: 5px;
}
</style>
@/hooks/useDrawChannels
27 changes: 13 additions & 14 deletions src/components/MenuBar.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<script setup lang="ts">
import {
SignalShowScenarios,
SignalShowSettings,
SignalShowSchedule,
SignalShowStatistics,
SignalEditTopology
SignalEditTopology,
SignalResetCamera
} from '@/hooks/useStates'
import { Setting, DataAnalysis, Edit } from '@element-plus/icons-vue'
import { Setting, DataAnalysis, Edit, Camera } from '@element-plus/icons-vue'
import IconCube from './icons/IconCube.vue'
import IconClapperboard from './icons/IconClapperboard.vue'
onKeyStroke('Escape', () => {
SignalShowSettings.value = !SignalShowSettings.value
Expand All @@ -23,7 +22,7 @@ onKeyStroke('`', () => {

<template>
<div>
<el-row justify="center" :gutter="30">
<el-row justify="start" :gutter="30">
<el-col :span="4">
<a href="https://github.com/AmyangXYZ/VeRNet">
<el-button class="btn" size="small">
Expand All @@ -33,15 +32,6 @@ onKeyStroke('`', () => {
</el-button>
</a>
</el-col>
<el-col :span="4">
<el-tooltip effect="light" content="Scenarios" :hide-after="0" placement="right-start">
<el-button class="btn" size="small" @click="SignalShowScenarios = !SignalShowScenarios">
<el-icon color="#aaa" size="18">
<IconClapperboard />
</el-icon>
</el-button>
</el-tooltip>
</el-col>
<el-col :span="4">
<el-tooltip
effect="light"
Expand Down Expand Up @@ -88,6 +78,15 @@ onKeyStroke('`', () => {
</el-button>
</el-tooltip>
</el-col>
<el-col :span="4">
<el-tooltip effect="light" content="Reset camera" :hide-after="0" placement="right-start">
<el-button class="btn" size="small" @click="SignalResetCamera++">
<el-icon color="#aaa" size="20">
<Camera />
</el-icon>
</el-button>
</el-tooltip>
</el-col>
</el-row>
</div>
</template>
Expand Down
41 changes: 3 additions & 38 deletions src/components/MiniMap.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
<script setup lang="ts">
import { useDrawMiniMap } from '@/hooks/useDrawMiniMap'
import { ref, onMounted } from 'vue'
import { MiniMapMode, SignalResetCamera } from '../hooks/useStates'
import IconTree from './icons/IconTree.vue'
import IconScatter from './icons/IconScatter.vue'
import { Camera } from '@element-plus/icons-vue'
const chartDom = ref()
onMounted(() => {
Expand All @@ -14,39 +9,9 @@ onMounted(() => {
</script>

<template>
<el-row align="bottom" :gutter="8">
<el-col :span="20">
<el-card class="card">
<div class="chart" ref="chartDom"></div>
</el-card>
</el-col>
<el-col :span="4">
<el-row>
<el-tooltip effect="light" content="Reset camera" :hide-after="0" placement="top-start">
<el-button class="btn" size="small" circle @click="SignalResetCamera++">
<el-icon color="lightgrey" size="16">
<Camera />
</el-icon>
</el-button>
</el-tooltip>
</el-row>
<el-row>
<el-tooltip effect="light" content="Switch minimap" :hide-after="0" placement="right-start">
<el-button
class="btn"
size="small"
circle
@click="MiniMapMode = MiniMapMode == 'scatter' ? 'tree' : 'scatter'"
>
<el-icon color="lightgrey" size="16">
<IconTree v-if="MiniMapMode == 'scatter'" />
<IconScatter v-else />
</el-icon>
</el-button>
</el-tooltip>
</el-row>
</el-col>
</el-row>
<el-card class="card">
<div class="chart" ref="chartDom"></div>
</el-card>
</template>

<style scoped>
Expand Down
21 changes: 8 additions & 13 deletions src/components/PacketSniffer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ import ChannelChart from '@/components/ChannelChart.vue'
import { ref, watch, nextTick } from 'vue'
import { Network } from '@/hooks/useStates'
import { NETWORK_TYPE, type Packet } from '@/networks/common'
import { TSCH_PKT_TYPE } from '@/networks/TSCH/typedefs'
import { TSN_PKT_TYPE } from '@/networks/TSN/typedefs'
import { FIVE_G_PKT_TYPE } from '@/networks/5G/typedefs'
import { type Packet } from '@/core/typedefs'
import { Filter } from '@element-plus/icons-vue'
Expand Down Expand Up @@ -41,16 +38,16 @@ const columns: any = [
align: 'center'
},
{
key: 'src',
key: 'mac_src',
title: 'SRC',
dataKey: 'src',
dataKey: 'mac_src',
width: 30,
align: 'center'
},
{
key: 'dst',
key: 'mac_dst',
title: 'DST',
dataKey: 'dst',
dataKey: 'mac_dst',
width: 30,
align: 'center'
},
Expand All @@ -69,9 +66,7 @@ const columns: any = [
width: 80,
align: 'center',
cellRenderer: ({ cellData: type }: any) => {
if (Network.Type == NETWORK_TYPE.TSCH) return TSCH_PKT_TYPE[type]
if (Network.Type == NETWORK_TYPE.TSN) return TSN_PKT_TYPE[type]
if (Network.Type == NETWORK_TYPE.FIVE_G) return FIVE_G_PKT_TYPE[type]
type
}
},
// {
Expand Down Expand Up @@ -130,7 +125,7 @@ Row.inheritAttrs = false
:columns="columns"
:data="Network.Packets.value.filter(filterFunc)"
:width="360"
:height="180"
:height="370"
:expand-column-key="columns[7].key"
:estimated-row-height="16"
:header-height="18"
Expand All @@ -139,7 +134,7 @@ Row.inheritAttrs = false
<Row v-bind="props" />
</template>
</el-table-v2>
<ChannelChart />
<!-- <ChannelChart /> -->
</el-card>
</template>

Expand Down
108 changes: 0 additions & 108 deletions src/components/ScenariosPanel.vue

This file was deleted.

4 changes: 2 additions & 2 deletions src/components/ScheduleTable.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<script setup lang="ts">
import { ref, onMounted } from 'vue'
import { useDrawSchedule3D } from '@/hooks/useDrawSchedule3D'
// import { useDrawSchedule3D } from '@/hooks/useDrawSchedule3D'
import { SignalShowSchedule } from '@/hooks/useStates'
const chartDom = ref()
onMounted(() => {
useDrawSchedule3D(chartDom.value)
// useDrawSchedule3D(chartDom.value)
})
</script>

Expand Down
12 changes: 6 additions & 6 deletions src/components/SettingsPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { watch } from 'vue'
import { Network, SignalShowSettings } from '@/hooks/useStates'
watch(
[Network.TopoConfig, Network.SchConfig],
[Network.Config],
() => {
Network.Reset()
},
Expand All @@ -13,13 +13,13 @@ watch(

<template>
<el-card class="card" v-show="SignalShowSettings">
<el-row class="form-row">
<!-- <el-row class="form-row">
<el-col :span="12" class="label-col">
<img src="../assets/settings-toporand.png" class="icon" />
<span class="label">Topo Rand Seed</span>
</el-col>
<el-col :span="12">
<el-input-number v-model="Network.TopoConfig.value.seed" class="input-number" />
<el-input-number v-model="Network.Config.value.seed" class="input-number" />
</el-col>
</el-row>
Expand All @@ -30,7 +30,7 @@ watch(
</el-col>
<el-col :span="12">
<el-input-number
v-model="Network.TopoConfig.value.num_nodes"
v-model="Network.Config.value.num_nodes"
:min="1"
:max="200"
class="input-number"
Expand All @@ -45,7 +45,7 @@ watch(
</el-col>
<el-col :span="12">
<el-input-number
v-model="Network.TopoConfig.value.tx_range"
v-model="Network.Config.value.tx_range"
:min="1"
:max="40"
class="input-number"
Expand Down Expand Up @@ -81,7 +81,7 @@ watch(
class="input-number"
/>
</el-col>
</el-row>
</el-row> -->
</el-card>
</template>

Expand Down
Loading

0 comments on commit 012f546

Please sign in to comment.