Bladeren bron

1.修复编辑对DO与AO的判断条件无效的问题;2.修复修改任务名称需要完全重填的问题;

jevian ma(马作伟_沃航科技) 1 maand geleden
bovenliggende
commit
393c4dc6d2
2 gewijzigde bestanden met toevoegingen van 13 en 1 verwijderingen
  1. 5 1
      src/views/CommandInfo.vue
  2. 8 0
      src/views/ProjectInfo.vue

+ 5 - 1
src/views/CommandInfo.vue

@@ -4,7 +4,7 @@
       <div class="go-back">
         <van-icon size="16" name="arrow-left" @click="router.push(`/project-info/${crtProject!.id}`)" />
         <div class="command-name">{{ crtCommand?.name }}</div>
-        <van-icon size="16" name="edit" @click.stop="showEditPopup = true" />
+        <van-icon size="16" name="edit" @click.stop="EditPopupShow" />
       </div>
       <div class="btn-group">
         <van-icon name="question-o" size="24" @click="showHelpDoc = true" />
@@ -624,6 +624,10 @@ const onSubmit = (values: Record<string, string>) => {
     handleCancel()
   }
 }
+const EditPopupShow = () => {
+  showEditPopup.value = true
+  newCommandName.value = crtCommand.value!.name
+}
 const handleCancel = async () => {
   showEditPopup.value = false
   await nextTick()

+ 8 - 0
src/views/ProjectInfo.vue

@@ -1604,10 +1604,18 @@ static PT_THREAD(PROGRAM${index}_body(struct pt *pt, TIME *pt_delay))
                 const idx = cItem.label.slice(2)
                 condition_code += `GET_DI(${idx}) == ${valMap[cItem.value]}${linkStr}`
               }
+              if (cItem.label.includes('DO')) {
+                const idx = cItem.label.slice(2)
+                condition_code += `GET_DO(${idx}) == ${valMap[cItem.value]}${linkStr}`
+              }
               if (cItem.label.includes('AI')) {
                 const idx = cItem.label.slice(2)
                 condition_code += `GET_AI(${idx}) ${operationMap[cItem.operation!]} ${+cItem.value * 1000}${linkStr}`
               }
+              if (cItem.label.includes('AO')) {
+                const idx = cItem.label.slice(2)
+                condition_code += `GET_AO(${idx}) ${operationMap[cItem.operation!]} ${+cItem.value * 1000}${linkStr}`
+              }
               if (cItem.type === 'time') {
                 const timeArr = cItem.value.split(':')
                 const sec = Math.floor(