@momo2555/koppeliajs 0.0.98 → 0.0.99
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -58,7 +58,7 @@ export declare class Console {
|
|
|
58
58
|
* @param callback
|
|
59
59
|
*/
|
|
60
60
|
onReady(callback: () => void): void;
|
|
61
|
-
onDeviceEvent(callback:
|
|
61
|
+
onDeviceEvent(callback: DeviceEventCallback): void;
|
|
62
62
|
onRequest(callback: AnyRequestCallback): void;
|
|
63
63
|
/**
|
|
64
64
|
* Get if the connection with the console is ready
|
package/dist/scripts/device.js
CHANGED
|
@@ -31,7 +31,11 @@ export class Device {
|
|
|
31
31
|
}
|
|
32
32
|
onEvent(eventName, callback) {
|
|
33
33
|
this._attachEvent(eventName);
|
|
34
|
-
|
|
34
|
+
let consoleEvent = (device, from_addr, event) => {
|
|
35
|
+
if (event == eventName && from_addr == this._address)
|
|
36
|
+
callback();
|
|
37
|
+
};
|
|
38
|
+
this._console.onDeviceEvent(consoleEvent);
|
|
35
39
|
}
|
|
36
40
|
onZPosition(callback) {
|
|
37
41
|
this._enableModule("zPos");
|