SampleSmart 1.0.0.0
SampleSmart 사용 방법을 보여 주는 예제 프로젝트입니다.
로딩중...
검색중...
일치하는것 없음
SampleSmart.Pages.PageSub.CommunicationTabs.Serial.SerialPortTestViewEvent 클래스 참조sealed

더 자세히 ...

SampleSmart.Pages.PageSub.CommunicationTabs.Serial.SerialPortTestViewEvent에 대한 협력 다이어그램:

Public 멤버 함수

 SerialPortTestViewEvent (CommunicationSampleRuntime runtime)
void RefreshPorts ()
void ConnectSerial ()
void DisconnectSerial ()
void SendSerial ()

속성

ObservableCollection< string > SerialPortNames [get]
IReadOnlyList< int > BaudRates [get]
IReadOnlyList< string > SerialProtocols [get]
IReadOnlyList< string > SerialEncodings [get]
string SelectedSerialPortName = string.Empty [get, set]
int SelectedBaudRate [get, set]
string SelectedSerialProtocol = string.Empty [get, set]
string SelectedSerialEncoding [get, set]
string SerialSendText = string.Empty [get, set]
string SerialSelectionSummary [get]

Private 멤버 함수

void AddFallbackPorts ()

Private 속성

readonly CommunicationSampleRuntime _runtime

상세한 설명

Serial Port 테스트 이벤트 처리 클래스입니다.

SerialPortTestView.xaml.Event.cs 파일의 16 번째 라인에서 정의되었습니다.

생성자 & 소멸자 문서화

◆ SerialPortTestViewEvent()

SampleSmart.Pages.PageSub.CommunicationTabs.Serial.SerialPortTestViewEvent.SerialPortTestViewEvent ( CommunicationSampleRuntime runtime)
inline

SerialPortTestViewEvent 클래스의 새 인스턴스를 초기화합니다.

매개변수
runtimeCommunication 샘플 공유 Runtime입니다.
예외
ArgumentNullException필수 입력 인자 중 하나가 null인 경우 발생합니다.

SerialPortTestView.xaml.Event.cs 파일의 52 번째 라인에서 정의되었습니다.

53 {
54 _runtime = runtime ?? throw new ArgumentNullException(nameof(runtime));
55
56 SerialPortNames = new ObservableCollection<string>();
57
58 BaudRates =
59 [
60 9600,
61 19200,
62 38400,
63 57600,
64 115200
65 ];
66
67 SerialProtocols =
68 [
69 "PlainText",
70 "RawAvailable",
71 "RawJson"
72 ];
73
74 SelectedBaudRate = 9600;
75 SelectedSerialProtocol = "RawAvailable";
76 SelectedSerialEncoding = PlainTextProtocolOptions.Utf8EncodingName;
77 SerialSendText = "test";
78
79 RefreshPorts();
80 }

다음을 참조함 : _runtime, BaudRates, RefreshPorts(), SelectedBaudRate, SelectedSerialEncoding, SelectedSerialProtocol, SerialPortNames, SerialProtocols, SerialSendText.

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

멤버 함수 문서화

◆ AddFallbackPorts()

void SampleSmart.Pages.PageSub.CommunicationTabs.Serial.SerialPortTestViewEvent.AddFallbackPorts ( )
inlineprivate

Fallback Ports 항목을 추가합니다.

SerialPortTestView.xaml.Event.cs 파일의 282 번째 라인에서 정의되었습니다.

283 {
284 for (var index = 1; index <= 10; index++)
285 {
286 SerialPortNames.Add($"COM{index}");
287 }
288 }

다음을 참조함 : SerialPortNames.

다음에 의해서 참조됨 : RefreshPorts().

이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ ConnectSerial()

void SampleSmart.Pages.PageSub.CommunicationTabs.Serial.SerialPortTestViewEvent.ConnectSerial ( )
inline

Serial Port 연결을 시작합니다.

SerialPortTestView.xaml.Event.cs 파일의 226 번째 라인에서 정의되었습니다.

227 {
228 if (string.IsNullOrWhiteSpace(SelectedSerialPortName))
229 {
230 return;
231 }
232
233 _ = _runtime.ConnectSerialAsync(
234 SelectedSerialPortName,
235 SelectedBaudRate,
236 SelectedSerialProtocol,
237 SelectedSerialEncoding);
238 }

다음을 참조함 : _runtime, SelectedBaudRate, SelectedSerialEncoding, SelectedSerialPortName, SelectedSerialProtocol.

◆ DisconnectSerial()

void SampleSmart.Pages.PageSub.CommunicationTabs.Serial.SerialPortTestViewEvent.DisconnectSerial ( )
inline

Serial Port 연결을 해제합니다.

SerialPortTestView.xaml.Event.cs 파일의 248 번째 라인에서 정의되었습니다.

249 {
250 _ = _runtime.DisconnectSerialAsync();
251 }

다음을 참조함 : _runtime.

◆ RefreshPorts()

void SampleSmart.Pages.PageSub.CommunicationTabs.Serial.SerialPortTestViewEvent.RefreshPorts ( )
inline

Serial Port 목록을 갱신합니다.

SerialPortTestView.xaml.Event.cs 파일의 191 번째 라인에서 정의되었습니다.

192 {
193 SerialPortNames.Clear();
194
195 var portNames = SerialPort.GetPortNames()
196 .OrderBy(x => x, StringComparer.OrdinalIgnoreCase)
197 .ToArray();
198
199 if (portNames.Length == 0)
200 {
201 AddFallbackPorts();
202 }
203 else
204 {
205 foreach (var portName in portNames)
206 {
207 SerialPortNames.Add(portName);
208 }
209 }
210
211 if (string.IsNullOrWhiteSpace(SelectedSerialPortName) ||
212 !SerialPortNames.Contains(SelectedSerialPortName))
213 {
214 SelectedSerialPortName = SerialPortNames.FirstOrDefault() ?? string.Empty;
215 }
216 }

다음을 참조함 : AddFallbackPorts(), SelectedSerialPortName, SerialPortNames.

다음에 의해서 참조됨 : SerialPortTestViewEvent().

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:
이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ SendSerial()

void SampleSmart.Pages.PageSub.CommunicationTabs.Serial.SerialPortTestViewEvent.SendSerial ( )
inline

Serial 메시지를 송신합니다.

SerialPortTestView.xaml.Event.cs 파일의 261 번째 라인에서 정의되었습니다.

262 {
263 if (string.IsNullOrWhiteSpace(SerialSendText))
264 {
265 SerialSendText = "test";
266 }
267
268 _ = _runtime.SendSerialAsync(
269 SelectedSerialProtocol,
270 SerialSendText,
271 SelectedSerialEncoding);
272 }

다음을 참조함 : _runtime, SelectedSerialEncoding, SelectedSerialProtocol, SerialSendText.

멤버 데이터 문서화

◆ _runtime

readonly CommunicationSampleRuntime SampleSmart.Pages.PageSub.CommunicationTabs.Serial.SerialPortTestViewEvent._runtime
private

runtime 값을 보관합니다.

SerialPortTestView.xaml.Event.cs 파일의 26 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : ConnectSerial(), DisconnectSerial(), SendSerial(), SerialPortTestViewEvent().

속성 문서화

◆ BaudRates

IReadOnlyList<int> SampleSmart.Pages.PageSub.CommunicationTabs.Serial.SerialPortTestViewEvent.BaudRates
get

선택 가능한 BaudRate 목록입니다.

SerialPortTestView.xaml.Event.cs 파일의 100 번째 라인에서 정의되었습니다.

100{ get; }

다음에 의해서 참조됨 : SerialPortTestViewEvent().

◆ SelectedBaudRate

int SampleSmart.Pages.PageSub.CommunicationTabs.Serial.SerialPortTestViewEvent.SelectedBaudRate
getset

선택된 BaudRate입니다.

SerialPortTestView.xaml.Event.cs 파일의 140 번째 라인에서 정의되었습니다.

140{ get; set; }

다음에 의해서 참조됨 : ConnectSerial(), SerialPortTestViewEvent().

◆ SelectedSerialEncoding

string SampleSmart.Pages.PageSub.CommunicationTabs.Serial.SerialPortTestViewEvent.SelectedSerialEncoding
getset

선택된 Serial 문자열 인코딩입니다.

SerialPortTestView.xaml.Event.cs 파일의 160 번째 라인에서 정의되었습니다.

160{ get; set; }

다음에 의해서 참조됨 : ConnectSerial(), SendSerial(), SerialPortTestViewEvent().

◆ SelectedSerialPortName

string SampleSmart.Pages.PageSub.CommunicationTabs.Serial.SerialPortTestViewEvent.SelectedSerialPortName = string.Empty
getset

선택된 Serial Port 이름입니다.

SerialPortTestView.xaml.Event.cs 파일의 130 번째 라인에서 정의되었습니다.

130{ get; set; } = string.Empty;

다음에 의해서 참조됨 : ConnectSerial(), RefreshPorts().

◆ SelectedSerialProtocol

string SampleSmart.Pages.PageSub.CommunicationTabs.Serial.SerialPortTestViewEvent.SelectedSerialProtocol = string.Empty
getset

선택된 Serial 프로토콜입니다.

SerialPortTestView.xaml.Event.cs 파일의 150 번째 라인에서 정의되었습니다.

150{ get; set; } = string.Empty;

다음에 의해서 참조됨 : ConnectSerial(), SendSerial(), SerialPortTestViewEvent().

◆ SerialEncodings

IReadOnlyList<string> SampleSmart.Pages.PageSub.CommunicationTabs.Serial.SerialPortTestViewEvent.SerialEncodings
get

선택 가능한 Serial 문자열 인코딩 목록입니다.

SerialPortTestView.xaml.Event.cs 파일의 120 번째 라인에서 정의되었습니다.

◆ SerialPortNames

ObservableCollection<string> SampleSmart.Pages.PageSub.CommunicationTabs.Serial.SerialPortTestViewEvent.SerialPortNames
get

선택 가능한 Serial Port 이름 목록입니다.

SerialPortTestView.xaml.Event.cs 파일의 90 번째 라인에서 정의되었습니다.

90{ get; }

다음에 의해서 참조됨 : AddFallbackPorts(), RefreshPorts(), SerialPortTestViewEvent().

◆ SerialProtocols

IReadOnlyList<string> SampleSmart.Pages.PageSub.CommunicationTabs.Serial.SerialPortTestViewEvent.SerialProtocols
get

선택 가능한 Serial 프로토콜 목록입니다.

SerialPortTestView.xaml.Event.cs 파일의 110 번째 라인에서 정의되었습니다.

110{ get; }

다음에 의해서 참조됨 : SerialPortTestViewEvent().

◆ SerialSelectionSummary

string SampleSmart.Pages.PageSub.CommunicationTabs.Serial.SerialPortTestViewEvent.SerialSelectionSummary
get

현재 Serial 선택 상태 요약 문자열입니다.

SerialPortTestView.xaml.Event.cs 파일의 180 번째 라인에서 정의되었습니다.

◆ SerialSendText

string SampleSmart.Pages.PageSub.CommunicationTabs.Serial.SerialPortTestViewEvent.SerialSendText = string.Empty
getset

Serial 송신 문자열입니다.

SerialPortTestView.xaml.Event.cs 파일의 170 번째 라인에서 정의되었습니다.

170{ get; set; } = string.Empty;

다음에 의해서 참조됨 : SendSerial(), SerialPortTestViewEvent().


이 클래스에 대한 문서화 페이지는 다음의 파일로부터 생성되었습니다.: