You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
159 lines
3.7 KiB
159 lines
3.7 KiB
namespace Service.Execute.StaticTools
|
|
{
|
|
/// <summary>
|
|
/// LED管理工具
|
|
/// </summary>
|
|
public class LedTool
|
|
{
|
|
static ServiceReferenceLed.WebServiceLedSoapClient client = new ServiceReferenceLed.WebServiceLedSoapClient(ServiceReferenceLed.WebServiceLedSoapClient.EndpointConfiguration.WebServiceLedSoap);
|
|
/// <summary>
|
|
/// 通讯连接
|
|
/// </summary>
|
|
public void LedConnect()
|
|
{
|
|
try
|
|
{ if (client != null)
|
|
{
|
|
client.LedConnectAsync();
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 通讯断开
|
|
/// </summary>
|
|
public void LedDisConnect()
|
|
{
|
|
try
|
|
{
|
|
if (client != null)
|
|
{
|
|
client.LedDisConnectAsync();
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// LED连接状态值
|
|
/// </summary>
|
|
public bool GetLedConnectedSts()
|
|
{
|
|
bool result = false;
|
|
try
|
|
{
|
|
if (client != null)
|
|
{
|
|
result = client.GetLedConnectedStsAsync().Result;
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 欢迎文本指令
|
|
/// </summary>
|
|
public void WriteWelcome(string str_cn, string str_cn1, string str_cn2)
|
|
{
|
|
try
|
|
{
|
|
if (client != null)
|
|
{
|
|
client.WriteWelcomeAsync(str_cn, str_cn1, str_cn2);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 欢迎文本指令
|
|
/// </summary>
|
|
public void WriteContent(string content)
|
|
{
|
|
try
|
|
{
|
|
if (client != null)
|
|
{
|
|
client.WriteContentAsync(content);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 普通文本节目
|
|
/// </summary>
|
|
/// <param name="content">接收文本内容</param>
|
|
public void WriteProgramContent(string content)
|
|
{
|
|
try
|
|
{
|
|
if (client != null)
|
|
{
|
|
client.WriteProgramContentAsync(content);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 欢迎文本节目
|
|
/// </summary>
|
|
public void WriteProgramWelcome(string str_cn, string str_cn1, string str_cn2)
|
|
{
|
|
try
|
|
{
|
|
if (client != null)
|
|
{
|
|
client.WriteProgramWelcomeAsync(str_cn, str_cn1, str_cn2);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 清屏
|
|
/// </summary>
|
|
public void WriteClearScreen()
|
|
{
|
|
try
|
|
{
|
|
if (client != null)
|
|
{
|
|
client.WriteClearScreenAsync();
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ex.ToString();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
} |