sige 1 year ago
parent
commit
19f24f5ca5
  1. 194
      src/components/TestFeeder.vue

194
src/components/TestFeeder.vue

@ -2,25 +2,26 @@
<div class="h-full flex flex-col">
<div class="border-b p-5 bg-white flex flex-row">
<div>进出料</div>
<div v-if="false" class="ml-1"><LoadingOutlined /></div>
<div v-if="isActionExecuting" class="ml-1"><LoadingOutlined /></div>
</div>
<a-row class="h-0 grow">
<a-col class="border-r" :span="16">
<div class="p-5 border-t border-b">
<a-row>
<a-col class="p-1" :span="8"><a-input prefix="回零超时时间 : " v-model:value="serviceParams.moveToZeroOvertime" /></a-col>
<a-col class="p-1" :span="8"><a-input prefix="执行动作的超时时间 : " v-model:value="serviceParams.actionOvertime" /></a-col>
<a-col class="p-1" :span="8"><a-input prefix="试管扫码位置 : " v-model:value="serviceParams.tubeScanPos" /></a-col>
<a-col class="p-1" :span="8"><a-input prefix="高低试管判断位置 : " v-model:value="serviceParams.tubeHeighJudgmentPos" /></a-col>
<a-col class="p-1" :span="8"><a-input prefix="试管预处理位置 : " v-model:value="serviceParams.tubePreProcessPos" /></a-col>
<a-col class="p-1" :span="8"><a-input prefix="有无判断位置 : " v-model:value="serviceParams.tubeExistJudgmentPos" /></a-col>
<a-col class="p-1" :span="8"><a-input prefix="入料位置 : " v-model:value="serviceParams.tubeRackEnterPos" /></a-col>
<a-col class="p-1" :span="8"><a-input prefix="出料位置 : " v-model:value="serviceParams.tubeRackExitPos" /></a-col>
<a-col class="p-1" :span="8"><a-input prefix="试管架扫码位置 : " v-model:value="serviceParams.tubeRackScanCodePos" /></a-col>
<a-col class="p-1" :span="8"><a-input prefix="水平移动电机位置偏移 : " v-model:value="serviceParams.horizontalMotorOffset" /></a-col>
<a-col class="p-1" :span="8"><a-input prefix="水平电机丢步判断 : " v-model:value="serviceParams.horizontalMotorLostStepThresholdVal" /></a-col>
<a-col class="p-1" :span="8"><a-input prefix="试管扫码夹紧位置 : " v-model:value="serviceParams.scanCodeClampPos" /></a-col>
<a-col class="p-1" :span="8"><a-input prefix="试管扫码释放位置 : " v-model:value="serviceParams.scanCodeReleasePos" /></a-col>
<a-col class="p-1" :span="8"><a-input prefix="回零超时时间 : " v-model:value="serviceParams.MoveToZeroOvertime" /></a-col>
<a-col class="p-1" :span="8"><a-input prefix="执行动作的超时时间 : " v-model:value="serviceParams.ActionOvertime" /></a-col>
<a-col class="p-1" :span="8"><a-input prefix="试管扫码位置 : " v-model:value="serviceParams.TubeScanPos" /></a-col>
<a-col class="p-1" :span="8"><a-input prefix="高低试管判断位置 : " v-model:value="serviceParams.TubeHeighJudgmentPos" /></a-col>
<a-col class="p-1" :span="8"><a-input prefix="试管预处理位置 : " v-model:value="serviceParams.TubePreProcessPos" /></a-col>
<a-col class="p-1" :span="8"><a-input prefix="有无判断位置 : " v-model:value="serviceParams.TubeExistJudgmentPos" /></a-col>
<a-col class="p-1" :span="8"><a-input prefix="入料位置 : " v-model:value="serviceParams.TubeRackEnterPos" /></a-col>
<a-col class="p-1" :span="8"><a-input prefix="出料位置 : " v-model:value="serviceParams.TubeRackExitPos" /></a-col>
<a-col class="p-1" :span="8"><a-input prefix="试管架扫码位置 : " v-model:value="serviceParams.TubeRackScanCodePos" /></a-col>
<a-col class="p-1" :span="8"><a-input prefix="水平移动电机位置偏移 : " v-model:value="serviceParams.HorizontalMotorOffset" /></a-col>
<a-col class="p-1" :span="8"><a-input prefix="水平电机丢步判断 : " v-model:value="serviceParams.HorizontalMotorLostStepThresholdVal" /></a-col>
<a-col class="p-1" :span="8"><a-input prefix="试管扫码夹紧位置 : " v-model:value="serviceParams.ScanCodeClampPos" /></a-col>
<a-col class="p-1" :span="8"><a-input prefix="试管扫码释放位置 : " v-model:value="serviceParams.ScanCodeReleasePos" /></a-col>
<a-col class="p-1" :span="8"><a-input prefix="试管间距 : " v-model:value="serviceParams.TubeSpacing" /></a-col>
<a-col class="p-1" :span="8">
<a-button class="mr-1" @click="actionServiceParamsReload">刷新</a-button>
<a-button @click="actionServiceParamsSave">保存</a-button>
@ -29,11 +30,12 @@
</div>
<div class="p-5">
<a-button class="m-1" @click="actionQuickExec('moveToZeroWhenDeviceSetup')">失能</a-button>
<a-button class="m-1" @click="actionQuickExec('moveToZero')">使能</a-button>
<a-button class="m-1" @click="actionQuickExec('moveTubeRackToEnterPos')">停止</a-button>
<a-button class="m-1" @click="actionQuickExec('moveToZeroWhenDeviceSetup')">设备启动归零</a-button>
<a-button class="m-1" @click="actionQuickExec('setEnable', true)">使能</a-button>
<a-button class="m-1" @click="actionQuickExec('setEnable', false)">失能</a-button>
<a-button class="m-1" @click="actionQuickExec('stop')">停止</a-button>
<a-button class="m-1" @click="actionQuickExec('moveToZero')">归零</a-button>
<a-button class="m-1" @click="actionQuickExec('moveToZeroWhenDeviceSetup')">设备启动归零</a-button>
<a-button class="m-1" @click="actionQuickExec('moveTubeRackToEnterPos')">移动试管架到入口位置</a-button>
<a-button class="m-1" @click="actionQuickExec('moveTubeRackToExitPos')">移动试管架到出口位置</a-button>
<a-button class="m-1" @click="actionQuickExec('moveTubeRackToScanPos')">移动试管架到试管架扫码位置</a-button>
@ -48,42 +50,132 @@
<div class="mt-1">
<a-input-group compact class="flex flex-row">
<a-button @click="actionMoveTubeToScanPos">移动试管到扫码位置</a-button>
<a-input class="!w-64" prefix="TubeType : " v-model:value="moveTubeToScanPosParams[0]"/>
<a-input class="!w-32" prefix="TubeIndex : " v-model:value="moveTubeToScanPosParams[1]"/>
<a-select class="w-64" v-model:value="moveTubeToScanPosParams[0]">
<a-select-option value="HighBlood">试管类型 : 全血5ML</a-select-option>
<a-select-option value="ShortBlood">试管类型 : 全血3ML</a-select-option>
<a-select-option value="Mini">试管类型 : 迷你试管</a-select-option>
<a-select-option value="MiniBlood">试管类型 : 阳普管</a-select-option>
<a-select-option value="BulletTube1P5">试管类型 : 子弹头试管1.5mL</a-select-option>
<a-select-option value="BulletTube0P5">试管类型 : 子弹头试管0.5mL</a-select-option>
</a-select>
<a-select class="w-32" v-model:value="moveTubeToScanPosParams[1]">
<a-select-option :value="0">试管 : 1</a-select-option>
<a-select-option :value="1">试管 : 2</a-select-option>
<a-select-option :value="2">试管 : 3</a-select-option>
<a-select-option :value="3">试管 : 4</a-select-option>
<a-select-option :value="4">试管 : 5</a-select-option>
<a-select-option :value="5">试管 : 6</a-select-option>
<a-select-option :value="6">试管 : 7</a-select-option>
<a-select-option :value="7">试管 : 8</a-select-option>
<a-select-option :value="8">试管 : 9</a-select-option>
<a-select-option :value="9">试管 : 10</a-select-option>
</a-select>
</a-input-group>
</div>
<div class="mt-1">
<a-input-group compact class="flex flex-row">
<a-button @click="actionMoveTubeToScanPosAndScan">移动试管到扫码位置并扫码</a-button>
<a-input class="!w-64" prefix="TubeType : " v-model:value="moveTubeToScanPosAndScanParams[0]"/>
<a-input class="!w-32" prefix="TubeIndex : " v-model:value="moveTubeToScanPosAndScanParams[1]"/>
<a-select class="w-64" v-model:value="moveTubeToScanPosAndScanParams[0]">
<a-select-option value="HighBlood">试管类型 : 全血5ML</a-select-option>
<a-select-option value="ShortBlood">试管类型 : 全血3ML</a-select-option>
<a-select-option value="Mini">试管类型 : 迷你试管</a-select-option>
<a-select-option value="MiniBlood">试管类型 : 阳普管</a-select-option>
<a-select-option value="BulletTube1P5">试管类型 : 子弹头试管1.5mL</a-select-option>
<a-select-option value="BulletTube0P5">试管类型 : 子弹头试管0.5mL</a-select-option>
</a-select>
<a-select class="w-32" v-model:value="moveTubeToScanPosAndScanParams[1]">
<a-select-option :value="0">试管 : 1</a-select-option>
<a-select-option :value="1">试管 : 2</a-select-option>
<a-select-option :value="2">试管 : 3</a-select-option>
<a-select-option :value="3">试管 : 4</a-select-option>
<a-select-option :value="4">试管 : 5</a-select-option>
<a-select-option :value="5">试管 : 6</a-select-option>
<a-select-option :value="6">试管 : 7</a-select-option>
<a-select-option :value="7">试管 : 8</a-select-option>
<a-select-option :value="8">试管 : 9</a-select-option>
<a-select-option :value="9">试管 : 10</a-select-option>
</a-select>
</a-input-group>
</div>
<div class="mt-1">
<a-input-group compact class="flex flex-row">
<a-button @click="actionMoveTubeToHeighJudgmentPos">移动试管到试管高低判断位置</a-button>
<a-input class="!w-64" prefix="TubeType : " v-model:value="moveTubeToHeighJudgmentPosParams[0]"/>
<a-input class="!w-32" prefix="TubeIndex : " v-model:value="moveTubeToHeighJudgmentPosParams[1]"/>
<a-select class="w-64" v-model:value="moveTubeToHeighJudgmentPosParams[0]">
<a-select-option value="HighBlood">试管类型 : 全血5ML</a-select-option>
<a-select-option value="ShortBlood">试管类型 : 全血3ML</a-select-option>
<a-select-option value="Mini">试管类型 : 迷你试管</a-select-option>
<a-select-option value="MiniBlood">试管类型 : 阳普管</a-select-option>
<a-select-option value="BulletTube1P5">试管类型 : 子弹头试管1.5mL</a-select-option>
<a-select-option value="BulletTube0P5">试管类型 : 子弹头试管0.5mL</a-select-option>
</a-select>
<a-select class="w-32" v-model:value="moveTubeToHeighJudgmentPosParams[1]">
<a-select-option :value="0">试管 : 1</a-select-option>
<a-select-option :value="1">试管 : 2</a-select-option>
<a-select-option :value="2">试管 : 3</a-select-option>
<a-select-option :value="3">试管 : 4</a-select-option>
<a-select-option :value="4">试管 : 5</a-select-option>
<a-select-option :value="5">试管 : 6</a-select-option>
<a-select-option :value="6">试管 : 7</a-select-option>
<a-select-option :value="7">试管 : 8</a-select-option>
<a-select-option :value="8">试管 : 9</a-select-option>
<a-select-option :value="9">试管 : 10</a-select-option>
</a-select>
</a-input-group>
</div>
<div class="mt-1">
<a-input-group compact class="flex flex-row">
<a-button @click="actionMoveTubeToPreProcessPos">移动试管到试管预处理的位置</a-button>
<a-input class="!w-64" prefix="TubeType : " v-model:value="moveTubeToPreProcessPosParams[0]"/>
<a-input class="!w-32" prefix="TubeIndex : " v-model:value="moveTubeToPreProcessPosParams[1]"/>
<a-select class="w-64" v-model:value="moveTubeToPreProcessPosParams[0]">
<a-select-option value="HighBlood">试管类型 : 全血5ML</a-select-option>
<a-select-option value="ShortBlood">试管类型 : 全血3ML</a-select-option>
<a-select-option value="Mini">试管类型 : 迷你试管</a-select-option>
<a-select-option value="MiniBlood">试管类型 : 阳普管</a-select-option>
<a-select-option value="BulletTube1P5">试管类型 : 子弹头试管1.5mL</a-select-option>
<a-select-option value="BulletTube0P5">试管类型 : 子弹头试管0.5mL</a-select-option>
</a-select>
<a-select class="w-32" v-model:value="moveTubeToPreProcessPosParams[1]">
<a-select-option :value="0">试管 : 1</a-select-option>
<a-select-option :value="1">试管 : 2</a-select-option>
<a-select-option :value="2">试管 : 3</a-select-option>
<a-select-option :value="3">试管 : 4</a-select-option>
<a-select-option :value="4">试管 : 5</a-select-option>
<a-select-option :value="5">试管 : 6</a-select-option>
<a-select-option :value="6">试管 : 7</a-select-option>
<a-select-option :value="7">试管 : 8</a-select-option>
<a-select-option :value="8">试管 : 9</a-select-option>
<a-select-option :value="9">试管 : 10</a-select-option>
</a-select>
</a-input-group>
</div>
<div class="mt-1">
<a-input-group compact class="flex flex-row">
<a-button @click="actionMoveTubeToExistJudgmentPos">移动试管到试管有无判断位置</a-button>
<a-input class="!w-64" prefix="TubeType : " v-model:value="moveTubeToExistJudgmentPosParams[0]"/>
<a-input class="!w-32" prefix="TubeIndex : " v-model:value="moveTubeToExistJudgmentPosParams[1]"/>
<a-select class="w-64" v-model:value="moveTubeToExistJudgmentPosParams[0]">
<a-select-option value="HighBlood">试管类型 : 全血5ML</a-select-option>
<a-select-option value="ShortBlood">试管类型 : 全血3ML</a-select-option>
<a-select-option value="Mini">试管类型 : 迷你试管</a-select-option>
<a-select-option value="MiniBlood">试管类型 : 阳普管</a-select-option>
<a-select-option value="BulletTube1P5">试管类型 : 子弹头试管1.5mL</a-select-option>
<a-select-option value="BulletTube0P5">试管类型 : 子弹头试管0.5mL</a-select-option>
</a-select>
<a-select class="w-32" v-model:value="moveTubeToExistJudgmentPosParams[1]">
<a-select-option :value="0">试管 : 1</a-select-option>
<a-select-option :value="1">试管 : 2</a-select-option>
<a-select-option :value="2">试管 : 3</a-select-option>
<a-select-option :value="3">试管 : 4</a-select-option>
<a-select-option :value="4">试管 : 5</a-select-option>
<a-select-option :value="5">试管 : 6</a-select-option>
<a-select-option :value="6">试管 : 7</a-select-option>
<a-select-option :value="7">试管 : 8</a-select-option>
<a-select-option :value="8">试管 : 9</a-select-option>
<a-select-option :value="9">试管 : 10</a-select-option>
</a-select>
</a-input-group>
</div>
</div>
</a-col>
<a-col :span="8" class="p-5">
<div class="border rounded p-5 whitespace-pre-line h-full overflow-y-auto bg-white"
<a-col :span="8" class="p-5 h-full">
<div class="border rounded p-5 whitespace-pre h-full overflow-y-auto bg-white"
>{{ message }}</div>
</a-col>
</a-row>
@ -91,24 +183,29 @@
</template>
<script setup>
import ApiClient from '@/utils/ApiClient';
import { ref } from 'vue';
import { ref, onMounted } from 'vue';
import { LoadingOutlined } from '@ant-design/icons-vue';
const message = ref('');
const moveTubeToScanPosParams = ref(['', 0]);
const moveTubeToScanPosAndScanParams = ref(['',0]);
const moveTubeToHeighJudgmentPosParams = ref(['',0]);
const moveTubeToPreProcessPosParams = ref(['',0]);
const moveTubeToExistJudgmentPosParams = ref(['',0]);
const moveTubeToScanPosParams = ref(['ShortBlood', 0]);
const moveTubeToScanPosAndScanParams = ref(['ShortBlood',0]);
const moveTubeToHeighJudgmentPosParams = ref(['ShortBlood',0]);
const moveTubeToPreProcessPosParams = ref(['ShortBlood',0]);
const moveTubeToExistJudgmentPosParams = ref(['ShortBlood',0]);
const serviceParams = ref({});
const isActionExecuting = ref(false);
onMounted(actionServiceParamsReload);
async function actionServiceParamsReload() {
serviceParams.value = {};
message.value = '';
let client = ApiClient.getClient();
try {
let res = await client.call('tmp-test/get-service-params');
message.value = res;
serviceParams.value = res.data;
let res = await client.call('motor-tube-rack-move-ctrl/list-options');
message.value = JSON.stringify(res, null, 2);
for ( let item of res ) {
serviceParams.value[item.key] = item.val;
}
} catch ( e ) {
message.value = e.message
}
@ -118,8 +215,12 @@ async function actionServiceParamsSave() {
message.value = '';
let client = ApiClient.getClient();
try {
let res = await client.call('tmp-test/update-service-params', serviceParams.value);
message.value = res;
let options = [];
for ( let key in serviceParams.value ) {
options.push({name:key, value: serviceParams.value[key]});
}
let res = await client.call('motor-tube-rack-move-ctrl/update-options', {options});
message.value = JSON.stringify(res, null, 2);
} catch ( e ) {
message.value = e.message
}
@ -127,17 +228,16 @@ async function actionServiceParamsSave() {
// execute service method
async function executeServiceMethod( method, params=[]) {
isActionExecuting.value = true;
message.value = '';
let client = ApiClient.getClient();
try {
let res = await client.call('tmp-test/execute-service-method', {
service:'motorTubeRackMoveCtrlService',
method,
params
});
message.value = res;
let res = await client.call('motor-tube-rack-move-ctrl/execute-service-method', {method,params});
message.value = null === res ? 'OK' : JSON.stringify(res, null, 2);
} catch ( e ) {
message.value = e.message
} finally {
isActionExecuting.value = false;
}
}

Loading…
Cancel
Save