fix: 后置机拿不到信号问题
This commit is contained in:
parent
7bd3689593
commit
a52a13e6d9
@ -12,9 +12,6 @@ class differentialAndSignal {
|
|||||||
|
|
||||||
// 初始化Worker
|
// 初始化Worker
|
||||||
init() {
|
init() {
|
||||||
if (this.workerInstance) {
|
|
||||||
this.close();
|
|
||||||
}
|
|
||||||
this.workerInstance = new worker.ThreadWorker("entry/ets/workers/DifferentialCorrection.ets");
|
this.workerInstance = new worker.ThreadWorker("entry/ets/workers/DifferentialCorrection.ets");
|
||||||
let config: EnvironmentConfigurationType =
|
let config: EnvironmentConfigurationType =
|
||||||
AppStorage.get<EnvironmentConfigurationType>("EnvironmentConfiguration") || {
|
AppStorage.get<EnvironmentConfigurationType>("EnvironmentConfiguration") || {
|
||||||
@ -55,20 +52,15 @@ class differentialAndSignal {
|
|||||||
|
|
||||||
// 关闭
|
// 关闭
|
||||||
close() {
|
close() {
|
||||||
if (this.workerInstance) {
|
|
||||||
// 清空所有监听器
|
|
||||||
this.events = [];
|
this.events = [];
|
||||||
|
const config: EnvironmentConfigurationType = AppStorage.get<EnvironmentConfigurationType>("EnvironmentConfiguration") || {
|
||||||
// 发送关闭消息
|
}
|
||||||
const config = AppStorage.get<EnvironmentConfigurationType>("EnvironmentConfiguration") || {};
|
|
||||||
this.workerInstance.postMessage(JSON.stringify({
|
this.workerInstance.postMessage(JSON.stringify({
|
||||||
config: config,
|
config: config,
|
||||||
close: true
|
close: true
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// 关闭线程
|
// 关闭线程
|
||||||
this.workerInstance.terminate();
|
this.workerInstance.terminate()
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取Worker消息
|
// 获取Worker消息
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user