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

더 자세히 ...

SampleSmart.Pages.PageSub.IoTabs.SampleFastech16PointProtocol에 대한 상속 다이어그램 :
SampleSmart.Pages.PageSub.IoTabs.SampleFastech16PointProtocol에 대한 협력 다이어그램:

Public 멤버 함수

byte[] BuildReadDigitalInputs (IReadOnlyList< IoPoint > points)
IoResult< bool[]> ParseDigitalInputs (IReadOnlyList< byte > responseFrame, int count)
byte[] BuildReadDigitalOutputs (IReadOnlyList< IoPoint > points)
IoResult< bool[]> ParseDigitalOutputs (IReadOnlyList< byte > responseFrame, int count)
byte[] BuildWriteDigitalOutputs (IReadOnlyDictionary< IoPoint, bool > values)
byte[] BuildReadAnalogInputs (IReadOnlyList< AnalogIoPoint > points)
IoResult< double[]> ParseAnalogInputs (IReadOnlyList< byte > responseFrame, int count)
byte[] BuildReadAnalogOutputs (IReadOnlyList< AnalogIoPoint > points)
IoResult< double[]> ParseAnalogOutputs (IReadOnlyList< byte > responseFrame, int count)
byte[] BuildWriteAnalogOutputs (IReadOnlyDictionary< AnalogIoPoint, double > values)
IoResult ParseWriteResponse (IReadOnlyList< byte > responseFrame)

정적 Private 멤버 함수

static IoResult< bool[]> ParseBits (IReadOnlyList< byte > responseFrame, string prefix, int count)
static byte[] Encode (string text)
static string Decode (IReadOnlyList< byte > bytes)

정적 Private 속성

const string ReadDigitalInputsCommand = "RDI"
const string ReadDigitalOutputsCommand = "RDO"
const string WriteDigitalOutputsCommand = "WDO"
const string AckResponse = "OK"

상세한 설명

Sample Fastech16 Point Protocol 기능과 관련 상태를 캡슐화합니다.

이 멤버의 동작과 사용 시 고려 사항을 설명합니다.

SampleFastech16PointProtocol.cs 파일의 24 번째 라인에서 정의되었습니다.

멤버 함수 문서화

◆ BuildReadAnalogInputs()

byte[] SampleSmart.Pages.PageSub.IoTabs.SampleFastech16PointProtocol.BuildReadAnalogInputs ( IReadOnlyList< AnalogIoPoint > points)
inline

Read Analog Inputs 값을 구성합니다.

매개변수
pointspoints에 사용할 IReadOnlyList<AnalogIoPoint> 값입니다.
반환값
Build Read Analog Inputs 작업에서 생성한 byte[] 결과입니다.
예외
NotSupportedException요청한 작업이 지원되지 않는 경우 발생합니다.

SampleFastech16PointProtocol.cs 파일의 267 번째 라인에서 정의되었습니다.

268 {
269 throw new NotSupportedException("The 16/16 sample covers digital I/O only.");
270 }

◆ BuildReadAnalogOutputs()

byte[] SampleSmart.Pages.PageSub.IoTabs.SampleFastech16PointProtocol.BuildReadAnalogOutputs ( IReadOnlyList< AnalogIoPoint > points)
inline

Read Analog Outputs 값을 구성합니다.

매개변수
pointspoints에 사용할 IReadOnlyList<AnalogIoPoint> 값입니다.
반환값
Build Read Analog Outputs 작업에서 생성한 byte[] 결과입니다.
예외
NotSupportedException요청한 작업이 지원되지 않는 경우 발생합니다.

SampleFastech16PointProtocol.cs 파일의 341 번째 라인에서 정의되었습니다.

342 {
343 throw new NotSupportedException("The 16/16 sample covers digital I/O only.");
344 }

◆ BuildReadDigitalInputs()

byte[] SampleSmart.Pages.PageSub.IoTabs.SampleFastech16PointProtocol.BuildReadDigitalInputs ( IReadOnlyList< IoPoint > points)
inline

Read Digital Inputs 값을 구성합니다.

매개변수
pointspoints에 사용할 IReadOnlyList<IoPoint> 값입니다.
반환값
Build Read Digital Inputs 작업에서 생성한 byte[] 결과입니다.

SampleFastech16PointProtocol.cs 파일의 87 번째 라인에서 정의되었습니다.

88 {
89 ArgumentNullException.ThrowIfNull(points);
90
91 return Encode($"{ReadDigitalInputsCommand} {points.Count}");
92 }

다음을 참조함 : Encode().

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

◆ BuildReadDigitalOutputs()

byte[] SampleSmart.Pages.PageSub.IoTabs.SampleFastech16PointProtocol.BuildReadDigitalOutputs ( IReadOnlyList< IoPoint > points)
inline

Read Digital Outputs 값을 구성합니다.

매개변수
pointspoints에 사용할 IReadOnlyList<IoPoint> 값입니다.
반환값
Build Read Digital Outputs 작업에서 생성한 byte[] 결과입니다.

SampleFastech16PointProtocol.cs 파일의 155 번째 라인에서 정의되었습니다.

156 {
157 ArgumentNullException.ThrowIfNull(points);
158
159 return Encode($"{ReadDigitalOutputsCommand} {points.Count}");
160 }

다음을 참조함 : Encode().

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

◆ BuildWriteAnalogOutputs()

byte[] SampleSmart.Pages.PageSub.IoTabs.SampleFastech16PointProtocol.BuildWriteAnalogOutputs ( IReadOnlyDictionary< AnalogIoPoint, double > values)
inline

Write Analog Outputs 값을 구성합니다.

매개변수
valuesvalues에 사용할 IReadOnlyDictionary<AnalogIoPoint, double> 값입니다.
반환값
Build Write Analog Outputs 작업에서 생성한 byte[] 결과입니다.
예외
NotSupportedException요청한 작업이 지원되지 않는 경우 발생합니다.

SampleFastech16PointProtocol.cs 파일의 415 번째 라인에서 정의되었습니다.

416 {
417 throw new NotSupportedException("The 16/16 sample covers digital I/O only.");
418 }

◆ BuildWriteDigitalOutputs()

byte[] SampleSmart.Pages.PageSub.IoTabs.SampleFastech16PointProtocol.BuildWriteDigitalOutputs ( IReadOnlyDictionary< IoPoint, bool > values)
inline

Write Digital Outputs 값을 구성합니다.

매개변수
valuesvalues에 사용할 IReadOnlyDictionary<IoPoint, bool> 값입니다.
반환값
Build Write Digital Outputs 작업에서 생성한 byte[] 결과입니다.

SampleFastech16PointProtocol.cs 파일의 223 번째 라인에서 정의되었습니다.

224 {
225 ArgumentNullException.ThrowIfNull(values);
226
227 var orderedValues = values
228 .OrderBy(x => x.Key.Module)
229 .ThenBy(x => x.Key.Channel)
230 .Select(x => x.Value ? '1' : '0');
231
232 return Encode($"{WriteDigitalOutputsCommand} {new string(orderedValues.ToArray())}");
233 }

다음을 참조함 : Encode().

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

◆ Decode()

string SampleSmart.Pages.PageSub.IoTabs.SampleFastech16PointProtocol.Decode ( IReadOnlyList< byte > bytes)
inlinestaticprivate

Decode 작업을 수행합니다.

매개변수
bytesbytes에 사용할 IReadOnlyList<byte> 값입니다.
반환값
Decode 작업에서 생성한 string 결과입니다.

SampleFastech16PointProtocol.cs 파일의 569 번째 라인에서 정의되었습니다.

570 {
571 var buffer = bytes as byte[] ?? bytes.ToArray();
572 return Encoding.ASCII.GetString(buffer).Trim();
573 }

다음에 의해서 참조됨 : ParseBits(), ParseWriteResponse().

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

◆ Encode()

byte[] SampleSmart.Pages.PageSub.IoTabs.SampleFastech16PointProtocol.Encode ( string text)
inlinestaticprivate

Encode 작업을 수행합니다.

매개변수
texttext에 사용할 string 값입니다.
반환값
Encode 작업에서 생성한 byte[] 결과입니다.

SampleFastech16PointProtocol.cs 파일의 540 번째 라인에서 정의되었습니다.

541 {
542 return Encoding.ASCII.GetBytes(text);
543 }

다음에 의해서 참조됨 : BuildReadDigitalInputs(), BuildReadDigitalOutputs(), BuildWriteDigitalOutputs().

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

◆ ParseAnalogInputs()

IoResult< double[]> SampleSmart.Pages.PageSub.IoTabs.SampleFastech16PointProtocol.ParseAnalogInputs ( IReadOnlyList< byte > responseFrame,
int count )
inline

Parse Analog Inputs 작업을 수행합니다.

매개변수
responseFrameresponse Frame에 사용할 IReadOnlyList<byte> 값입니다.
countcount에 사용할 int 값입니다.
반환값
Parse Analog Inputs 작업에서 생성한 IoResult<double[]> 결과입니다.

SampleFastech16PointProtocol.cs 파일의 304 번째 라인에서 정의되었습니다.

305 {
306 return IoResult<double[]>.Failure("The 16/16 sample covers digital I/O only.");
307 }

◆ ParseAnalogOutputs()

IoResult< double[]> SampleSmart.Pages.PageSub.IoTabs.SampleFastech16PointProtocol.ParseAnalogOutputs ( IReadOnlyList< byte > responseFrame,
int count )
inline

Parse Analog Outputs 작업을 수행합니다.

매개변수
responseFrameresponse Frame에 사용할 IReadOnlyList<byte> 값입니다.
countcount에 사용할 int 값입니다.
반환값
Parse Analog Outputs 작업에서 생성한 IoResult<double[]> 결과입니다.

SampleFastech16PointProtocol.cs 파일의 378 번째 라인에서 정의되었습니다.

379 {
380 return IoResult<double[]>.Failure("The 16/16 sample covers digital I/O only.");
381 }

◆ ParseBits()

IoResult< bool[]> SampleSmart.Pages.PageSub.IoTabs.SampleFastech16PointProtocol.ParseBits ( IReadOnlyList< byte > responseFrame,
string prefix,
int count )
inlinestaticprivate

Parse Bits 작업을 수행합니다.

매개변수
responseFrameresponse Frame에 사용할 IReadOnlyList<byte> 값입니다.
prefixprefix에 사용할 string 값입니다.
countcount에 사용할 int 값입니다.
반환값
Parse Bits 작업에서 생성한 IoResult<bool[]> 결과입니다.

SampleFastech16PointProtocol.cs 파일의 492 번째 라인에서 정의되었습니다.

493 {
494 var text = Decode(responseFrame);
495 var expectedPrefix = $"{prefix} ";
496
497 if (!text.StartsWith(expectedPrefix, StringComparison.OrdinalIgnoreCase))
498 {
499 return IoResult<bool[]>.Failure($"Unexpected sample response: {text}");
500 }
501
502 var bitText = text[expectedPrefix.Length..].Trim();
503 if (bitText.Length < count)
504 {
505 return IoResult<bool[]>.Failure($"The sample response contains {bitText.Length} bits, but {count} were expected.");
506 }
507
508 var values = bitText
509 .Take(count)
510 .Select(x => x == '1')
511 .ToArray();
512
513 return IoResult<bool[]>.Success(values);
514 }

다음을 참조함 : Decode().

다음에 의해서 참조됨 : ParseDigitalInputs(), ParseDigitalOutputs().

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

◆ ParseDigitalInputs()

IoResult< bool[]> SampleSmart.Pages.PageSub.IoTabs.SampleFastech16PointProtocol.ParseDigitalInputs ( IReadOnlyList< byte > responseFrame,
int count )
inline

Parse Digital Inputs 작업을 수행합니다.

매개변수
responseFrameresponse Frame에 사용할 IReadOnlyList<byte> 값입니다.
countcount에 사용할 int 값입니다.
반환값
Parse Digital Inputs 작업에서 생성한 IoResult<bool[]> 결과입니다.

SampleFastech16PointProtocol.cs 파일의 126 번째 라인에서 정의되었습니다.

127 {
128 return ParseBits(responseFrame, "DI", count);
129 }

다음을 참조함 : ParseBits().

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

◆ ParseDigitalOutputs()

IoResult< bool[]> SampleSmart.Pages.PageSub.IoTabs.SampleFastech16PointProtocol.ParseDigitalOutputs ( IReadOnlyList< byte > responseFrame,
int count )
inline

Parse Digital Outputs 작업을 수행합니다.

매개변수
responseFrameresponse Frame에 사용할 IReadOnlyList<byte> 값입니다.
countcount에 사용할 int 값입니다.
반환값
Parse Digital Outputs 작업에서 생성한 IoResult<bool[]> 결과입니다.

SampleFastech16PointProtocol.cs 파일의 194 번째 라인에서 정의되었습니다.

195 {
196 return ParseBits(responseFrame, "DO", count);
197 }

다음을 참조함 : ParseBits().

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

◆ ParseWriteResponse()

IoResult SampleSmart.Pages.PageSub.IoTabs.SampleFastech16PointProtocol.ParseWriteResponse ( IReadOnlyList< byte > responseFrame)
inline

Parse Write Response 작업을 수행합니다.

매개변수
responseFrameresponse Frame에 사용할 IReadOnlyList<byte> 값입니다.
반환값
Parse Write Response 작업에서 생성한 IoResult 결과입니다.

SampleFastech16PointProtocol.cs 파일의 444 번째 라인에서 정의되었습니다.

445 {
446 var text = Decode(responseFrame);
447 return text.Equals(AckResponse, StringComparison.OrdinalIgnoreCase)
448 ? IoResult.Success()
449 : IoResult.Failure($"Unexpected sample write response: {text}");
450 }

다음을 참조함 : AckResponse, Decode().

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

멤버 데이터 문서화

◆ AckResponse

const string SampleSmart.Pages.PageSub.IoTabs.SampleFastech16PointProtocol.AckResponse = "OK"
staticprivate

Ack Response 값을 보관합니다.

SampleFastech16PointProtocol.cs 파일의 61 번째 라인에서 정의되었습니다.

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

◆ ReadDigitalInputsCommand

const string SampleSmart.Pages.PageSub.IoTabs.SampleFastech16PointProtocol.ReadDigitalInputsCommand = "RDI"
staticprivate

Read Digital Inputs Command 값을 보관합니다.

SampleFastech16PointProtocol.cs 파일의 34 번째 라인에서 정의되었습니다.

◆ ReadDigitalOutputsCommand

const string SampleSmart.Pages.PageSub.IoTabs.SampleFastech16PointProtocol.ReadDigitalOutputsCommand = "RDO"
staticprivate

Read Digital Outputs Command 값을 보관합니다.

SampleFastech16PointProtocol.cs 파일의 43 번째 라인에서 정의되었습니다.

◆ WriteDigitalOutputsCommand

const string SampleSmart.Pages.PageSub.IoTabs.SampleFastech16PointProtocol.WriteDigitalOutputsCommand = "WDO"
staticprivate

Write Digital Outputs Command 값을 보관합니다.

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


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