Datas
네임스페이스 Going.Basis.Datas — INI 파일, 직렬화 유틸리티 / Going.Basis.Memories — 비트·워드 메모리
public class INI
Windows INI 파일 읽기/쓰기 클래스
Constructor
| INI | (string Path) | INI 파일 경로로 인스턴스 생성 |
Properties
| string | Path get | INI 파일 경로 |
Methods
| bool | ExistsINI | () | INI 파일 존재 여부 확인 |
| void | Write | (string Section, string Key, string Value) | 키에 값 저장 |
| string | Read | (string Section, string Key) | 키 값 읽기 |
| void | DeleteSection | (string strSection) | 섹션 전체 삭제 |
Going.Basis.Memories
public interface IBitMemory
비트 메모리 인터페이스
Properties
| bool | this[int index] get set | 인덱스로 비트 접근 |
| int | Count get | 비트 수 |
| byte[] | RawData get | 원시 바이트 배열 |
public interface IWordMemory
워드 메모리 인터페이스
Properties
| WordRef | this[int index] get | 인덱스로 WordRef 접근 |
| int | Count get | 워드 수 |
| byte[] | RawData get | 원시 바이트 배열 |
public class BitMemory : IBitMemory
비트 메모리 배열. bool 인덱서로 개별 비트 접근. Modbus 슬레이브 데이터 영역에 사용. 경계 초과 시 false 반환.
Constructors
| BitMemory | (int bitCount) | 비트 수로 초기화 (워드 단위 정렬) |
| BitMemory | (byte[] sharedRawData) | 외부 바이트 배열 공유 (복사 없음) |
Properties
| byte[] | RawData get | 원시 바이트 배열 |
| int | Count get | 비트 수 |
| bool | this[int index] get set | 인덱스로 비트 접근. 범위 초과 시 get=false, set=무시 |
public class WordMemory : IWordMemory
워드 메모리 배열. WordRef 인덱서로 개별 워드 접근. Modbus 슬레이브 레지스터 영역에 사용. 범위 초과 시 예외 발생.
Constructors
| WordMemory | (int wordCount) | 워드 수로 초기화 |
| WordMemory | (byte[] sharedRawData) | 외부 바이트 배열 공유 (복사 없음) |
Properties
| WordRef | this[int index] get | 인덱스로 WordRef 접근 |
| int | Count get | 워드 수 |
| byte[] | RawData get | 원시 바이트 배열 |
public class WordRef
RawData 내 특정 오프셋의 워드를 다양한 타입으로 접근하는 래퍼. W(ushort), IW(short), DW(uint), IDW(int), R(float), S(string), Bit, Byte0/Byte1.
Constructor
| WordRef | (byte[] rawData, int byteOffset) | 바이트 배열과 오프셋으로 생성 |
Properties
| ushort | W get set | 부호 없는 16비트 값 (0~65535) |
| short | IW get set | 부호 있는 16비트 값 (-32768~32767) |
| uint | DW get set | 32비트 더블워드 (현재+다음 워드, 4바이트) |
| int | IDW get set | 부호 있는 32비트 더블워드 |
| float | R get set | IEEE 754 실수 (4바이트) |
| string | S get set | UTF-8 문자열 (null 종단, 최대 256바이트) |
| byte | Byte0, Byte1 get set | 하위/상위 바이트 |
| BitAccessor | Bit get | 16비트 비트 접근자 (Bit[0]~Bit[15]) |
public class BitAccessor
WordRef 내 16비트 비트 접근자. 인덱서로 개별 비트 읽기/쓰기.
Properties
| bool | this[int index] get set | 비트 인덱스 0~15. 범위 초과 시 get=false, set=무시 |
public class Serialize
JSON, XML, Binary(구조체) 직렬화/역직렬화 정적 유틸리티 클래스
Static Methods — JSON
| static string | JsonSerialize | (object obj, JsonSerializerOptions? options = null) | 객체를 JSON 문자열로 |
| static string | JsonSerialize<T> | (T obj, JsonSerializerOptions? options = null) | 제네릭 버전 |
| static T? | JsonDeserialize<T> | (string? json, JsonSerializerOptions? options = null) | JSON → 객체 |
| static void | JsonSerializeToFile | (string path, object obj, JsonSerializerOptions? options = null) | JSON을 파일로 저장 |
| static void | JsonSerializeToFile<T> | (string path, T obj, JsonSerializerOptions? options = null) | 제네릭 버전 |
| static T? | JsonDeserializeFromFile<T> | (string Path, JsonSerializerOptions? options = null) | JSON 파일 → 객체 |
Static Methods — XML
| static void | XmlSerializeToFile | (string Path, object obj, Type type) | XML 파일로 저장 |
| static object | XmlDeserializeFromFile | (string Path, Type type) | XML 파일 → 객체 |
| static byte[] | XmlSerialize | (object obj, Type type) | XML → 바이트 배열 |
| static object | XmlDeserialize | (byte[] rawdata, Type type) | 바이트 배열 → 객체 |
Static Methods — Raw (Binary/Struct)
| static byte[] | RawSerialize | (object obj) | 구조체 → 바이트 배열 |
| static object | RawDeserialize | (byte[] rawdata, Type type) | 바이트 배열 → 구조체 |
| static object | RawDeserialize | (byte[] ba, int offset, int size, Type type) | 바이트 배열 부분 범위 → 구조체 |
| static T | RawDeserialize<T> | (byte[] rawdata) where T : struct | 제네릭 구조체 역직렬화 |
| static T | RawDeserialize<T> | (byte[] ba, int offset, int size) | 제네릭 부분 범위 역직렬화 |
검색 결과가 없습니다.