using Aurora.Api;
using Hermes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Remoting.Channels;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Interop;
namespace VisionLight {
///
/// [상시 조명 컨트롤러 - 1CH / 시리얼 통신]
/// Range : (0,1023)
/// Baudrate : 19200 or 57600 bps
/// DataBit : 8 bit
/// StopBit : 1 bit
/// ParityBit : None
///
public class Light_LVS_PT0105 : Light_LVS_PT {
///
/// LVS_PT0105 생성자
///
/// Device Id
public Light_LVS_PT0105(string deviceId) : base(deviceId) {
DeviceId = deviceId;
}
internal override byte[] CreateSetOnReqMsg(int channel) {
// :1O1[CR][LF] ->ON | :1O0[CR][LF] -> OFF
string msg = string.Format("{0}{1}{2}{3}{4}{5}",
":", "1", "O", "1", "\r", "\n");
return Encoding.UTF8.GetBytes(msg);
}
internal override byte[] CreateSetOffReqMsg(int channel) { // :1O1[CR][LF] ->ON | :1O0[CR][LF] -> OFF
string msg = string.Format("{0}{1}{2}{3}{4}{5}",
":", "1", "O", "0", "\r", "\n");
return Encoding.UTF8.GetBytes(msg);
}
internal override byte[] CreateSetLevelReqMsg(int level, int channel) {
// :110999[CR][LF] -> 1번 채널 밝기 999로 설정
string msg = string.Format("{0}{1}{2}{3:D4}{4}{5}",
":", "1", "1", level, "\r", "\n");
return Encoding.UTF8.GetBytes(msg);
}
internal override byte[] CreateGetLevelReqMsg(int channel) {
// :R1[CR][LF] -> 1번 채널 밝기 999로 설정
string msg = string.Format("{0}{1}{2:D1}{3}{4}",
":", "R", channel, "\r", "\n");
return Encoding.UTF8.GetBytes(msg);
}
}
}