Squashed commit of the following:
All checks were successful
CI / Docker-Build (push) Successful in 2m9s
All checks were successful
CI / Docker-Build (push) Successful in 2m9s
commit a337216236
Author: joylink_zhaoerwei <Bob_Engineer@163.com>
Date: Tue May 7 13:09:16 2024 +0800
列车驾驶台加对应列车索引+生成继电器时加是否覆盖之前的采集驱动数据
This commit is contained in:
parent
57a91486ed
commit
b368560398
@ -83,6 +83,7 @@
|
||||
:width="tccCanvasWidth"
|
||||
:height="tccCanvasHeight"
|
||||
@hide="tccHide"
|
||||
:title="`列车${tccStore.tccId}`"
|
||||
>
|
||||
<div id="tcc-app-container" class="overflow-hidden"></div>
|
||||
</draggable-dialog>
|
||||
|
@ -197,6 +197,10 @@
|
||||
label="集中站"
|
||||
:rules="[(val) => val != '' || '集中站不能为空']"
|
||||
></q-select>
|
||||
<q-toggle
|
||||
v-model="generaterRelayLayout.generateCJQD"
|
||||
label="是否覆盖采集驱动数据"
|
||||
/>
|
||||
<div class="q-gutter-sm q-pa-md row justify-center">
|
||||
<q-btn
|
||||
label="确定"
|
||||
@ -469,7 +473,8 @@ const generaterRelayLayoutDialog = ref(false);
|
||||
const generaterRelayLayout = ref<{
|
||||
publishId: string;
|
||||
centralizedStation: number;
|
||||
}>({ publishId: '', centralizedStation: 0 });
|
||||
generateCJQD: boolean;
|
||||
}>({ publishId: '', centralizedStation: 0, generateCJQD: true });
|
||||
|
||||
let publishIdOption = ref<{ label: string; value: number }[]>();
|
||||
let centralizedStationsOption = ref<{ label: string; value: number }[]>([
|
||||
@ -827,180 +832,183 @@ function oneClickGeneraterRelayLayout() {
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
//根据生成的组合类型列表生成采集列表
|
||||
const deviceRelateRelayList = loadDeviceRelateRelayList();
|
||||
const allCjData: relayCabinetGraphicData.CjData[] = [];
|
||||
deviceRelateRelayList.forEach((deviceRelateRelay) => {
|
||||
let deviceCiCjConfig;
|
||||
if (deviceRelateRelay.deviceType !== DeviceType.CarWashing) {
|
||||
deviceCiCjConfig = ciCjMap.get(
|
||||
`${deviceRelateRelay.deviceType}+${allDeviceModelMap.get(
|
||||
`${deviceRelateRelay.deviceType}+${deviceRelateRelay.code}`
|
||||
)}`
|
||||
);
|
||||
} else {
|
||||
deviceCiCjConfig = ciCjMap.get(
|
||||
`${deviceRelateRelay.deviceType}+undefined`
|
||||
);
|
||||
}
|
||||
let copyDeviceCiCjConfig: CjData[] =
|
||||
deviceCiCjConfig === undefined
|
||||
? undefined
|
||||
: JSON.parse(JSON.stringify(deviceCiCjConfig));
|
||||
//动态配置车站EMP的采集配置
|
||||
if (
|
||||
deviceRelateRelay.deviceType == DeviceType.station &&
|
||||
deviceCiCjConfig
|
||||
) {
|
||||
const handleCopyDeviceCiCjConfig: CjData[] = [];
|
||||
if (hasEMP_MKX_SPKS.hasEMP) {
|
||||
const refDeviceCodesAndPos: {
|
||||
code: string;
|
||||
position: relayCabinetGraphicData.CjDataItem.PostionType;
|
||||
}[][] = [];
|
||||
deviceRelateRelay.combinationtypes[0].refRelays.forEach(
|
||||
(relayId) => {
|
||||
const code = generateRelays.find((g) => g.id == relayId)?.code;
|
||||
if (code) {
|
||||
refDeviceCodesAndPos.push(
|
||||
[
|
||||
{
|
||||
code,
|
||||
position: PostionType.Q,
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
code,
|
||||
position: PostionType.H,
|
||||
},
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
if (generaterRelayLayout.value.generateCJQD) {
|
||||
//根据生成的组合类型列表生成采集列表
|
||||
const deviceRelateRelayList = loadDeviceRelateRelayList();
|
||||
const allCjData: relayCabinetGraphicData.CjData[] = [];
|
||||
deviceRelateRelayList.forEach((deviceRelateRelay) => {
|
||||
let deviceCiCjConfig;
|
||||
if (deviceRelateRelay.deviceType !== DeviceType.CarWashing) {
|
||||
deviceCiCjConfig = ciCjMap.get(
|
||||
`${deviceRelateRelay.deviceType}+${allDeviceModelMap.get(
|
||||
`${deviceRelateRelay.deviceType}+${deviceRelateRelay.code}`
|
||||
)}`
|
||||
);
|
||||
} else {
|
||||
deviceCiCjConfig = ciCjMap.get(
|
||||
`${deviceRelateRelay.deviceType}+undefined`
|
||||
);
|
||||
handleCopyDeviceCiCjConfig?.push({
|
||||
code: 'EMP',
|
||||
refDeviceCodesAndPos,
|
||||
});
|
||||
}
|
||||
if (hasEMP_MKX_SPKS.hasMKX) {
|
||||
handleCopyDeviceCiCjConfig.push(deviceCiCjConfig[0]);
|
||||
let copyDeviceCiCjConfig: CjData[] =
|
||||
deviceCiCjConfig === undefined
|
||||
? undefined
|
||||
: JSON.parse(JSON.stringify(deviceCiCjConfig));
|
||||
//动态配置车站EMP的采集配置
|
||||
if (
|
||||
deviceRelateRelay.deviceType == DeviceType.station &&
|
||||
deviceCiCjConfig
|
||||
) {
|
||||
const handleCopyDeviceCiCjConfig: CjData[] = [];
|
||||
if (hasEMP_MKX_SPKS.hasEMP) {
|
||||
const refDeviceCodesAndPos: {
|
||||
code: string;
|
||||
position: relayCabinetGraphicData.CjDataItem.PostionType;
|
||||
}[][] = [];
|
||||
deviceRelateRelay.combinationtypes[0].refRelays.forEach(
|
||||
(relayId) => {
|
||||
const code = generateRelays.find(
|
||||
(g) => g.id == relayId
|
||||
)?.code;
|
||||
if (code) {
|
||||
refDeviceCodesAndPos.push(
|
||||
[
|
||||
{
|
||||
code,
|
||||
position: PostionType.Q,
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
code,
|
||||
position: PostionType.H,
|
||||
},
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
handleCopyDeviceCiCjConfig?.push({
|
||||
code: 'EMP',
|
||||
refDeviceCodesAndPos,
|
||||
});
|
||||
}
|
||||
if (hasEMP_MKX_SPKS.hasMKX) {
|
||||
handleCopyDeviceCiCjConfig.push(deviceCiCjConfig[0]);
|
||||
}
|
||||
if (hasEMP_MKX_SPKS.hasSPKS) {
|
||||
handleCopyDeviceCiCjConfig.push(deviceCiCjConfig[1]);
|
||||
}
|
||||
copyDeviceCiCjConfig = handleCopyDeviceCiCjConfig;
|
||||
}
|
||||
if (hasEMP_MKX_SPKS.hasSPKS) {
|
||||
handleCopyDeviceCiCjConfig.push(deviceCiCjConfig[1]);
|
||||
}
|
||||
copyDeviceCiCjConfig = handleCopyDeviceCiCjConfig;
|
||||
}
|
||||
//动态配置洗车机的采集配置
|
||||
if (
|
||||
deviceRelateRelay.deviceType == DeviceType.CarWashing &&
|
||||
deviceCiCjConfig
|
||||
) {
|
||||
const duanNum = allDeviceModelMap.get(
|
||||
`${deviceRelateRelay.deviceType}+${deviceRelateRelay.code}`
|
||||
) as string;
|
||||
for (let i = 2; i <= +duanNum; i++) {
|
||||
copyDeviceCiCjConfig[0].refDeviceCodesAndPos.push([
|
||||
{
|
||||
code: `TWJ${i}`,
|
||||
position: PostionType.Q,
|
||||
},
|
||||
]);
|
||||
copyDeviceCiCjConfig[1].refDeviceCodesAndPos.push(
|
||||
[
|
||||
//动态配置洗车机的采集配置
|
||||
if (
|
||||
deviceRelateRelay.deviceType == DeviceType.CarWashing &&
|
||||
deviceCiCjConfig
|
||||
) {
|
||||
const duanNum = allDeviceModelMap.get(
|
||||
`${deviceRelateRelay.deviceType}+${deviceRelateRelay.code}`
|
||||
) as string;
|
||||
for (let i = 2; i <= +duanNum; i++) {
|
||||
copyDeviceCiCjConfig[0].refDeviceCodesAndPos.push([
|
||||
{
|
||||
code: `CFJ${i}`,
|
||||
code: `TWJ${i}`,
|
||||
position: PostionType.Q,
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
code: `CFJ${i}`,
|
||||
position: PostionType.H,
|
||||
},
|
||||
]
|
||||
);
|
||||
]);
|
||||
copyDeviceCiCjConfig[1].refDeviceCodesAndPos.push(
|
||||
[
|
||||
{
|
||||
code: `CFJ${i}`,
|
||||
position: PostionType.Q,
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
code: `CFJ${i}`,
|
||||
position: PostionType.H,
|
||||
},
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
copyDeviceCiCjConfig?.forEach((combinationtype) => {
|
||||
combinationtype.refDeviceCodesAndPos.forEach((items) => {
|
||||
const cjData: relayCabinetGraphicData.CjDataItem[] = [];
|
||||
items.forEach((relay) => {
|
||||
cjData.push(
|
||||
new relayCabinetGraphicData.CjDataItem({
|
||||
relayId: generateRelaysMap.get(
|
||||
`${deviceRelateRelay.deviceType}+${deviceRelateRelay.code}+${combinationtype.code}+${relay.code}`
|
||||
),
|
||||
position: relay.position,
|
||||
})
|
||||
copyDeviceCiCjConfig?.forEach((combinationtype) => {
|
||||
combinationtype.refDeviceCodesAndPos.forEach((items) => {
|
||||
const cjData: relayCabinetGraphicData.CjDataItem[] = [];
|
||||
items.forEach((relay) => {
|
||||
cjData.push(
|
||||
new relayCabinetGraphicData.CjDataItem({
|
||||
relayId: generateRelaysMap.get(
|
||||
`${deviceRelateRelay.deviceType}+${deviceRelateRelay.code}+${combinationtype.code}+${relay.code}`
|
||||
),
|
||||
position: relay.position,
|
||||
})
|
||||
);
|
||||
});
|
||||
allCjData.push(
|
||||
new relayCabinetGraphicData.CjData({ refRelays: cjData })
|
||||
);
|
||||
});
|
||||
allCjData.push(
|
||||
new relayCabinetGraphicData.CjData({ refRelays: cjData })
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
creatCiCjListByCombinationtype(
|
||||
32,
|
||||
Math.ceil(allCjData.length / 32),
|
||||
allCjData
|
||||
);
|
||||
creatCiCjListByCombinationtype(
|
||||
32,
|
||||
Math.ceil(allCjData.length / 32),
|
||||
allCjData
|
||||
);
|
||||
|
||||
//根据生成的组合类型列表生成驱动列表
|
||||
const allQdData: relayCabinetGraphicData.QdData[] = [];
|
||||
deviceRelateRelayList.forEach((deviceRelateRelay) => {
|
||||
let deviceCiQdConfig: QdData[] | undefined;
|
||||
let changeDeviceCiQdConfig: QdData[];
|
||||
if (deviceRelateRelay.deviceType !== DeviceType.CarWashing) {
|
||||
deviceCiQdConfig = ciQdMap.get(
|
||||
`${deviceRelateRelay.deviceType}+${allDeviceModelMap.get(
|
||||
//根据生成的组合类型列表生成驱动列表
|
||||
const allQdData: relayCabinetGraphicData.QdData[] = [];
|
||||
deviceRelateRelayList.forEach((deviceRelateRelay) => {
|
||||
let deviceCiQdConfig: QdData[] | undefined;
|
||||
let changeDeviceCiQdConfig: QdData[];
|
||||
if (deviceRelateRelay.deviceType !== DeviceType.CarWashing) {
|
||||
deviceCiQdConfig = ciQdMap.get(
|
||||
`${deviceRelateRelay.deviceType}+${allDeviceModelMap.get(
|
||||
`${deviceRelateRelay.deviceType}+${deviceRelateRelay.code}`
|
||||
)}`
|
||||
);
|
||||
changeDeviceCiQdConfig =
|
||||
deviceCiQdConfig === undefined
|
||||
? undefined
|
||||
: JSON.parse(JSON.stringify(deviceCiQdConfig));
|
||||
} else {
|
||||
deviceCiQdConfig = ciQdMap.get(
|
||||
`${deviceRelateRelay.deviceType}+undefined`
|
||||
);
|
||||
changeDeviceCiQdConfig =
|
||||
deviceCiQdConfig === undefined
|
||||
? undefined
|
||||
: JSON.parse(JSON.stringify(deviceCiQdConfig));
|
||||
const duanNum = allDeviceModelMap.get(
|
||||
`${deviceRelateRelay.deviceType}+${deviceRelateRelay.code}`
|
||||
)}`
|
||||
);
|
||||
changeDeviceCiQdConfig =
|
||||
deviceCiQdConfig === undefined
|
||||
? undefined
|
||||
: JSON.parse(JSON.stringify(deviceCiQdConfig));
|
||||
} else {
|
||||
deviceCiQdConfig = ciQdMap.get(
|
||||
`${deviceRelateRelay.deviceType}+undefined`
|
||||
);
|
||||
changeDeviceCiQdConfig =
|
||||
deviceCiQdConfig === undefined
|
||||
? undefined
|
||||
: JSON.parse(JSON.stringify(deviceCiQdConfig));
|
||||
const duanNum = allDeviceModelMap.get(
|
||||
`${deviceRelateRelay.deviceType}+${deviceRelateRelay.code}`
|
||||
) as string;
|
||||
for (let i = 2; i <= +duanNum; i++) {
|
||||
changeDeviceCiQdConfig[0].refDeviceCodes.push([`TWJ${i}`]);
|
||||
) as string;
|
||||
for (let i = 2; i <= +duanNum; i++) {
|
||||
changeDeviceCiQdConfig[0].refDeviceCodes.push([`TWJ${i}`]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
changeDeviceCiQdConfig?.forEach((combinationtype) => {
|
||||
combinationtype.refDeviceCodes.forEach((items) => {
|
||||
const qdData: number[] = [];
|
||||
items.forEach((relayCode) => {
|
||||
qdData.push(
|
||||
generateRelaysMap.get(
|
||||
`${deviceRelateRelay.deviceType}+${deviceRelateRelay.code}+${combinationtype.code}+${relayCode}`
|
||||
) as number
|
||||
changeDeviceCiQdConfig?.forEach((combinationtype) => {
|
||||
combinationtype.refDeviceCodes.forEach((items) => {
|
||||
const qdData: number[] = [];
|
||||
items.forEach((relayCode) => {
|
||||
qdData.push(
|
||||
generateRelaysMap.get(
|
||||
`${deviceRelateRelay.deviceType}+${deviceRelateRelay.code}+${combinationtype.code}+${relayCode}`
|
||||
) as number
|
||||
);
|
||||
});
|
||||
allQdData.push(
|
||||
new relayCabinetGraphicData.QdData({ refRelays: qdData })
|
||||
);
|
||||
});
|
||||
allQdData.push(
|
||||
new relayCabinetGraphicData.QdData({ refRelays: qdData })
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
creatCiQdListByCombinationtype(
|
||||
32,
|
||||
Math.ceil(allQdData.length / 32),
|
||||
allQdData
|
||||
);
|
||||
creatCiQdListByCombinationtype(
|
||||
32,
|
||||
Math.ceil(allQdData.length / 32),
|
||||
allQdData
|
||||
);
|
||||
}
|
||||
|
||||
//生成继电器图并保存数据
|
||||
generateRelayLayout(generateRelays);
|
||||
|
Loading…
Reference in New Issue
Block a user