feat: 移除电源控制按钮,在jtag操作时自动开启
This commit is contained in:
		
							
								
								
									
										0
									
								
								server/src/Controllers/ProgressController.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								server/src/Controllers/ProgressController.cs
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										0
									
								
								server/src/Services/ProgressService.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								server/src/Services/ProgressService.cs
									
									
									
									
									
										Normal file
									
								
							@@ -41,16 +41,12 @@
 | 
			
		||||
    </div>
 | 
			
		||||
    <div class="divider"></div>
 | 
			
		||||
    <h1 class="font-bold text-center text-2xl">外设</h1>
 | 
			
		||||
    <div class="flex flex-row justify-around">
 | 
			
		||||
    <div class="flex flex-row justify-center">
 | 
			
		||||
      <div class="flex flex-row">
 | 
			
		||||
        <input type="checkbox" class="checkbox" :checked="eqps.enableMatrixKey"
 | 
			
		||||
          @change="handleMatrixkeyCheckboxChange" />
 | 
			
		||||
        <p class="mx-2">启用矩阵键盘</p>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="flex flex-row">
 | 
			
		||||
        <input type="checkbox" class="checkbox" :checked="eqps.enablePower" @change="handlePowerCheckboxChange" />
 | 
			
		||||
        <p class="mx-2">启用电源</p>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
@@ -120,16 +116,6 @@ async function handleMatrixkeyCheckboxChange(event: Event) {
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
async function handlePowerCheckboxChange(event: Event) {
 | 
			
		||||
  const target = event.target as HTMLInputElement;
 | 
			
		||||
  const ret = await eqps.powerSetOnOff(target.checked);
 | 
			
		||||
  if (target.checked) {
 | 
			
		||||
    eqps.enablePower = ret;
 | 
			
		||||
  } else {
 | 
			
		||||
    eqps.enablePower = !ret;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
async function toggleJtagBoundaryScan() {
 | 
			
		||||
  eqps.enableJtagBoundaryScan = !eqps.enableJtagBoundaryScan;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -108,6 +108,9 @@ export const useEquipments = defineStore("equipments", () => {
 | 
			
		||||
  async function jtagBoundaryScan() {
 | 
			
		||||
    const release = await jtagClientMutex.acquire();
 | 
			
		||||
    try {
 | 
			
		||||
      // 自动开启电源
 | 
			
		||||
      await powerSetOnOff(true);
 | 
			
		||||
      
 | 
			
		||||
      const jtagClient = AuthManager.createAuthenticatedJtagClient();
 | 
			
		||||
      const portStates = await jtagClient.boundaryScanLogicalPorts(
 | 
			
		||||
        boardAddr.value,
 | 
			
		||||
@@ -139,6 +142,9 @@ export const useEquipments = defineStore("equipments", () => {
 | 
			
		||||
 | 
			
		||||
  async function jtagUploadBitstream(bitstream: File): Promise<boolean> {
 | 
			
		||||
    try {
 | 
			
		||||
      // 自动开启电源
 | 
			
		||||
      await powerSetOnOff(true);
 | 
			
		||||
      
 | 
			
		||||
      const jtagClient = AuthManager.createAuthenticatedJtagClient();
 | 
			
		||||
      const resp = await jtagClient.uploadBitstream(
 | 
			
		||||
        boardAddr.value,
 | 
			
		||||
@@ -155,6 +161,9 @@ export const useEquipments = defineStore("equipments", () => {
 | 
			
		||||
  async function jtagDownloadBitstream(): Promise<boolean> {
 | 
			
		||||
    const release = await jtagClientMutex.acquire();
 | 
			
		||||
    try {
 | 
			
		||||
      // 自动开启电源
 | 
			
		||||
      await powerSetOnOff(true);
 | 
			
		||||
      
 | 
			
		||||
      const jtagClient = AuthManager.createAuthenticatedJtagClient();
 | 
			
		||||
      const resp = await jtagClient.downloadBitstream(
 | 
			
		||||
        boardAddr.value,
 | 
			
		||||
@@ -173,6 +182,9 @@ export const useEquipments = defineStore("equipments", () => {
 | 
			
		||||
  async function jtagGetIDCode(isQuiet: boolean = false): Promise<number> {
 | 
			
		||||
    const release = await jtagClientMutex.acquire();
 | 
			
		||||
    try {
 | 
			
		||||
      // 自动开启电源
 | 
			
		||||
      await powerSetOnOff(true);
 | 
			
		||||
      
 | 
			
		||||
      const jtagClient = AuthManager.createAuthenticatedJtagClient();
 | 
			
		||||
      const resp = await jtagClient.getDeviceIDCode(
 | 
			
		||||
        boardAddr.value,
 | 
			
		||||
@@ -190,6 +202,9 @@ export const useEquipments = defineStore("equipments", () => {
 | 
			
		||||
  async function jtagSetSpeed(speed: number): Promise<boolean> {
 | 
			
		||||
    const release = await jtagClientMutex.acquire();
 | 
			
		||||
    try {
 | 
			
		||||
      // 自动开启电源
 | 
			
		||||
      await powerSetOnOff(true);
 | 
			
		||||
      
 | 
			
		||||
      const jtagClient = AuthManager.createAuthenticatedJtagClient();
 | 
			
		||||
      const resp = await jtagClient.setSpeed(
 | 
			
		||||
        boardAddr.value,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user