namespace AuroraLaser.Coherent { public partial class HyperRapidLaser { public const string CMD_HEARTBEAT = "HB"; public const string CMD_SYSTEMFAULT = "F"; public const string CMD_SYSTEMFAULT_DESC = "FNAME"; public const string CMD_DIODE_OPERATINGHOURS = "D"; public const string CMD_HEAD_OPERATINGHOURS = "HH"; public const string CMD_MODULE_OPERATINGHOURS = "MOH"; public const string CMD_SEEDER_OPERATINGHOURS = "SH"; public const string CMD_ATTENUATOR_TRANSMISSION = "TATT"; public const string CMD_OUTPUTPOWER = "POUT"; public const string CMD_OUTPUTAOMPERCENTAGE = "RL"; public const string CMD_SHUTTEROPEN = "S"; public const string CMD_LASER_ON = "START"; public const string CMD_LASER_OFF = "STOP"; public const string CMD_STATE = "STATE"; public const string CMD_PM = "PM"; public const string CMD_HELP = "HELP";//"?HELP"; public const string CMD_SEEDER_DIODE = "SH";//"?SH"; public const string CMD_AUTOIP_ON = "AUTOIP"; public const string CMD_DHCP_ENABLE = "DHCP"; public const string CMD_DNS_ADDRESS = "DNS"; public const string CMD_MAC_ADDRESS = "MAC";//"?MAC"; public const string CMD_SUBNET = "SUBNET"; public const string CMD_GATEWAY = "GATEWAY"; public const string CMD_IPADDRESS = "IP"; public const string CMD_AUTOIPMAX = "IPMAX"; public const string CMD_AUTOIPMIN = "IPMIN"; public const string CMD_LASTIP = "LASTIP"; public const string CMD_HOSTNAME = "HOSTNAME"; public const string CMD_SESSIONS = "SESSIONS"; public const string CMD_FV = "FV"; public const string CMD_HSV = "HSV"; public const string CMD_HSN = "HSN"; public const string CMD_LM = "LM"; public const string CMD_EP = "EP"; public const string CMD_TIME = "TIME"; public const string CMD_TIMEZONE = "TIMEZONE"; public const string CMD_PROMPT = "PROMPT"; public const string CMD_LOCKOUT = "LOCKOUT"; public const string CMD_TATT = "TATT"; //Transmission(%) public const string CMD_RL = "RL"; //Max Power public const string CMD_PATTSET = "PATTSET"; //Power in Watt public bool IsAutoIpOn() => GetMonitorData(CMD_AUTOIP_ON) == 1 ? true : false; public bool IsDhcpEnabled() => GetMonitorData(CMD_DHCP_ENABLE) == 1 ? true : false; public string GetDnsAddress() => GetMonitorDataString(CMD_DNS_ADDRESS); public string GetMacAddress() => GetMonitorDataString(CMD_MAC_ADDRESS); public string GetSubnet() => GetMonitorDataString(CMD_SUBNET); public string GetGateway() => GetMonitorDataString(CMD_GATEWAY); public string GetIpAddress() => GetMonitorDataString(CMD_IPADDRESS); public string GetAutoIpMax() => GetMonitorDataString(CMD_AUTOIPMAX); public string GetAutoIpMin() => GetMonitorDataString(CMD_AUTOIPMIN); public string GetLastUsedIp() => GetMonitorDataString(CMD_LASTIP); public string GetHostName() => GetMonitorDataString(CMD_HOSTNAME); public string GetFpgaVersion() => GetMonitorDataString(CMD_FV); public string GetHeadSerialNo() => GetMonitorDataString(CMD_HSN); public string GetLaserModelInfo() => GetMonitorDataString(CMD_LM); public int GetEnhancedProtocolStatus() => (int)GetMonitorData(CMD_EP); public bool IsExternalModulationModeOn() => GetMonitorData("EM") == 1 ? true : false; public string SetExternalModulationModeOn(bool bOn) => SendCMD("EM", bOn);// EM=%d public string GetSystemWarning() => GetMonitorDataString("W"); public string GetSystemFault() => GetMonitorDataString(CMD_SYSTEMFAULT); public string GetSystemFaultDescription(int iCode) // ?FNAME nnn => GetMonitorDataString(string.Format("{0}={1:D3}", CMD_SYSTEMFAULT_DESC, iCode)); public string ResetSystemFault() => SendCMD("FACK", 1); // FACK 1 public string ClearSystemFaultHistory() => SendCMD("FHC"); // FHC public string GetHelp() => GetMonitorDataString(CMD_HELP); public string SetAutoIpOn(bool bOn) => SendCMD(CMD_AUTOIP_ON, bOn); // AUTOIP=%s public string SetDhcpEnable(bool bEnable) => SendCMD(CMD_DHCP_ENABLE, bEnable);// DHCP=%d - 0 : disabled, 1 : enabled public string SetDnsAddress(string strAddress) => SendCMD(CMD_DNS_ADDRESS, strAddress); // DNS=%s public string SetSubnet(string strAddress) => SendCMD(CMD_SUBNET, strAddress); // SUBNET=%s public string SetGateway(string strAddress) => SendCMD(CMD_GATEWAY, strAddress); // GATEWAY nnn.nnn.n.n public string SetIpAddress(string strAddress) => SendCMD(CMD_IPADDRESS, strAddress); // IP nnn.nnn.n.n public string SetAutoIpMax(string strAddress) => SendCMD(CMD_AUTOIPMAX, strAddress); // IPMAX nnn.nnn.n.n public string SetAutoIpMin(string strAddress) => SendCMD(CMD_AUTOIPMIN, strAddress); // IPMIN nnn.nnn.n.n public string SetHostName(string strName) => SendCMD(CMD_HOSTNAME, strName); public string GetAllActiveConnectionToLaser() => GetMonitorDataString(CMD_SESSIONS); public string GetFirmwareVersion() => GetMonitorDataString(CMD_HSV); public string SetEnhancedProtocolStatus(int iOption) => SendCMD(CMD_EP, iOption); // EP=%d public string GetTimeOnLaser() => GetMonitorDataString(CMD_TIME); public string GetLaserTimeZone() => GetMonitorDataString(CMD_TIMEZONE); public string SetLaserTimeZone(string strTimeZone) => SendCMD(CMD_TIMEZONE, strTimeZone); // TIMEZONE=%s public string SetHidePrompt(bool bHide) => SendCMD(CMD_PROMPT, bHide); // PROMPT=%d public bool IsLockedOut() => GetMonitorData(CMD_LOCKOUT) == 1 ? true : false; public string SetLockOutOn(bool bOn) => SendCMD(CMD_LOCKOUT, bOn); // LOCKOUT=%d public int GetHeartBeatTimeout() => (int)GetMonitorData(("HB")); public string ClearSystemWarningHistory() => SendCMD("WHC"); public string GetSystemWarningDescription(int iCode) => GetMonitorDataString(string.Format("WNAME={0:D3}", iCode)); public double GetHousingTemp(int iTempNo) { if (iTempNo != 1 && iTempNo != 2) { Log.FuncE("존재하지 않는 번호입니다."); return -100; } return GetMonitorData(string.Format("BT{0}", iTempNo)); } public double GetAmplifierDewPoint() => GetMonitorData("H1DP"); public double GetAmplifierHumidity() => GetMonitorData("H1H"); public double GetAmplifierTemperature() => GetMonitorData("H1T"); public double GetHarmonicDewPoint() => GetMonitorData("H2DP"); public double GetHarmonicHumidity() => GetMonitorData("H2H"); public double GetHarmonicTemperature() => GetMonitorData("H2T"); public double GetAmbientDewPoint() => GetMonitorData("H3DP"); public double GetAmbientHumidity() => GetMonitorData("H3H"); public double GetAmbientTemperature() => GetMonitorData("H3T"); public int GetBurstNumber() => (int)GetMonitorData("BURST"); // BURST=%d public string SetBurstNumber(int iNo) => SendCMD("BURST", iNo); public int GetBurstMaxNumber() => (int)GetMonitorData("BURSTMAX"); // ?DnC(n:1,2,3) public double GetActualDiodeCurrent(int iDiodeNo) { if (iDiodeNo < 1 || iDiodeNo > 3) { Log.FuncE("존재하지 않는 번호입니다."); return -100; } return GetMonitorData(string.Format("D{0}C", iDiodeNo)); } public double GetAttenuatorPower() => GetMonitorData("PATT"); public double GetClosedLoopAttenuatorSetPower() => GetMonitorData("PATTSET"); // PATTSET=%lf public bool SetClosedLoopAttenuatorPower(double dPower) => SendCMD("PATTSET", dPower) != null; //public double GetClosedLoopAttenuatorPowerMax() => GetMonitorData("PATTSETMAX"); public bool IsPowerRegulationEnabled() => GetMonitorData("PRENABLE") == 1; // RL=%lf public bool SetOutputAomPercentage(double dVal) { if (IsSimul) { LaserPower = dVal; return true; } return SendCMD("RL", dVal) != null; } public bool SetTransmission(double dVal) { if (IsSimul) { AttenuatorTransmission = dVal; return true; } return SendCMD("TATT", dVal) != null; } public double GetTransmission() => GetMonitorData("TATT"); public int GetPulseMode() => (int)GetMonitorData("PM"); // PM=%d public string SetPulseMode(int iMode) => SendCMD("PM", iMode); public double GetRepRate() => GetMonitorData("RR"); public double GetMasterRepRate() => GetMonitorData("RRAMP"); public double GetMasterRepRateSetValue() => GetMonitorData("RRAMPSET"); // RRAMPSET=%lf public string SetMasterRepRate(double dVal) => SendCMD("RRAMPSET", dVal); public double GetMaxEffectiveRepRate() => GetMonitorData("RREFFMAX"); public int GetRepRateDivider() => (int)GetMonitorData("RRD"); // RRD=%d public string SetRepRateDivider(int iPulse) => SendCMD("RRD", iPulse); public double GetRepRateMax() => GetMonitorData("RRMAX"); public double GetRepRateMin() => GetMonitorData("RRMIN"); //public bool IsShutterControlInversionEnabled() => GetMonitorData("SCI") == 1; // SCI=%d //public bool SetShutterControlInversionEnable(bool bEnable) => SendCMD("SCI", bEnable); //public bool IsShutterControlOutputInversed() => GetMonitorData("SCOI") == 1; // SCOI=%d //public bool SetShutterContorlOutputInverse(bool bSet) => SendCMD("SCOI", bSet); public double GetShgTemperature() => GetMonitorData("SHGT"); public double GetShgTemperatureSetValue() => GetMonitorData("SHGTSET"); public double GetThgTemperature() => GetMonitorData("THGT"); public double GetThgTemperatureSetValue() => GetMonitorData("THGTSET"); //public bool IsShutterInterlockOpened() => GetMonitorData("SIS") == 1; public bool IsExternalShutterModeOn() => GetMonitorData("SMOD") == 1; // SMOD=%d public bool SetExternalShutterModeOn(bool bOn) => SendCMD("SMOD", bOn) != null; public double GetWaterFlow() => GetMonitorData("WF"); public double GetWaterTemperature() => GetMonitorData("WT"); public string GetSystemFaultList() => GetMonitorDataString("FAULTS"); public string GetSystemFaultHistory() => GetMonitorDataString("FH"); public string GetSystemWarningHistory() => GetMonitorDataString("WH"); // PRENABLE=%d public bool SetPowerRegulationEnable(bool bOn) => SendCMD("PRENABLE", bOn) != null; public int GetShgTemperatureServoStatus() => (int)GetMonitorData("SHGS"); public int GetThgTemperatureServoStatus() => (int)GetMonitorData("THGS"); } }