using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Drawing.Drawing2D; using System.IO; using System.Runtime.InteropServices; namespace SiaSun.LMS.LED { public class BX_5M_Base { #region 常量声明 #region 控制器类型nControlType public const int BX_5AT = 0x0051; public const int BX_5A0 = 0x0151; public const int BX_5A1 = 0x0251; public const int BX_5A2 = 0x0351; public const int BX_5A3 = 0x0451; public const int BX_5A4 = 0x0551; public const int BX_5A1_WIFI = 0x0651; public const int BX_5A2_WIFI = 0x0751; public const int BX_5A4_WIFI = 0x0851; public const int BX_5A = 0x0951; public const int BX_5A2_RF = 0x1351; public const int BX_5A4_RF = 0x1551; public const int BX_5AT_WIFI = 0x1651; public const int BX_5AL = 0x1851; private const int AX_AT = 0x2051; private const int AX_A0 = 0x2151; public const int BX_5MT = 0x0552; public const int BX_5M1 = 0x0052; public const int BX_5M1X = 0x0152; public const int BX_5M2 = 0x0252; public const int BX_5M3 = 0x0352; public const int BX_5M4 = 0x0452; public const int BX_5E1 = 0x0154; public const int BX_5E2 = 0x0254; public const int BX_5E3 = 0x0354; public const int BX_5UT = 0x0055; public const int BX_5U0 = 0x0155; public const int BX_5U1 = 0x0255; public const int BX_5U2 = 0x0355; public const int BX_5U3 = 0x0455; public const int BX_5U4 = 0x0555; public const int BX_5U5 = 0x0655; public const int BX_5U = 0x0755; public const int BX_5UL = 0x0855; public const int AX_UL = 0x2055; public const int AX_UT = 0x2155; public const int AX_U0 = 0x2255; public const int AX_U1 = 0x2355; public const int AX_U2 = 0x2455; public const int BX_5Q0 = 0x0056; public const int BX_5Q1 = 0x0156; public const int BX_5Q2 = 0x0256; public const int BX_5Q0P = 0x1056; public const int BX_5Q1P = 0x1156; public const int BX_5Q2P = 0x1256; public const int BX_5QL = 0x1356; public const int BX_5QS1 = 0x0157; public const int BX_5QS2 = 0x0257; public const int BX_5QS = 0x0357; public const int BX_5QS1P = 0x1157; public const int BX_5QS2P = 0x1257; public const int BX_5QSP = 0x1357; #endregion #region 控制器通讯模式nSendMode public const int SEND_MODE_COMM = 0; public const int SEND_MODE_NET = 2; #endregion #region 用户发送信息命令表nSendCmd public const int SEND_CMD_PARAMETER = 41471; //加载屏参数。 public const int SEND_CMD_SENDALLPROGRAM = 41456; //发送所有节目信息。 public const int SEND_CMD_POWERON = 41727; //强制开机 public const int SEND_CMD_POWEROFF = 41726; //强制关机 public const int SEND_CMD_TIMERPOWERONOFF = 41725; //定时开关机 public const int SEND_CMD_CANCEL_TIMERPOWERONOFF = 41724; //取消定时开关机 public const int SEND_CMD_RESIVETIME = 41723; //校正时间。 public const int SEND_CMD_ADJUSTLIGHT = 41722; //亮度调整。 #endregion #region 返回错误代码 public const int RETURN_ERROR_AERETYPE = 0xF7;//区域类型错误,在添加、删除图文区域文件时区域类型出错返回此类型错误。 public const int RETURN_ERROR_RA_SCREENNO = 0xF8; //已经有该显示屏信息。如要重新设定请先DeleteScreen删除该显示屏再添加; public const int RETURN_ERROR_NOFIND_AREAFILE = 0xF9; //没有找到有效的区域文件(图文区域); public const int RETURN_ERROR_NOFIND_AREA = 0xFA; //没有找到有效的显示区域;可以使用AddScreenProgramBmpTextArea添加区域信息。 public const int RETURN_ERROR_NOFIND_PROGRAM = 0xFB; //没有找到有效的显示屏节目;可以使用AddScreenProgram函数添加指定节目 public const int RETURN_ERROR_NOFIND_SCREENNO = 0xFC; //系统内没有查找到该显示屏;可以使用AddScreen函数添加显示屏 public const int RETURN_ERROR_NOW_SENDING = 0xFD; //系统内正在向该显示屏通讯,请稍后再通讯; public const int RETURN_ERROR_OTHER = 0xFF; //其它错误; public const int RETURN_NOERROR = 0; //没有错误 #endregion #region 显示特技nStunt public const int STUNT_SUIJIXIANSHI = 0x00; //随机显示0 public const int STUNT_JINGTAI = 0x01; //静态1 public const int STUNT_KUAISUDACHU = 0x02; //快速打出2 public const int STUNT_XIANGZUOYIDONG = 0x03; //向左移动3 public const int STUNT_XIANGZUOLIANYI = 0x04; //向左连移4 public const int STUNT_XIANGSHANGYIDONG = 0x05; //向上移动5 public const int STUNT_XIANGSHANGLIANYI = 0x06; //向上连移6 public const int STUNT_SHANSHUO = 0x07; //闪烁7 public const int STUNT_PIAOXUE = 0x08; //飘雪8 public const int STUNT_MAOPAO = 0x09; //冒泡9 public const int STUNT_ZHONGJIANYICHU = 0x0A; //中间移出10 public const int STUNT_ZUOYOUYIRU = 0x0B; //左右移入11 public const int STUNT_ZUOYOUJIAOCHAYIRU = 0x0C; //左右交叉移入12 public const int STUNT_SHANGXIAJIAOCHAYIRU = 0x0D; //上下交叉移入13 public const int STUNT_HUAJUANBIHE = 0x0E; //画卷闭合14 public const int STUNT_HUAJUANDAKAI = 0x0F; //画卷打开15 public const int STUNT_XIANGZUOLASHEN = 0x10; //向左拉伸16 public const int STUNT_XIANGYOULASHEN = 0x11; //向右拉伸17 public const int STUNT_XIANGSHANGLASHEN = 0x12; //向上拉伸18 public const int STUNT_XIANGXIALASHEN = 0x13; //向下拉伸19 public const int STUNT_XIANGZUOLEISHE = 0x14; //向左镭射20 public const int STUNT_XIANGYOULEISHE = 0x15; //向右镭射21 public const int STUNT_XSLEISHE = 0x16; //向上镭射22 public const int STUNT_XIANGXIALEISHE = 0x17; //向下镭射23 public const int STUNT_ZUOYOUJIAOCHALAMU = 0x18; //左右交叉拉幕24 public const int STUNT_SHANGXIAJIAOCHALAMU = 0x19; //上下交叉拉幕25 public const int STUNT_FENSANZUOLA = 0x1A; //分散左拉26 public const int STUNT_SHUIPINGBAIYE = 0x1B; //水平百页27 public const int STUNT_CHUIZHIBAIYE = 0x1C; //垂直百页28 public const int STUNT_XIANGZUOLAMU = 0x1D; //向左拉幕29 public const int STUNT_XIANGYOULAMU = 0x1E; //向右拉幕30 public const int STUNT_XIANGSHANGLAMU = 0x1F; //向上拉幕31 public const int STUNT_XIANGXIALAMU = 0x20; //向下拉幕32 public const int STUNT_ZUOYOUBIHE = 0x21; //左右闭合33 public const int STUNT_ZUOYOUDUIKAI = 0x22; //左右对开34 public const int STUNT_SHANGXIABIHE = 0x23; //上下闭合35 public const int STUNT_SHANGXIADUIKAI = 0x24; //上下对开36 public const int STUNT_XIANGYOUYIDONG = 0x25; //向右移动37 public const int STUNT_XIANGYOULIANYI = 0x26; //向右连移38 public const int STUNT_XIANGXIAYIDONG = 0x27; //向下移动39 public const int STUNT_XIANGXIALIANYI = 0x28; //向下连移40 #endregion #region 初始化变量 public const int SCREEN_NO = 1; public const int SCREEN_TYPE = 1; public const int PIXEL_MODE = 2; public const int SCREEN_DATADA = 0; public const int SCREEN_DATAOE = 0; public const int SCREEN_ROWORDER = 0; public const int SCREEN_FREQPAR = 0; public const string SCREEN_COMM = "COM1"; public const int SCREEN_BAUD = 57600; public const int SCREEN_SOCKETPORT = 5005; public const int SERVER_MODE = 0; public const string BAR_CODE = ""; public const string NET_WORKID = "BX-NET000001"; public const string SERVER_IP = "112.65.245.174"; public const int SERVER_PORT = 6055; public const string SERVER_ACCESS_USER = "chenm"; public const string SERVER_ACCESS_PASSWORD = ""; public const string WIFI_IP = "192.168.100.1"; public const int WIFI_PORT = 5005; public const string GPRS_IP = "192.168.0.152"; public const int GPRS_PORT = 8120; public const string GPRS_ID = "BX-GP000001"; public const string SCREEN_STATUS_FILE = "D:\\ScreenStatus.ini"; #endregion #endregion //显示通讯记录 public virtual bool GetErrorMessage(string FUNCTION_NAME, int RETURN_ERROR, out string sResult) { bool bResult = true; sResult = string.Empty; return bResult; } //初始化动态库 public virtual int InitializeLED() { int result = 0; return result; } //释放动态库资源 public virtual int UninitializeLED() { int result = 0; return result; } //添加屏幕参数 public virtual int AddScreen(int CONTROL_TYPE, int SCREEN_WIDTH, int SCREEN_HEIGHT, string LED_IP) { int result = 0; return result; } //添加节目 public virtual int AddScreenProgram() { int result = 0; return result; } //添加图文区 public virtual int AddScreenProgramBmpTextArea(int AREA_X, int AREA_Y, int AREA_WIDTH, int AREA_HEIGHT) { int result = 0; return result; } //添加文件到图文区 //FILE_NAME需要写出根目录,如AppDomain.CurrentDomain.BaseDirectory+"@Files\192.168.100.31.txt" public virtual int AddScreenProgramAreaBmpTextFile(int AREA_ORDER, string FILE_NAME, int FONT_SIZE, int SHOW_STUNT, int RUN_SPEED, int SHOW_TIME) { int result = 0; return result; } //发送数据 public virtual int SendScreenInfo() { int result = 0; return result; } //强制关机 public virtual int PowerOffScreen() { int result = 0; return result; } //强制开机 public virtual int PowerOnScreen() { int result = 0; return result; } //删除显示屏幕 public virtual int DeleteScreen() { int result = 0; return result; } } }