private void button1_Click(object sender, EventArgs e) { uint hwnd = Led5kSDK.CreateClient(new byte[] { 1 }, 80, Led5kSDK.bx_5k_card_type.BX_5K1, 30, 0, (hand, err) => { MessageBox.Show(string.Format("{0}", err)); }); Led5kSDK.OFS_SendFileData() }
public int SendProgram(uint hand) { byte[] ppFileName; byte[] ProgramLife; byte PlayPeriodGrpNum; byte[] Period; byte[] AreaDataList; int AreaDataListLen; int sum = 0; foreach (Led5kstaticArea s in m_arealist) { sum += s.getAreaLen(); } AreaDataList = new byte[sum]; int index = 0; foreach (Led5kstaticArea s in m_arealist) { byte[] bt = s.AreaToByteArray(); bt.CopyTo(AreaDataList, index); index += bt.Length; } AreaDataListLen = sum; if (IsValidAlways == true) { ProgramLife = new byte[8]; ProgramLife[0] = 0xff; ProgramLife[1] = 0xff; ProgramLife[2] = 0xff; ProgramLife[3] = 0xff; ProgramLife[4] = 0xff; ProgramLife[5] = 0xff; ProgramLife[6] = 0xff; ProgramLife[7] = 0xff; } else { ProgramLife = new byte[8]; byte[] tmp = Led5kProgram.short2bcd(StartYear); ProgramLife[0] = tmp[0]; ProgramLife[1] = tmp[1]; ProgramLife[2] = byte2bcd(StartMonth); ProgramLife[3] = byte2bcd(StartDay); byte[] tmp1 = Led5kProgram.short2bcd(EndYear); ProgramLife[4] = tmp1[0]; ProgramLife[5] = tmp1[1]; ProgramLife[6] = byte2bcd(EndMonth); ProgramLife[7] = byte2bcd(EndDay); } ppFileName = System.Text.Encoding.Default.GetBytes(name); if (IsPlayOnTime == true) { Period = new byte[7]; Period[0] = byte2bcd(StartHour); Period[1] = byte2bcd(StartMinute); Period[2] = byte2bcd(StartSecond); Period[3] = byte2bcd(EndHour); Period[4] = byte2bcd(EndMinute); Period[5] = byte2bcd(EndSecond); Period[6] = 0; } else { Period = null; } PlayPeriodGrpNum = Convert.ToByte(IsPlayOnTime ? 1 : 0); return(Led5kSDK.OFS_SendFileData(hand, 1, ppFileName, DisplayType, PlayTimes, ProgramLife, ProgramWeek, PlayPeriodGrpNum, Period, AreaNum, AreaDataList, AreaDataListLen)); }
private void Form1_FormClosing(object sender, FormClosingEventArgs e) { Led5kSDK.ReleaseSdk(); }
public Form1() { InitializeComponent(); Led5kSDK.InitSdk(2, 2); }