493 lines
19 KiB
C#
493 lines
19 KiB
C#
|
|
using LabLed.Components;
|
|||
|
|
using log4net;
|
|||
|
|
using System;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using System.ComponentModel;
|
|||
|
|
using System.Data;
|
|||
|
|
using System.Drawing;
|
|||
|
|
using System.Linq;
|
|||
|
|
using System.Text;
|
|||
|
|
using System.Windows.Forms;
|
|||
|
|
using Apache.NMS;
|
|||
|
|
using System.Net;
|
|||
|
|
using System.Threading;
|
|||
|
|
using System.Speech.Synthesis;
|
|||
|
|
using System.Reflection;
|
|||
|
|
|
|||
|
|
namespace dccdc.Selfhelp
|
|||
|
|
{
|
|||
|
|
public partial class frm_main_ym : Form
|
|||
|
|
{
|
|||
|
|
IConnectionFactory factory;
|
|||
|
|
IConnection connection;
|
|||
|
|
ISession session;
|
|||
|
|
string MQAddress
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
return System.Configuration.ConfigurationManager.AppSettings["MQAddress"];
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
ICollection<string> setting = extend.Config.AppSettings.Settings.AllKeys as ICollection<string>;
|
|||
|
|
private void init()
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
speaker = new SpeechSynthesizer();
|
|||
|
|
//speaker.SpeakStarted += Speaker_SpeakStarted;
|
|||
|
|
//speaker.SpeakCompleted += Speaker_SpeakCompleted;
|
|||
|
|
if (setting.Contains("yyk"))
|
|||
|
|
{
|
|||
|
|
speaker.SelectVoice(extend.Config.AppSettings.Settings["yyk"].Value);
|
|||
|
|
}
|
|||
|
|
if (setting.Contains("yd"))
|
|||
|
|
{
|
|||
|
|
speaker.Volume = int.Parse(extend.Config.AppSettings.Settings["yd"].Value);
|
|||
|
|
}
|
|||
|
|
if (setting.Contains("ys"))
|
|||
|
|
{
|
|||
|
|
speaker.Rate = int.Parse(extend.Config.AppSettings.Settings["ys"].Value);
|
|||
|
|
}
|
|||
|
|
//speaker.SelectVoice(cbb_yyk.Text);
|
|||
|
|
//speaker.Rate = (int)nud_ys.Value;
|
|||
|
|
//speaker.Volume = (int)nud_yd.Value;
|
|||
|
|
if (string.IsNullOrEmpty(MQAddress))
|
|||
|
|
{
|
|||
|
|
MessageBox.Show("消息服务器地址没有设置!");
|
|||
|
|
Application.Exit();
|
|||
|
|
}
|
|||
|
|
factory = new Apache.NMS.ActiveMQ.ConnectionFactory(MQAddress);
|
|||
|
|
|
|||
|
|
bool conned = false;
|
|||
|
|
for (int i = 0; i < 10; i++)
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
connection = factory.CreateConnection();
|
|||
|
|
connection.ClientId = Dns.GetHostName();
|
|||
|
|
connection.Start();
|
|||
|
|
conned = true;
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
catch
|
|||
|
|
{
|
|||
|
|
Thread.Sleep(2000);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if (!conned)
|
|||
|
|
{
|
|||
|
|
MessageBox.Show("消息服务器设置不正常程序退出!");
|
|||
|
|
Application.Exit();
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
session = connection.CreateSession();
|
|||
|
|
//receivemessageinit();
|
|||
|
|
|
|||
|
|
//remsg = session.CreateConsumer(new Apache.NMS.ActiveMQ.Commands.ActiveMQTopic("jbtxTopic"));
|
|||
|
|
//cxhzrs = session.CreateConsumer(new Apache.NMS.ActiveMQ.Commands.ActiveMQTopic("sxpdrs"));
|
|||
|
|
|
|||
|
|
//remsg2 = session.CreateConsumer(new Apache.NMS.ActiveMQ.Commands.ActiveMQTopic("jbtxTopic"), "dept_code='20151'", false);
|
|||
|
|
|
|||
|
|
//cxhzrs.Listener += new MessageListener(sxpdrs_Listener);
|
|||
|
|
hujiao = session.CreateConsumer(new Apache.NMS.ActiveMQ.Commands.ActiveMQTopic("hujiao"));
|
|||
|
|
|
|||
|
|
//remsg2 = session.CreateConsumer(new Apache.NMS.ActiveMQ.Commands.ActiveMQTopic("jbtxTopic"), "dept_code='20151'", false);
|
|||
|
|
|
|||
|
|
hujiao.Listener += new MessageListener(hujiao_Listener);
|
|||
|
|
|
|||
|
|
|
|||
|
|
gxpdlb = session.CreateConsumer(new Apache.NMS.ActiveMQ.Commands.ActiveMQTopic("gxpdlb"));
|
|||
|
|
|
|||
|
|
//remsg2 = session.CreateConsumer(new Apache.NMS.ActiveMQ.Commands.ActiveMQTopic("jbtxTopic"), "dept_code='20151'", false);
|
|||
|
|
|
|||
|
|
gxpdlb.Listener += new MessageListener(gxpdlb_Listener);
|
|||
|
|
gxpdlb_Listener(null);
|
|||
|
|
//fs.gxdq("");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void Speaker_SpeakCompleted(object sender, SpeakCompletedEventArgs e)
|
|||
|
|
{
|
|||
|
|
//throw new NotImplementedException();
|
|||
|
|
fs.setVolue(30);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void Speaker_SpeakStarted(object sender, SpeakStartedEventArgs e)
|
|||
|
|
{
|
|||
|
|
//throw new NotImplementedException();
|
|||
|
|
fs.setVolue(0);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 更新排队列表
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="message"></param>
|
|||
|
|
private void gxpdlb_Listener(IMessage message)
|
|||
|
|
{
|
|||
|
|
//throw new NotImplementedException();
|
|||
|
|
WebClient wc = new WebClient();
|
|||
|
|
wc.Encoding = Encoding.UTF8;
|
|||
|
|
wc.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
|
|||
|
|
string jsondata = wc.UploadString(extend.URL + "zzj/getpdlb", "");
|
|||
|
|
var pd = Newtonsoft.Json.JsonConvert.DeserializeObject<pdxx>(jsondata);
|
|||
|
|
sendtoLED(pd);
|
|||
|
|
/*
|
|||
|
|
if (fs != null && !fs.IsDisposed)
|
|||
|
|
{
|
|||
|
|
fs.gxpd(pd.dds);
|
|||
|
|
}
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
string pdid = "";
|
|||
|
|
private void hujiao_Listener(IMessage message)
|
|||
|
|
{
|
|||
|
|
//throw new NotImplementedException();
|
|||
|
|
ITextMessage itm = message as ITextMessage;
|
|||
|
|
pdid = itm.Text;
|
|||
|
|
WebClient wc = new WebClient();
|
|||
|
|
wc.Encoding = Encoding.UTF8;
|
|||
|
|
wc.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
|
|||
|
|
string jsonData = wc.UploadString(extend.URL + "zzj/getPD_XX", "id=" + pdid);
|
|||
|
|
var pdxx = Newtonsoft.Json.JsonConvert.DeserializeObject<Models.PD_XX>(jsonData);
|
|||
|
|
speaker.SpeakAsync("请" + pdxx.hm.ToString("D4") + "号小朋友的家长到" + pdxx.jhckmc + "登记");
|
|||
|
|
//fs.gxdq(("请 " + pdxx.hm.ToString("D4") + "号 小朋友的家长到 " + pdxx.jhckmc + "登记").ToString());
|
|||
|
|
fs.txpd(pdxx);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
IMessageConsumer hujiao;
|
|||
|
|
IMessageConsumer gxpdlb;
|
|||
|
|
string dqddrs = "0";
|
|||
|
|
private void sxpdrs_Listener(IMessage message)
|
|||
|
|
{
|
|||
|
|
//throw new NotImplementedException();
|
|||
|
|
ITextMessage itm = message as ITextMessage;
|
|||
|
|
dqddrs = itm.Text;
|
|||
|
|
// this.Invoke(new MethodInvoker(sxrs));
|
|||
|
|
}
|
|||
|
|
public void sxrs()
|
|||
|
|
{
|
|||
|
|
if (pd != null && !pd.IsDisposed)
|
|||
|
|
{
|
|||
|
|
pd.sxrs(dqddrs);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
IMessageConsumer cxhzrs;
|
|||
|
|
public frm_main_ym()
|
|||
|
|
{
|
|||
|
|
InitializeComponent();
|
|||
|
|
log4net.LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType).Info(DateTime.Now.ToString() + "初始化窗口成功");
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
private SpeechSynthesizer speaker;
|
|||
|
|
frm_ymVideo fs = new frm_ymVideo();
|
|||
|
|
private void frm_main_ym_Load(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
|
|||
|
|
log4net.LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType).Info(DateTime.Now.ToString() + "执行LOAd");
|
|||
|
|
|
|||
|
|
foreach (var s in Screen.AllScreens)
|
|||
|
|
{
|
|||
|
|
if (!s.Primary)
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
Point mf = new Point();
|
|||
|
|
mf = s.Bounds.Location;
|
|||
|
|
fs.Location = mf;
|
|||
|
|
fs.TopLevel = true;
|
|||
|
|
fs.TopMost = true;
|
|||
|
|
//fs.ksname = ksname;
|
|||
|
|
fs.Owner = this;
|
|||
|
|
fs.WindowState = FormWindowState.Maximized;
|
|||
|
|
fs.StartPosition = FormStartPosition.Manual;
|
|||
|
|
fs.Show();
|
|||
|
|
/*
|
|||
|
|
Thread t = new Thread(() => {
|
|||
|
|
while (true) {
|
|||
|
|
Thread.Sleep(10000);
|
|||
|
|
fs.txpd(new Models.PD_XX {
|
|||
|
|
id = new Random().Next(1, 100),
|
|||
|
|
hm = new Random().Next(1, 100),
|
|||
|
|
jhckmc = "测试"
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
t.Start();
|
|||
|
|
*/
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if (extend.Config.AppSettings.Settings["min"].Value == "true")
|
|||
|
|
{
|
|||
|
|
this.WindowState = FormWindowState.Minimized;
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
TopMost = true;
|
|||
|
|
TopLevel = true;
|
|||
|
|
btn_pdjh.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
|
|||
|
|
btn_pdjh.FlatAppearance.BorderSize = 0;
|
|||
|
|
btn_pdjh.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent;
|
|||
|
|
btn_pdjh.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent;
|
|||
|
|
btn_pdjh.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
|||
|
|
|
|||
|
|
|
|||
|
|
//btn_pdjh.FlatAppearance.BorderSize = 0;
|
|||
|
|
//btn_zzjf.FlatAppearance.BorderSize = 0;
|
|||
|
|
btn_zzjf.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
|
|||
|
|
btn_zzjf.FlatAppearance.BorderSize = 0;
|
|||
|
|
btn_zzjf.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent;
|
|||
|
|
btn_zzjf.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent;
|
|||
|
|
btn_zzjf.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
|||
|
|
timer1.Enabled = true;
|
|||
|
|
timer2.Enabled = true;
|
|||
|
|
}
|
|||
|
|
init();
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
frm_yypd pd = new Selfhelp.frm_yypd();
|
|||
|
|
private void btn_pdjh_Click(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
pd.TopMost = true;
|
|||
|
|
pd.TopLevel = true;
|
|||
|
|
if (pd == null || pd.IsDisposed)
|
|||
|
|
pd = new Selfhelp.frm_yypd();
|
|||
|
|
if (pd.Visible == false)
|
|||
|
|
pd.ShowDialog();
|
|||
|
|
}
|
|||
|
|
LedCommon LEDSender = new LedCommon();
|
|||
|
|
private const int WM_LED_NOTIFY = 1025;
|
|||
|
|
|
|||
|
|
private int dev = -1;
|
|||
|
|
private int dev1 = -1;
|
|||
|
|
private int dev2 = -1;
|
|||
|
|
private int dev3 = -1;
|
|||
|
|
private void timer1_Tick(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
timer1.Enabled = false;
|
|||
|
|
LedCommon.DEVICEPARAM param = new LedCommon.DEVICEPARAM();
|
|||
|
|
GetDeviceParam(ref param);
|
|||
|
|
dev = LEDSender.LED_Open(ref param, LedCommon.NOTIFY_EVENT, (int)Handle, WM_LED_NOTIFY);
|
|||
|
|
//dev = LEDSender.LED_Open(ref param, LedCommon.NOTIFY_NONE, (int)Handle, WM_LED_NOTIFY);
|
|||
|
|
if (dev == -1)
|
|||
|
|
{
|
|||
|
|
//MessageBox.Show( "打开通讯设备失败");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
//MessageBox.Show("打开通讯设备成功");
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
private void GetDeviceParam(ref LedCommon.DEVICEPARAM param)
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
param.devType = (uint)LedCommon.eDevType.DEV_UDP;
|
|||
|
|
param.ComPort = (uint)Convert.ToInt16(1);
|
|||
|
|
param.Speed = (uint)LedCommon.eBaudRate.SBR_57600;
|
|||
|
|
param.locPort = 9999;
|
|||
|
|
param.rmtPort = 6666;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void OnLEDNotify(UInt32 msg, UInt32 wParam, UInt32 lParam)
|
|||
|
|
{
|
|||
|
|
ILog loger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().GetType());
|
|||
|
|
LedCommon.NotifyMessage notify = new LedCommon.NotifyMessage();
|
|||
|
|
LEDSender.LED_GetDeviceNotifyMessage(dev, ref notify);
|
|||
|
|
//LEDSender.LED_GetNotifyMessage(ref notify);
|
|||
|
|
switch (notify.Message)
|
|||
|
|
{
|
|||
|
|
case (int)LedCommon.eResponseMessage.LM_TX_COMPLETE:
|
|||
|
|
loger.Info("发送完成");
|
|||
|
|
//MessageBox.Show( "发送完成");
|
|||
|
|
break;
|
|||
|
|
case (int)LedCommon.eResponseMessage.LM_TIMEOUT:
|
|||
|
|
loger.Info("命令执行超时");
|
|||
|
|
//MessageBox.Show("命令执行超时");
|
|||
|
|
break;
|
|||
|
|
case (int)LedCommon.eResponseMessage.LM_RESPOND:
|
|||
|
|
switch (notify.Command)
|
|||
|
|
{
|
|||
|
|
case LedCommon.PKC_GET_POWER:
|
|||
|
|
if (notify.Status == 1)
|
|||
|
|
loger.Info("读取电源状态完成,当前电源状态为打开状态");
|
|||
|
|
//MessageBox.Show( Text = "读取电源状态完成,当前电源状态为打开状态");
|
|||
|
|
else
|
|||
|
|
loger.Info("读取电源状态完成,当前电源状态为打开状态");
|
|||
|
|
//Text = "读取电源状态完成,当前电源状态为关闭状态";
|
|||
|
|
break;
|
|||
|
|
case LedCommon.PKC_SET_POWER:
|
|||
|
|
loger.Info("读取电源状态完成,当前电源状态为打开状态");
|
|||
|
|
//Text = "设置电源完成";
|
|||
|
|
break;
|
|||
|
|
case LedCommon.PKC_GET_BRIGHT:
|
|||
|
|
loger.Info("当前亮度为" + notify.Status);
|
|||
|
|
//Text = "当前亮度为" + notify.Status;
|
|||
|
|
break;
|
|||
|
|
case LedCommon.PKC_GET_LEAF:
|
|||
|
|
case LedCommon.PKC_SET_LEAF:
|
|||
|
|
loger.Info("当前页面为" + notify.Status);
|
|||
|
|
// Text = "当前页面为" + notify.Status;
|
|||
|
|
break;
|
|||
|
|
case LedCommon.PKC_SET_BRIGHT:
|
|||
|
|
loger.Info("设置亮度完成");
|
|||
|
|
//Text = "设置亮度完成";
|
|||
|
|
break;
|
|||
|
|
case LedCommon.PKC_ADJUST_TIME:
|
|||
|
|
loger.Info("校正控制卡时间完成");
|
|||
|
|
//Text = "校正控制卡时间完成";
|
|||
|
|
break;
|
|||
|
|
case LedCommon.PKC_SET_AUTO_POWER:
|
|||
|
|
loger.Info("设置自动开关屏时间完成");
|
|||
|
|
// Text = "设置自动开关屏时间完成";
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
protected override void DefWndProc(ref System.Windows.Forms.Message m)
|
|||
|
|
{
|
|||
|
|
switch (m.Msg)
|
|||
|
|
{
|
|||
|
|
case WM_LED_NOTIFY:
|
|||
|
|
OnLEDNotify((UInt32)m.Msg, (UInt32)m.WParam, (UInt32)m.LParam);
|
|||
|
|
break;
|
|||
|
|
|
|||
|
|
default:
|
|||
|
|
base.DefWndProc(ref m);//调用基类函数处理非自定义消息。
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void timer2_Tick(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
timer2.Enabled = false;
|
|||
|
|
sendtoLED(null);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void btn_zzjf_Click(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
frm_zzjf zzjf = new frm_zzjf();
|
|||
|
|
zzjf.TopMost = true;
|
|||
|
|
zzjf.TopLevel = true;
|
|||
|
|
zzjf.ShowDialog();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void sendtoLED(pdxx pd)
|
|||
|
|
{
|
|||
|
|
LedCommon.RECT r;
|
|||
|
|
if (dev >= 0 && LEDSender.LED_GetDeviceStatus(dev) == 0)
|
|||
|
|
{
|
|||
|
|
//LEDSender.MakeRootEx(LedCommon.eRootType.ROOT_PLAY, LedCommon.eScreenType.SCREEN_COLOR, 5);
|
|||
|
|
//LEDSender.AddLeaf(86400000);
|
|||
|
|
//r.left = 40;
|
|||
|
|
//r.top = 1;
|
|||
|
|
//r.right = 50;
|
|||
|
|
//r.bottom = 16;
|
|||
|
|
//LEDSender.AddText("德城区疾病预防控制中心数字化门诊", ref r, 0, 1, 1, "宋体", 16, 255, 0);
|
|||
|
|
|
|||
|
|
//LEDSender.LED_SendToScreen(dev, 0, "192.168.18.99", 6666);
|
|||
|
|
//Text = "正在发送节目...";
|
|||
|
|
LEDSender.MakeRootEx(LedCommon.eRootType.ROOT_PLAY, LedCommon.eScreenType.SCREEN_COLOR, 5);
|
|||
|
|
LEDSender.AddLeaf(86400000);
|
|||
|
|
r.left = 64;
|
|||
|
|
r.top = 0;
|
|||
|
|
r.right = 448;
|
|||
|
|
r.bottom = 32;
|
|||
|
|
LEDSender.AddText("德城区疾控中心数字化门诊", ref r, 1, 1, 1, "宋体", 20, 255, 0);
|
|||
|
|
r.left = 0;
|
|||
|
|
r.top = 32;
|
|||
|
|
r.right = 448;
|
|||
|
|
r.bottom = 48;
|
|||
|
|
LEDSender.AddText("-------------------------------------------------------------------------------------------------", ref r, 1, 1, 1, "宋体", 8, 255, 0);
|
|||
|
|
r.left = 0;
|
|||
|
|
r.top = 224;
|
|||
|
|
r.right = 448;
|
|||
|
|
r.bottom = 240;
|
|||
|
|
LEDSender.AddText("-------------------------------------------------------------------------------------------------", ref r, 1, 1, 1, "宋体", 8, 255, 0);
|
|||
|
|
r.left = 144;
|
|||
|
|
r.top = 208;
|
|||
|
|
r.right = 448;
|
|||
|
|
r.bottom = 224;
|
|||
|
|
LEDSender.AddText("请小朋友接种完成后,留观半小时。", ref r, 1, 1, 1, "宋体", 10, 255, 0);
|
|||
|
|
r.left = 144;
|
|||
|
|
r.top = 240;
|
|||
|
|
r.right = 234;
|
|||
|
|
r.bottom = 256;
|
|||
|
|
LEDSender.AddDateTime(ref r, 1, "宋体", 10, 255, LedCommon.eTimeFormat.DF_W, 0);
|
|||
|
|
|
|||
|
|
r.left = 224;
|
|||
|
|
r.top = 240;
|
|||
|
|
r.right = 320;
|
|||
|
|
r.bottom = 256;
|
|||
|
|
LEDSender.AddDateTime(ref r, 1, "宋体", 10, 255, LedCommon.eTimeFormat.DF_HNS, 0);
|
|||
|
|
|
|||
|
|
r.left = 320;
|
|||
|
|
r.top = 240;
|
|||
|
|
r.right = 448;
|
|||
|
|
r.bottom = 256;
|
|||
|
|
LEDSender.AddText("联系电话 :2267131", ref r, 1, 1, 1, "宋体", 10, 255, 0);
|
|||
|
|
//LEDSender.LED_SendToScreen(dev, (byte)Convert.ToInt16(eAddress.Text), eRemoteHost.Text, 6666);
|
|||
|
|
//LEDSender.AddDateTime(ref r, 1, "宋体", 12, 0xff00, LedCommon.eTimeFormat.DF_HNS, 0);
|
|||
|
|
//r.left = 32;
|
|||
|
|
//r.top = 64;
|
|||
|
|
//r.right = 448;
|
|||
|
|
//r.bottom = 128;
|
|||
|
|
//LEDSender.AddText("大家好,欢迎大家!", ref r, 1, 1, 1, "宋体", 28, 255, 0);
|
|||
|
|
//LEDSender.LED_SendToScreen(dev, 0, "192.168.18.99", 6666);
|
|||
|
|
if (pd != null)
|
|||
|
|
{
|
|||
|
|
//LEDSender.AddLeaf(5000);
|
|||
|
|
r.left = 16;
|
|||
|
|
r.top = 48;
|
|||
|
|
r.right = 448;
|
|||
|
|
r.bottom = 192;
|
|||
|
|
StringBuilder sb = new StringBuilder();
|
|||
|
|
|
|||
|
|
int i = 0;
|
|||
|
|
i = pd.jhs.Count - 8;
|
|||
|
|
if (i < 0)
|
|||
|
|
i = 0;
|
|||
|
|
for (; i < pd.jhs.Count; i++)
|
|||
|
|
{
|
|||
|
|
sb.Append("请" + pd.jhs[i].hm.ToString("D4") + "号小朋友的家长到" + pd.jhs[i].jhckmc.Replace(" ", "") + "登记");
|
|||
|
|
if (i < pd.jhs.Count - 1)
|
|||
|
|
{
|
|||
|
|
sb.Append("\r\n");
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
LEDSender.AddTextEx(sb.ToString(), ref r, 1, 1, 1, "宋体", 12, 255, 0, 0);
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
//LEDSender.AddLeaf(5000);
|
|||
|
|
//r.left = 16;
|
|||
|
|
//r.top = 48;
|
|||
|
|
//r.right = 224;
|
|||
|
|
//r.bottom = 144;
|
|||
|
|
//LEDSender.AddTextEx("于兴海请到1号窗口登记\r\n于兴海请到2号窗口登记\r\n于兴海请到3号窗口登记", ref r, 1, 1, 1, "宋体", 10, 255, 0, 0);
|
|||
|
|
}
|
|||
|
|
LEDSender.LED_SendToScreen(dev, 0, "192.168.18.99", 6666);
|
|||
|
|
//LEDSender.UserCanvas_Draw_Line(0, 33, 447, 33,10,255);
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
//MessageBox.Show("失败!");
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
public class pdxx
|
|||
|
|
{
|
|||
|
|
public List<Models.PD_XX> jhs { get; set; }
|
|||
|
|
public List<Models.PD_XX> dds { get; set; }
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|