fix: DDS and drag will reset conponent props

This commit is contained in:
2025-05-17 15:09:59 +08:00
parent 9b2ee8ad46
commit 3fb59af2dd
3 changed files with 32 additions and 29 deletions

View File

@@ -46,7 +46,7 @@
</template>
<script setup lang="ts">
import { ref, computed, watch, onMounted } from 'vue';
import { ref, computed, watch, onMounted, watchEffect } from 'vue';
import Pin from './Pin.vue';
// 存储Pin引用
@@ -94,6 +94,10 @@ const currentWaveformIndex = ref(0);
const waveformNames = ['正弦波', '方波', '三角波', '锯齿波'];
const waveforms = ['sine', 'square', 'triangle', 'sawtooth'];
watchEffect(()=>{
console.log(`DDS Porperties: ${frequency.value} ${timebase.value}`)
})
// 波形函数集合
interface WaveformFunction {
(x: number, width: number, height: number, phaseRad: number): number;

View File

@@ -408,7 +408,7 @@ async function applyOutputWave() {
eqps.boardPort,
0,
currentWaveformIndex.value,
toInteger( frequency.value * Math.pow(2, 32 - 20) / 10 ),
toInteger(frequency.value * Math.pow(2, 32 - 20)),
);
if (!ret) {
dialog.error("应用失败");