fix: DDS and drag will reset conponent props
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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("应用失败");
|
||||
|
||||
Reference in New Issue
Block a user