EndpointDiscovery QML Type
서버에서 사용 가능한 엔드포인트에 대한 정보를 제공합니다. 더 보기...
| Import Statement: | import QtOpcUa |
| Since: | QtOpcUa 5.13 |
| Status: | Deprecated since 6.9 |
이 유형은 QtOpcUa 6.9부터 더 이상 사용되지 않습니다. 새로운 코드에서는 이 유형을 사용하지 않는 것을 강력히 권장합니다.
속성
- connection : Connection
- count : int
- serverUrl : string
- status : Status
신호
방법
- EndpointDescription at(index)
상세 설명
서버에서 사용 가능한 엔드포인트에 대한 정보를 가져오고 액세스할 수 있게 해줍니다.
QtOpcUa.Connection {
id: connection
backend: availableBackends[0]
defaultConnection: true
}
QtOpcUa.ServerDiscovery {
discoveryUrl: "opc.tcp://127.0.0.1:43344"
onServersChanged: {
if (status.isGood) {
if (status.status == QtOpcUa.Status.GoodCompletesAsynchronusly)
return; // wait until finished
if (count > 0) {
// choose right server
endpointDiscovery.serverUrl = at(0).discoveryUrls[0];
console.log("Using server URL:", endpointDiscovery.serverUrl);
} else {
// no servers retrieved
}
} else {
// Fetching servers failed
console.log("Error fetching server:", servers.status.status);
}
}
}
QtOpcUa.EndpointDiscovery {
id: endpointDiscovery
onEndpointsChanged: {
if (status.isGood) {
if (status.status == QtOpcUa.Status.GoodCompletesAsynchronusly)
return; // wait until finished
if (count > 0) {
// choose right endpoint
console.log("Using endpoint", at(0).endpointUrl, at(0).securityPolicy);
connection.connectToEndpoint(at(0));
} else {
// no endpoints retrieved
}
} else {
// Fetching endpoints failed
console.log("Error fetching endpoints:", status.status);
}
}
}속성 설명
connection : Connection
정보를 요청하는 데 사용할 연결입니다.
이 속성이 설정되지 않은 경우, 기본 연결이 있는 경우 해당 연결이 사용됩니다.
Connection 및 Connection::defaultConnection도 참조하십시오 .
count : int
이 요소에 포함된 현재 엔드포인트 수입니다. 엔드포인트 검색 결과를 사용하기 전에, status 에서 정보가 정상적으로 검색되었는지 확인해야 합니다.
serverUrl : string
엔드포인트를 가져올 서버의 검색 URL입니다. URL이 변경될 때마다 지정된 서버에 대한 요청이 시작됩니다.
요청을 시작할 때, 사용 가능한 엔드포인트 목록은 초기화되며 상태는 Status.GoodCompletesAsynchronously 로 설정됩니다. 요청이 완료되면 status 의 상태가 변경됩니다.
엔드포인트 목록에 접근하기 전에 반드시 status 을 확인하십시오.
endpointsChanged도 참조하십시오 .
status : Status
이 요소의 현재 상태입니다. 엔드포인트의 마지막 조회 작업이 성공적으로 완료된 경우, 상태는 ‘ Status.Good ’입니다.
if (endpoints.status.isGood) {
// do something
} else {
// handle error
}Status도 참조하십시오 .
Signal 문서
endpointsChanged()
검색 요청이 시작, 완료 또는 실패했을 때 발생합니다. 호출된 함수에서는 먼저 객체의 ` status `를 확인해야 합니다. 상태가 ` Status.GoodCompletesAsynchronously`인 경우, 요청이 아직 진행 중입니다. 상태가 ` Status.Good`인 경우, 요청이 완료되었으며 엔드포인트 설명을 읽을 수 있습니다. 상태가 정상적이지 않은 경우 오류가 발생한 것이며, ` status `에 반환된 오류 코드가 포함되어 있습니다.
onEndpointsChanged: {
if (endpoints.status.isGood) {
if (endpoints.status.status == QtOpcua.Status.GoodCompletesAsynchronusly)
return; // wait until finished
if (endpoints.count > 0) {
var endpointUrl = endpoints.at(0).endpointUrl();
console.log(endpointUrl);
}
} else {
// handle error
}
}참고: 해당 핸들러는 onEndpointsChanged 입니다.
status, count, at, Status 및 EndpointDescription도 참조하십시오 .
메서드 문서
EndpointDescription at(index)
지정된 index 에 대한 엔드포인트 설명을 반환합니다. 사용 가능한 엔드포인트가 없거나 인덱스가 유효하지 않은 경우, 유효하지 않은 엔드포인트 설명이 반환됩니다. 이 정보를 사용하기 전에 status 을 확인하여 정보 검색이 성공적으로 이루어졌는지 확인해야 합니다.
if (endpoints.status.isGood) {
if (endpoints.count > 0)
var endpointUrl = endpoints.at(0).endpointUrl();
console.log(endpointUrl);
} else {
// handle error
}count, status 및 EndpointDescription도 참조하십시오 .
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.