|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | class  tagMCSpringSaleInfo(Structure): | 
|---|
|  |  |  | Head = tagHead() | 
|---|
|  |  |  | ActNum = 0    #(BYTE ActNum)//活动编号 | 
|---|
|  |  |  | StartDate = ""    #(char StartDate[10])// 开始日期 y-m-d | 
|---|
|  |  |  | EndtDate = ""    #(char EndtDate[10])// 结束日期 y-m-d | 
|---|
|  |  |  | AdvanceMinutes = 0    #(WORD AdvanceMinutes)// 提前显示分钟 | 
|---|
|  |  |  | 
|---|
|  |  |  | def ReadData(self, _lpData, _pos=0, _Len=0): | 
|---|
|  |  |  | self.Clear() | 
|---|
|  |  |  | _pos = self.Head.ReadData(_lpData, _pos) | 
|---|
|  |  |  | self.ActNum,_pos = CommFunc.ReadBYTE(_lpData, _pos) | 
|---|
|  |  |  | self.StartDate,_pos = CommFunc.ReadString(_lpData, _pos,10) | 
|---|
|  |  |  | self.EndtDate,_pos = CommFunc.ReadString(_lpData, _pos,10) | 
|---|
|  |  |  | self.AdvanceMinutes,_pos = CommFunc.ReadWORD(_lpData, _pos) | 
|---|
|  |  |  | 
|---|
|  |  |  | self.Head.Clear() | 
|---|
|  |  |  | self.Head.Cmd = 0xAA | 
|---|
|  |  |  | self.Head.SubCmd = 0x11 | 
|---|
|  |  |  | self.ActNum = 0 | 
|---|
|  |  |  | self.StartDate = "" | 
|---|
|  |  |  | self.EndtDate = "" | 
|---|
|  |  |  | self.AdvanceMinutes = 0 | 
|---|
|  |  |  | 
|---|
|  |  |  | def GetLength(self): | 
|---|
|  |  |  | length = 0 | 
|---|
|  |  |  | length += self.Head.GetLength() | 
|---|
|  |  |  | length += 1 | 
|---|
|  |  |  | length += 10 | 
|---|
|  |  |  | length += 10 | 
|---|
|  |  |  | length += 2 | 
|---|
|  |  |  | 
|---|
|  |  |  | def GetBuffer(self): | 
|---|
|  |  |  | data = '' | 
|---|
|  |  |  | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer()) | 
|---|
|  |  |  | data = CommFunc.WriteBYTE(data, self.ActNum) | 
|---|
|  |  |  | data = CommFunc.WriteString(data, 10, self.StartDate) | 
|---|
|  |  |  | data = CommFunc.WriteString(data, 10, self.EndtDate) | 
|---|
|  |  |  | data = CommFunc.WriteWORD(data, self.AdvanceMinutes) | 
|---|
|  |  |  | 
|---|
|  |  |  | def OutputString(self): | 
|---|
|  |  |  | DumpString = ''' | 
|---|
|  |  |  | Head:%s, | 
|---|
|  |  |  | ActNum:%d, | 
|---|
|  |  |  | StartDate:%s, | 
|---|
|  |  |  | EndtDate:%s, | 
|---|
|  |  |  | AdvanceMinutes:%d, | 
|---|
|  |  |  | 
|---|
|  |  |  | '''\ | 
|---|
|  |  |  | %( | 
|---|
|  |  |  | self.Head.OutputString(), | 
|---|
|  |  |  | self.ActNum, | 
|---|
|  |  |  | self.StartDate, | 
|---|
|  |  |  | self.EndtDate, | 
|---|
|  |  |  | self.AdvanceMinutes, | 
|---|