Merge remote-tracking branch 'origin/develop' into local-test

This commit is contained in:
joylink_fanyuhong 2024-04-08 08:24:05 +08:00
commit 6ec566d7ce
18 changed files with 229 additions and 23 deletions

@ -1 +1 @@
Subproject commit 208bcaedccf71e7bfd2535e2889ca4cf7c4bdbb6 Subproject commit e4728f0f732904f543a86aabb2c3da2653dd139f

View File

@ -21,7 +21,147 @@
<q-separator inset /> <q-separator inset />
<q-card-section> <q-card-section>
<q-list dense> <q-list dense>
<q-item v-for="(item, index) in list" :key="index"> <q-item v-for="(item, index) in list1" :key="index">
<q-item-section>
<q-item-label>{{ item.label }}</q-item-label>
</q-item-section>
<q-item-section side>
<q-item-label caption>{{
item.formatFn
? item.formatFn(carWashingState[item.key])
: carWashingState[item.key]
}}</q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-card-section>
<q-separator inset />
<q-card-section>
<q-list dense>
<q-item v-for="(item, index) in list2" :key="index">
<q-item-section>
<q-item-label>{{ item.label }}</q-item-label>
</q-item-section>
<q-item-section side>
<q-item-label caption>{{
item.formatFn
? item.formatFn(carWashingState[item.key])
: carWashingState[item.key]
}}</q-item-label>
</q-item-section>
</q-item>
<q-item v-for="(item, index) in list3" :key="index + list2.length">
<q-item-section>
<q-item-label>{{ item.label }}</q-item-label>
</q-item-section>
<q-item-section side>
<q-item-label caption
><span>[</span>
<span
v-if="carWashingState.twjList.length >= 1"
:style="{
color: carWashingState.twjList[0] ? 'green' : 'red',
}"
>{{
`1:${carWashingState.twjList[0] ? '结束' : '未结束'}`
}}</span
>
<span
v-if="carWashingState.twjList.length >= 2"
:style="{
color: carWashingState.twjList[1] ? 'green' : 'red',
}"
>{{
`2:${carWashingState.twjList[1] ? '结束' : '未结束'}`
}}</span
>
<span
v-if="carWashingState.twjList.length >= 3"
:style="{
color: carWashingState.twjList[2] ? 'green' : 'red',
}"
>{{
`3:${carWashingState.twjList[2] ? '结束' : '未结束'}`
}}</span
>
<span>]</span></q-item-label
>
</q-item-section>
</q-item>
<q-item
v-for="(item, index) in list4"
:key="index + list2.length + list3.length"
>
<q-item-section>
<q-item-label>{{ item.label }}</q-item-label>
</q-item-section>
<q-item-section side>
<q-item-label caption>{{
item.formatFn
? item.formatFn(carWashingState[item.key])
: carWashingState[item.key]
}}</q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-card-section>
<q-separator inset />
<q-card-section>
<q-list dense>
<q-item v-for="(item, index) in list5" :key="index">
<q-item-section>
<q-item-label>{{ item.label }}</q-item-label>
</q-item-section>
<q-item-section side>
<q-item-label caption>{{
item.formatFn
? item.formatFn(carWashingState[item.key])
: carWashingState[item.key]
}}</q-item-label>
</q-item-section>
</q-item>
<q-item v-for="(item, index) in list6" :key="index + list5.length">
<q-item-section>
<q-item-label>{{ item.label }}</q-item-label>
</q-item-section>
<q-item-section side>
<q-item-label caption>
<span>[</span>
<span
v-if="carWashingState.cfjList.length >= 1"
:style="{
color: carWashingState.cfjList[0] ? 'green' : 'red',
}"
>{{
`1:${carWashingState.cfjList[0] ? '结束' : '未结束'}`
}}</span
>
<span
v-if="carWashingState.cfjList.length >= 2"
:style="{
color: carWashingState.cfjList[1] ? 'green' : 'red',
}"
>{{
`2:${carWashingState.cfjList[1] ? '结束' : '未结束'}`
}}</span
>
<span
v-if="carWashingState.cfjList.length >= 3"
:style="{
color: carWashingState.cfjList[2] ? 'green' : 'red',
}"
>{{
`3:${carWashingState.cfjList[2] ? '结束' : '未结束'}`
}}</span
>
<span>]</span>
</q-item-label>
</q-item-section>
</q-item>
<q-item
v-for="(item, index) in list7"
:key="index + list5.length + list6.length"
>
<q-item-section> <q-item-section>
<q-item-label>{{ item.label }}</q-item-label> <q-item-label>{{ item.label }}</q-item-label>
</q-item-section> </q-item-section>
@ -64,15 +204,27 @@ interface KeyType {
formatFn?(v: CarWashingState[keyof CarWashingState]): string; formatFn?(v: CarWashingState[keyof CarWashingState]): string;
} }
const list: KeyType[] = [ const list1: KeyType[] = [
{ label: '洗车机索引', key: 'id' }, { label: '洗车机索引', key: 'id' },
{ label: '洗车机名称', key: 'code', formatFn: getNameFormat }, { label: '洗车机名称', key: 'code', formatFn: getNameFormat },
];
const list2: KeyType[] = [
{ label: '洗车请求', key: 'xqj', formatFn: getBoolFormat }, { label: '洗车请求', key: 'xqj', formatFn: getBoolFormat },
{ label: '是否停稳', key: 'twjList', formatFn: getTwFormat }, ];
const list3: KeyType[] = [
{ label: '端洗停稳 ', key: 'twjList', formatFn: getTwFormat },
];
const list4: KeyType[] = [
{ label: '通过请求', key: 'tgqj', formatFn: getBoolFormat }, { label: '通过请求', key: 'tgqj', formatFn: getBoolFormat },
];
const list5: KeyType[] = [
{ label: '洗车就绪', key: 'xcjxj', formatFn: getBoolFormat }, { label: '洗车就绪', key: 'xcjxj', formatFn: getBoolFormat },
{ label: '洗车允许', key: 'xcyxj', formatFn: getBoolFormat }, { label: '洗车允许', key: 'xcyxj', formatFn: getBoolFormat },
{ label: '移动允许', key: 'cfjList', formatFn: getYXFormat }, ];
const list6: KeyType[] = [
{ label: '端洗结束', key: 'cfjList', formatFn: getYXFormat },
];
const list7: KeyType[] = [
{ label: '紧急停车', key: 'jtj', formatFn: getBoolFormat }, { label: '紧急停车', key: 'jtj', formatFn: getBoolFormat },
{ label: '通过允许', key: 'tgyxj', formatFn: getBoolFormat }, { label: '通过允许', key: 'tgyxj', formatFn: getBoolFormat },
]; ];
@ -107,11 +259,11 @@ function getBoolFormat(v: boolean) {
} }
function getTwFormat(v: boolean[]) { function getTwFormat(v: boolean[]) {
if (v.length === 2) { if (v.length === 2) {
return `头部${v[0] ? '停稳' : '未停稳'};尾部${v[1] ? '停稳' : '未停稳'};`; return `[1:${v[0] ? '停稳' : '未停稳'};2:${v[1] ? '停稳' : '未停稳'};]`;
} else if (v.length === 3) { } else if (v.length === 3) {
return `头部${v[0] ? '停稳' : '未停稳'};中部${ return `[1:${v[0] ? '停稳' : '未停稳'};2:${v[1] ? '停稳' : '未停稳'};3:${
v[1] ? '停稳' : '未停稳' v[2] ? '停稳' : '未停稳'
};尾部${v[2] ? '停稳' : '未停稳'};`; };]`;
} else { } else {
return '状态显示错误'; return '状态显示错误';
} }
@ -132,7 +284,6 @@ function getYXFormat(v: boolean[]) {
function initCarWashingState(carWashing: CarWashing) { function initCarWashingState(carWashing: CarWashing) {
copySelectGraphic = toRaw(carWashing); copySelectGraphic = toRaw(carWashing);
code.value = carWashing.datas.code; code.value = carWashing.datas.code;
console.log(code.value, carWashing);
updateState(carWashing); updateState(carWashing);
subscribeState(carWashing); subscribeState(carWashing);

View File

@ -84,6 +84,7 @@ const list: KeyType[] = [
{ label: '防淹门名称', key: 'code', formatFn: getNameFormat }, { label: '防淹门名称', key: 'code', formatFn: getNameFormat },
{ label: '防淹门关闭', key: 'mgj', formatFn: getName }, { label: '防淹门关闭', key: 'mgj', formatFn: getName },
{ label: '控制端', key: 'local', formatFn: getLocal }, { label: '控制端', key: 'local', formatFn: getLocal },
{ label: '门旁路', key: 'mplj', formatFn: getName },
{ label: '防淹门强制', key: 'param', formatFn: getForceName }, { label: '防淹门强制', key: 'param', formatFn: getForceName },
{ label: '设置故障', key: 'param', formatFn: getFaultName }, { label: '设置故障', key: 'param', formatFn: getFaultName },
]; ];

View File

@ -84,6 +84,7 @@ const list: KeyType[] = [
{ label: '车库门名称', key: 'code', formatFn: getNameFormat }, { label: '车库门名称', key: 'code', formatFn: getNameFormat },
{ label: '车库门关闭', key: 'mgj', formatFn: getName }, { label: '车库门关闭', key: 'mgj', formatFn: getName },
{ label: '控制端', key: 'local', formatFn: getLocal }, { label: '控制端', key: 'local', formatFn: getLocal },
{ label: '门旁路', key: 'mplj', formatFn: getName },
// { label: '', key: 'stateLoss', formatFn: getName }, // { label: '', key: 'stateLoss', formatFn: getName },
{ label: '车库门强制', key: 'param', formatFn: getForceName }, { label: '车库门强制', key: 'param', formatFn: getForceName },
{ label: '设置故障', key: 'param', formatFn: getFaultName }, { label: '设置故障', key: 'param', formatFn: getFaultName },

View File

@ -9,7 +9,7 @@ function getHost(): string {
// return '192.168.3.7:9091'; // return '192.168.3.7:9091';
// return '192.168.3.47:9091'; // return '192.168.3.47:9091';
// return '192.168.3.37:9091'; // return '192.168.3.37:9091';
// return '192.168.33.207:9091'; // 张骞 return '192.168.33.207:9091'; // 张骞
// return '192.168.33.93:9091'; // return '192.168.33.93:9091';
// return '192.168.3.37:9091'; //卫志宏 // return '192.168.3.37:9091'; //卫志宏
// return 'test.joylink.club/bjrtsts-service'; // 测试 // return 'test.joylink.club/bjrtsts-service'; // 测试

View File

@ -114,6 +114,12 @@ export class FloodGateState
set local(v: boolean) { set local(v: boolean) {
this.states.local = v; this.states.local = v;
} }
get mplj() {
return this.states.mplj;
}
set mplj(v: boolean) {
this.states.mplj = v;
}
get states(): state.CkmState { get states(): state.CkmState {
return this.getState<state.CkmState>(); return this.getState<state.CkmState>();
} }

View File

@ -114,6 +114,12 @@ export class GarageDoorState
set local(v: boolean) { set local(v: boolean) {
this.states.local = v; this.states.local = v;
} }
get mplj() {
return this.states.mplj;
}
set mplj(v: boolean) {
this.states.mplj = v;
}
get states(): state.CkmState { get states(): state.CkmState {
return this.getState<state.CkmState>(); return this.getState<state.CkmState>();
} }

View File

@ -81,6 +81,12 @@ export class PslButtonState
set down(v: boolean) { set down(v: boolean) {
this.states.down = v; this.states.down = v;
} }
get active(): boolean {
return this.states.active;
}
set active(v: boolean) {
this.states.active = v;
}
get states(): state.ButtonState { get states(): state.ButtonState {
return this.getState<state.ButtonState>(); return this.getState<state.ButtonState>();
} }

View File

@ -86,6 +86,7 @@ export class TccHandleInteraction extends GraphicInteractionPlugin<TccHandle> {
isMouseDown = false; isMouseDown = false;
mouseDownBeginPos = 0; mouseDownBeginPos = 0;
mouseDownTccHandleBeginPos = 0; mouseDownTccHandleBeginPos = 0;
timeout: string | number | NodeJS.Timeout | undefined;
constructor(app: IGraphicScene) { constructor(app: IGraphicScene) {
super(TccHandleInteraction.Name, app); super(TccHandleInteraction.Name, app);
} }
@ -116,6 +117,7 @@ export class TccHandleInteraction extends GraphicInteractionPlugin<TccHandle> {
g._tccHandle.onmousedown = null; g._tccHandle.onmousedown = null;
g._tccHandle.onmouseup = null; g._tccHandle.onmouseup = null;
g.onmousemove = null; g.onmousemove = null;
clearTimeout(this.timeout);
} }
onMouseDown(e: FederatedMouseEvent) { onMouseDown(e: FederatedMouseEvent) {
const target = e.target as DisplayObject; const target = e.target as DisplayObject;
@ -144,6 +146,10 @@ export class TccHandleInteraction extends GraphicInteractionPlugin<TccHandle> {
} else if (tccHandle._tccHandle.y <= -145) { } else if (tccHandle._tccHandle.y <= -145) {
tccHandle._tccHandle.y = -144; tccHandle._tccHandle.y = -144;
} }
clearTimeout(this.timeout);
this.timeout = setTimeout(() => {
useTccStore().onMouseUpFromTccHandle();
}, 100);
} }
} }
onMouseUp() { onMouseUp() {

View File

@ -207,6 +207,7 @@ export abstract class KeyInteraction<
if (this.lastTimenRotation !== this.changeRotation) { if (this.lastTimenRotation !== this.changeRotation) {
this.lastTimenRotation = this.changeRotation; this.lastTimenRotation = this.changeRotation;
this.ratatingSprite.rotation = this.changeRotation; this.ratatingSprite.rotation = this.changeRotation;
useTccStore().onMouseUpFromTccKeyDir();
} }
} else { } else {
if (direction == 'ssz') { if (direction == 'ssz') {

View File

@ -260,7 +260,6 @@ export function loadGatedRelateDeviceList() {
export function creatGatedRelateDevice(row: graphicData.DeviceCombinationtype) { export function creatGatedRelateDevice(row: graphicData.DeviceCombinationtype) {
refDevicesList.push(row); refDevicesList.push(row);
console.log(refDevicesList, '====');
drawApp?.emit('postdataloaded'); drawApp?.emit('postdataloaded');
} }

View File

@ -69,15 +69,17 @@ function handleSubscribe(pslScene: IGraphicScene) {
const states: GraphicState[] = []; const states: GraphicState[] = [];
const storage = state.PushedDevicesStatus.deserialize(message); const storage = state.PushedDevicesStatus.deserialize(message);
if (storage.all) { if (storage.all) {
// storage.allStatus.buttonState.forEach((item) => { storage.allStatus.buttonState.forEach((item) => {
// if (item.id) { if (item.id) {
// states.push(new PslButtonState(item)); states.push(new PslButtonState(item));
// } }
// }); });
} }
// console.log(states, 'states');
return states; return states;
}, },
graphicQueryer: (state, store) => {
return store.queryById(+state.code);
},
}); });
} }

View File

@ -60,11 +60,9 @@ export function initTccScene(lineApp: IGraphicApp, sceneName: string) {
tccScene.canvas.onmouseup = () => { tccScene.canvas.onmouseup = () => {
tccStore.canvasMouseDown = false; tccStore.canvasMouseDown = false;
if (tccStore.mouseDownOnTccHandle) { if (tccStore.mouseDownOnTccHandle) {
tccStore.onMouseUpFromTccHandle();
tccStore.mouseDownOnTccHandle = false; tccStore.mouseDownOnTccHandle = false;
} }
if (tccStore.mouseDownOnTccKeyDir) { if (tccStore.mouseDownOnTccKeyDir) {
tccStore.onMouseUpFromTccKeyDir();
tccStore.mouseDownOnTccKeyDir = false; tccStore.mouseDownOnTccKeyDir = false;
} }
}; };

View File

@ -128,10 +128,10 @@ export class CarWashing extends JlGraphic {
} else if (this.states.tgyxj) { } else if (this.states.tgyxj) {
stateText = '通过'; stateText = '通过';
} else if (this.states.cfjList.length === 2) { } else if (this.states.cfjList.length === 2) {
if (this.states.cfjList[0]) { if (this.states.cfjList[1]) {
stateText = '头部';
} else if (this.states.cfjList[1]) {
stateText = '尾部'; stateText = '尾部';
} else if (this.states.cfjList[0]) {
stateText = '头部';
} }
} else if (this.states.cfjList.length === 3) { } else if (this.states.cfjList.length === 3) {
if (this.states.cfjList[1]) { if (this.states.cfjList[1]) {

View File

@ -33,6 +33,8 @@ export interface IFloodGateState extends GraphicState {
set param(v: request.CkmParam); set param(v: request.CkmParam);
get local(): boolean; get local(): boolean;
set local(v: boolean); set local(v: boolean);
get mplj(): boolean;
set mplj(v: boolean);
} }
const garageConsts = { const garageConsts = {

View File

@ -33,6 +33,8 @@ export interface IGarageDoorState extends GraphicState {
set param(v: request.CkmParam); set param(v: request.CkmParam);
get local(): boolean; get local(): boolean;
set local(v: boolean); set local(v: boolean);
get mplj(): boolean;
set mplj(v: boolean);
} }
const garageConsts = { const garageConsts = {

View File

@ -31,6 +31,8 @@ export interface IPslButtonState extends GraphicState {
set code(v: string); set code(v: string);
get down(): boolean; get down(): boolean;
set down(v: boolean); set down(v: boolean);
get active(): boolean;
set active(v: boolean);
} }
export class PslButton extends JlGraphic { export class PslButton extends JlGraphic {

View File

@ -8030,6 +8030,7 @@ export namespace state {
mgj?: boolean; mgj?: boolean;
param?: dependency_3.request.CkmParam; param?: dependency_3.request.CkmParam;
local?: boolean; local?: boolean;
mplj?: boolean;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
@ -8046,6 +8047,9 @@ export namespace state {
if ("local" in data && data.local != undefined) { if ("local" in data && data.local != undefined) {
this.local = data.local; this.local = data.local;
} }
if ("mplj" in data && data.mplj != undefined) {
this.mplj = data.mplj;
}
} }
} }
get id() { get id() {
@ -8075,11 +8079,18 @@ export namespace state {
set local(value: boolean) { set local(value: boolean) {
pb_1.Message.setField(this, 4, value); pb_1.Message.setField(this, 4, value);
} }
get mplj() {
return pb_1.Message.getFieldWithDefault(this, 5, false) as boolean;
}
set mplj(value: boolean) {
pb_1.Message.setField(this, 5, value);
}
static fromObject(data: { static fromObject(data: {
id?: number; id?: number;
mgj?: boolean; mgj?: boolean;
param?: ReturnType<typeof dependency_3.request.CkmParam.prototype.toObject>; param?: ReturnType<typeof dependency_3.request.CkmParam.prototype.toObject>;
local?: boolean; local?: boolean;
mplj?: boolean;
}): CkmState { }): CkmState {
const message = new CkmState({}); const message = new CkmState({});
if (data.id != null) { if (data.id != null) {
@ -8094,6 +8105,9 @@ export namespace state {
if (data.local != null) { if (data.local != null) {
message.local = data.local; message.local = data.local;
} }
if (data.mplj != null) {
message.mplj = data.mplj;
}
return message; return message;
} }
toObject() { toObject() {
@ -8102,6 +8116,7 @@ export namespace state {
mgj?: boolean; mgj?: boolean;
param?: ReturnType<typeof dependency_3.request.CkmParam.prototype.toObject>; param?: ReturnType<typeof dependency_3.request.CkmParam.prototype.toObject>;
local?: boolean; local?: boolean;
mplj?: boolean;
} = {}; } = {};
if (this.id != null) { if (this.id != null) {
data.id = this.id; data.id = this.id;
@ -8115,6 +8130,9 @@ export namespace state {
if (this.local != null) { if (this.local != null) {
data.local = this.local; data.local = this.local;
} }
if (this.mplj != null) {
data.mplj = this.mplj;
}
return data; return data;
} }
serialize(): Uint8Array; serialize(): Uint8Array;
@ -8129,6 +8147,8 @@ export namespace state {
writer.writeMessage(3, this.param, () => this.param.serialize(writer)); writer.writeMessage(3, this.param, () => this.param.serialize(writer));
if (this.local != false) if (this.local != false)
writer.writeBool(4, this.local); writer.writeBool(4, this.local);
if (this.mplj != false)
writer.writeBool(5, this.mplj);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
} }
@ -8150,6 +8170,9 @@ export namespace state {
case 4: case 4:
message.local = reader.readBool(); message.local = reader.readBool();
break; break;
case 5:
message.mplj = reader.readBool();
break;
default: reader.skipField(); default: reader.skipField();
} }
} }