1194 lines
36 KiB
C++
1194 lines
36 KiB
C++
#include "HwInf.h"
|
|
|
|
#define dLineTypeMainCtl 1
|
|
#define dLineTypeMotherBrd 2
|
|
#define dLineTypePort 3
|
|
#define dLineTypeDirectPad 4
|
|
#define dLineTypeBusPad 5
|
|
#define dLineTypeEthNetwork 6
|
|
#define dLineTypeWifi 7
|
|
#define dLineTypeCanNetwork 8
|
|
#define dLineTypePrinter 9
|
|
#define dLineTypeCommBrd 10
|
|
|
|
extern "C"{
|
|
#include "uart_key_drv.h"
|
|
#include "uart_linkage_drv.h"
|
|
}
|
|
|
|
static const short svGridX[4] = {20, 220, 400, 540};
|
|
static const int HwTypeDescpTextLen = 14;
|
|
static const int PartNumTextLen = 34;
|
|
static const int CountTextLen = 40;
|
|
static const int VersionTextLen = 62;
|
|
static constexpr char PartNum[16] = "FC7011\0\0";
|
|
static constexpr char Version[16] = "260402ACN\0\0";
|
|
|
|
void THwInf::Init()
|
|
{
|
|
IsShow = 0;
|
|
Update =0;
|
|
StrList.LineSize =256;
|
|
StrList.SelectedLine =-1;
|
|
}
|
|
|
|
void THwInf::RenderBackGround(void)
|
|
{
|
|
RectFillRender(ContentGeometry.Left, ContentGeometry.Top, ContentGeometry.Right, ContentGeometry.Bottom, ContentColor);
|
|
}
|
|
|
|
void THwInf::RenderBackGround(unsigned int aClr)
|
|
{
|
|
RectFillRender(ContentGeometry.Left, ContentGeometry.Top, ContentGeometry.Right, ContentGeometry.Bottom, aClr);
|
|
}
|
|
|
|
void THwInf::DrawSelf(void)
|
|
{
|
|
RectFillRender(Lv.Caption.Left, Lv.Caption.Top, Lv.Caption.Right, Lv.Caption.Bottom, CaptionColor);
|
|
if(LanguageEnCn==0)
|
|
TextRender_string24(Lv.Caption.Left + 10, Lv.Caption.Top +4, clNearWhite, "本机->本机信息");
|
|
else
|
|
TextRender_string24(Lv.Caption.Left + 10, Lv.Caption.Top +4, clNearWhite, "Local->Hardware Info");
|
|
for(int i=0; i<Lv.Grid.UsingCount; i++)RectFillRender(Lv.Grid.Left[i], Lv.Grid.Top[i], Lv.Grid.Right[i], Lv.Grid.Bottom[i], ItemColor);
|
|
|
|
if(LanguageEnCn==0){
|
|
TextRender_string24(svGridX[0], Lv.Grid.Top[0] +4, clNearWhite, "组件");
|
|
TextRender_string24(svGridX[1], Lv.Grid.Top[0] +4, clNearWhite, "型号");
|
|
TextRender_string24(svGridX[2], Lv.Grid.Top[0] +4, clNearWhite, "数量");
|
|
TextRender_string24(svGridX[3], Lv.Grid.Top[0] +4, clNearWhite, "编码");
|
|
TextRender_string24(Lv.Grid.Left[1] + 180, Lv.Grid.Top[1] +4, clNearWhite, "正在收集信息");
|
|
}else{
|
|
TextRender_string24(svGridX[0], Lv.Grid.Top[0] +4, clNearWhite, "Component");
|
|
TextRender_string24(svGridX[1], Lv.Grid.Top[0] +4, clNearWhite, "PartNum");
|
|
TextRender_string24(svGridX[2], Lv.Grid.Top[0] +4, clNearWhite, "Count");
|
|
TextRender_string24(svGridX[3], Lv.Grid.Top[0] +4, clNearWhite, "ID Code");
|
|
TextRender_string24(Lv.Grid.Left[1] + 180, Lv.Grid.Top[1] +4, clNearWhite, "Collecting information.Please hold on");
|
|
}
|
|
}
|
|
|
|
void THwInf::DrawText()
|
|
{
|
|
unsigned int Addr;
|
|
int i,x,y,Inx;
|
|
if(StrList.DrawTopItem >= StrList.ItemsCount){
|
|
StrList.DrawTopItem =0;
|
|
}
|
|
Inx =2;
|
|
for(i=StrList.DrawTopItem; i<StrList.ItemsCount; i++){
|
|
for(x=0; x<68;x++){
|
|
IList->Str[x] = *(volatile unsigned char *)(StrList.Addr4Items + (i * StrList.LineSize) + x);
|
|
if(IList->Str[x] == '\0'){
|
|
break;
|
|
}
|
|
}
|
|
IList->Str[67] = '\0';
|
|
|
|
x = Lv.Grid.Left[Inx] + 8;
|
|
y = Lv.Grid.Top[Inx] +6;
|
|
TextRender_string24(x,y,clNearWhite, ItemColor, IList->Str);
|
|
Inx++;
|
|
if(Inx >10)break;
|
|
}
|
|
}
|
|
|
|
void THwInf::ClearSelected()
|
|
{
|
|
if( (StrList.SelectedLine > -1) && (StrList.SelectedLine < 9) ){
|
|
int Inx = StrList.SelectedLine +2;
|
|
RectFillRender(Lv.Grid.Left[Inx], Lv.Grid.Top[Inx], Lv.Grid.Left[Inx] + Lv.Grid.Right[Inx], Lv.Grid.Top[Inx] + 3, ItemColor); //draw rectangle
|
|
RectFillRender(Lv.Grid.Left[Inx], Lv.Grid.Top[Inx], Lv.Grid.Left[Inx] + 3, Lv.Grid.Bottom[Inx], ItemColor); //draw rectangle
|
|
RectFillRender(Lv.Grid.Right[Inx] -3, Lv.Grid.Top[Inx], Lv.Grid.Right[Inx], Lv.Grid.Bottom[Inx], ItemColor); //draw rectangle
|
|
RectFillRender(Lv.Grid.Left[Inx], Lv.Grid.Bottom[Inx] -3, Lv.Grid.Right[Inx], Lv.Grid.Bottom[Inx], ItemColor); //draw rectangle
|
|
}
|
|
}
|
|
|
|
void THwInf::DrawSelected()
|
|
{
|
|
if( (StrList.SelectedLine > -1) && (StrList.SelectedLine < 9) ){
|
|
int Inx = StrList.SelectedLine +2;
|
|
RectFillRender(Lv.Grid.Left[Inx], Lv.Grid.Top[Inx], Lv.Grid.Left[Inx] + Lv.Grid.Right[Inx], Lv.Grid.Top[Inx] + 3, clBlue); //draw rectangle
|
|
RectFillRender(Lv.Grid.Left[Inx], Lv.Grid.Top[Inx], Lv.Grid.Left[Inx] + 3, Lv.Grid.Bottom[Inx], clBlue); //draw rectangle
|
|
RectFillRender(Lv.Grid.Right[Inx] -3, Lv.Grid.Top[Inx], Lv.Grid.Right[Inx], Lv.Grid.Bottom[Inx], clBlue); //draw rectangle
|
|
RectFillRender(Lv.Grid.Left[Inx], Lv.Grid.Bottom[Inx] -3, Lv.Grid.Right[Inx], Lv.Grid.Bottom[Inx], clBlue); //draw rectangle
|
|
}
|
|
}
|
|
|
|
void THwInf::LoadData()
|
|
{
|
|
Update =1;
|
|
QueryPartNum();
|
|
QueryVersion(0xFe,0xFe);
|
|
QueryPnAndVer();
|
|
}
|
|
|
|
void THwInf::Show(void)
|
|
{
|
|
IsShow =1;
|
|
RenderBackGround();
|
|
IList->RealtimeData.Reset();
|
|
IList->ReadWriteData.Reset();
|
|
IList->TextOutClear();
|
|
DrawSelf();
|
|
Analy();
|
|
StrList.SelectedLine =0;
|
|
StrList.DrawTopItem =0;
|
|
DrawText();
|
|
DrawSelected();
|
|
LoadData();
|
|
}
|
|
|
|
void THwInf::FullRedraw(int Prm)
|
|
{
|
|
if(Prm == 0){
|
|
RenderBackGround();
|
|
DrawSelf();
|
|
ReDrawInf();
|
|
DrawText();
|
|
DrawSelected();
|
|
}else
|
|
if(Prm == 1){
|
|
RectFillRender(GuiRedrawDataList[1][0], GuiRedrawDataList[1][1], GuiRedrawDataList[1][2], GuiRedrawDataList[1][3], ContentColor);
|
|
DrawSelf();
|
|
DrawText();
|
|
DrawSelected();
|
|
}
|
|
}
|
|
|
|
//______________________________________________________________________________________________________________________________
|
|
|
|
void THwInf::ReDrawInf()
|
|
{
|
|
|
|
}
|
|
|
|
//_____________________________________________________________________________________________________________________________
|
|
|
|
TGuiMsgReturn THwInf::KeyIn(unsigned char aKey)
|
|
{
|
|
TGuiMsgReturn aMsg = guiMsgNone;
|
|
|
|
switch(aKey){
|
|
case VK_UP:
|
|
if(StrList.ItemsCount >0){
|
|
if(StrList.SelectedLine >0){
|
|
ClearSelected();
|
|
StrList.SelectedLine --;
|
|
DrawSelected();
|
|
}else
|
|
if(StrList.DrawTopItem > 0){
|
|
StrList.DrawTopItem--;
|
|
DrawText();
|
|
DrawSelected();
|
|
}
|
|
}
|
|
break;
|
|
case VK_DOWN:
|
|
if(StrList.ItemsCount >0){
|
|
if(StrList.SelectedLine <0){
|
|
StrList.DrawTopItem =0;
|
|
StrList.SelectedLine =0;
|
|
DrawSelected();
|
|
}
|
|
if(StrList.SelectedLine <8){
|
|
if( (StrList.DrawTopItem + StrList.SelectedLine +1) < StrList.ItemsCount){
|
|
ClearSelected();
|
|
StrList.SelectedLine ++;
|
|
DrawSelected();
|
|
}
|
|
}else{
|
|
if( (StrList.DrawTopItem + 8 +1) < StrList.ItemsCount){
|
|
StrList.DrawTopItem++;
|
|
DrawText();
|
|
DrawSelected();
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
case VK_RETURN:
|
|
IsShow = 0;
|
|
aMsg = guiMsgReturn;
|
|
break;
|
|
}
|
|
|
|
return aMsg;
|
|
}
|
|
|
|
void THwInf::QueryPartNum()
|
|
{
|
|
//Inner CAN
|
|
TCanHeaderID aIde;
|
|
unsigned char cVal;
|
|
unsigned int i;
|
|
unsigned int Len;
|
|
int iVal;
|
|
unsigned char aPx;
|
|
|
|
Len =4;
|
|
|
|
for(i=0; i<8; i++){
|
|
TxData[i] = 0;
|
|
}
|
|
|
|
aIde.BitF.Cmd = cmQueryBoardModel;
|
|
aIde.BitF.Pri = 1;
|
|
aIde.BitF.sLvl = 1;
|
|
aIde.BitF.dLvl = 7;
|
|
aIde.BitF.sAddr = 0;
|
|
aIde.BitF.dAddr = 127;
|
|
|
|
InnerCan.Buf4GuiSend.Insert(aIde, TxData, Len);
|
|
|
|
//KeyPadUart
|
|
//CommBrdUart
|
|
//ExtMemUart
|
|
//PrinterUart
|
|
}
|
|
|
|
void THwInf::QueryVersion(unsigned char aType, unsigned char aInx)
|
|
{
|
|
//Query 1.Port 2.MotherBoard 3.BusPad 4.DirectPad
|
|
TCanHeaderID aIde;
|
|
unsigned char cVal;
|
|
unsigned int i;
|
|
unsigned int Len;
|
|
int iVal;
|
|
unsigned char aPx;
|
|
|
|
Len =4;
|
|
|
|
for(i=0; i<8; i++){
|
|
TxData[i] = 0;
|
|
}
|
|
|
|
TxData[1] = aType;
|
|
TxData[2] = aInx;
|
|
|
|
aIde.BitF.Cmd = cmQueryVer;
|
|
aIde.BitF.Pri = 1;
|
|
aIde.BitF.sLvl = 1;
|
|
aIde.BitF.dLvl = 7;
|
|
aIde.BitF.sAddr = 0;
|
|
aIde.BitF.dAddr = 127;
|
|
|
|
InnerCan.Buf4GuiSend.Insert(aIde, TxData, Len);
|
|
}
|
|
|
|
void THwInf::QueryPnAndVer()
|
|
{
|
|
//KeyPadUart
|
|
sys_get_power_ver(0);
|
|
sys_get_power_ver(1);
|
|
sys_get_power_ver(2);
|
|
sys_get_sw_brd_ver();
|
|
sys_get_sw_brd_descp();
|
|
|
|
//CommBrdUart
|
|
get_commbrd_ver_modle();
|
|
|
|
//ExtMemUart
|
|
ExRecord.GetVerFlag = 1;
|
|
ExRecord.GetModleFlag = 1;
|
|
//PrinterUart
|
|
}
|
|
|
|
|
|
|
|
void THwInf::InnerCanPushData(unsigned char aCmd, unsigned char *pData)
|
|
{
|
|
unsigned char tHwType, tNum, tInx;
|
|
int i,x;
|
|
if(IsShow == 0)return;
|
|
tHwType = pData[1];
|
|
tNum = pData[2];
|
|
if(aCmd == cmQueryBoardModel){
|
|
tInx = pData[3];
|
|
switch(tHwType){
|
|
case btDirectPad:
|
|
if(tInx == 0){
|
|
if(tNum && (tNum<=dDIRECTCTL_MAX_COUNT) ){
|
|
tNum--;
|
|
IList->DirectPadOk[tNum] |= 1;
|
|
}
|
|
}else
|
|
if(tInx <5){
|
|
if(tNum && (tNum<=dDIRECTCTL_MAX_COUNT) ){
|
|
tNum--;
|
|
tInx--;
|
|
for(i=0;i<4;i++) IList->RealtimeData.PnVerDirectPad[tNum][(tInx*4) + i]=pData[i+4];
|
|
}
|
|
}
|
|
break;
|
|
case btBusPad:
|
|
if(tInx == 0){
|
|
if(tNum && (tNum<=dDIRECTCTL_MAX_COUNT) ){
|
|
tNum--;
|
|
IList->BusPadOk[tNum] |= 1;
|
|
}
|
|
}else
|
|
if(tInx <5){
|
|
if(tNum && (tNum<=dHANDCTL_MAX_COUNT)){
|
|
tNum--;
|
|
tInx--;
|
|
for(i=0;i<4;i++) IList->RealtimeData.PnVerBusPad[tNum][(tInx*4) + i]=pData[i+4];
|
|
}
|
|
}
|
|
break;
|
|
case btMotherBoard:
|
|
if(tInx == 0){
|
|
if(tNum && (tNum<=5) ){
|
|
tNum--;
|
|
IList->MotherBrdOk[tNum] |= 1;
|
|
}
|
|
}else
|
|
if(tInx <5){
|
|
if(tNum && (tNum<=5)){
|
|
tNum--;
|
|
tInx--;
|
|
for(i=0;i<4;i++) IList->PnVerMotherBoard[tNum][(tInx*4) + i]=pData[i+4];
|
|
}
|
|
}
|
|
break;
|
|
case btPort:
|
|
if(tInx == 0){
|
|
if(tNum && (tNum<=dPORT_MAX_COUNT) ){
|
|
tNum--;
|
|
IList->PortOk[tNum] |= 1;
|
|
}
|
|
}else
|
|
if(tInx <5){
|
|
if(tNum && (tNum<=dPORT_MAX_COUNT)){
|
|
tNum--;
|
|
tInx--;
|
|
for(i=0;i<4;i++) IList->RealtimeData.PnVerPort[tNum][(tInx*4) + i]=pData[i+4];
|
|
}
|
|
}
|
|
break;
|
|
default:break;
|
|
}
|
|
Update =1;
|
|
}else
|
|
if(aCmd == cmQueryVer){
|
|
switch(tHwType){
|
|
case btDirectPad:
|
|
if(tNum && (tNum<=dDIRECTCTL_MAX_COUNT)){
|
|
tNum--;
|
|
for(i=0;i<5;i++) IList->RealtimeData.PnVerDirectPad[tNum][i+16]=pData[i+3];
|
|
IList->DirectPadOk[tNum] |= 2;
|
|
}
|
|
break;
|
|
case btBusPad:
|
|
if(tNum && (tNum<=dHANDCTL_MAX_COUNT)){
|
|
tNum--;
|
|
for(i=0;i<5;i++) IList->RealtimeData.PnVerBusPad[tNum][i+16]=pData[i+3];
|
|
IList->BusPadOk[tNum] |= 2;
|
|
}
|
|
break;
|
|
case btMotherBoard:
|
|
if(tNum && (tNum<=5)){
|
|
tNum--;
|
|
for(i=0;i<5;i++) IList->PnVerMotherBoard[tNum][i+16]=pData[i+3];
|
|
IList->MotherBrdOk[tNum] |= 2;
|
|
}
|
|
break;
|
|
case btPort:
|
|
if(tNum && (tNum<=dPORT_MAX_COUNT)){
|
|
tNum--;
|
|
for(i=0;i<5;i++) IList->RealtimeData.PnVerPort[tNum][i+16]=pData[i+3];
|
|
IList->PortOk[tNum] |= 2;
|
|
}
|
|
break;
|
|
default:break;
|
|
}
|
|
Update =1;
|
|
}
|
|
}
|
|
|
|
void THwInf::KeyPadUartPushData(unsigned char aCmd, unsigned char *pData)
|
|
{
|
|
unsigned char tHwType, tNum, tLen;
|
|
int i,x;
|
|
|
|
if(IsShow == 0)return;
|
|
tHwType = pData[0];
|
|
tNum = pData[1];
|
|
tLen = pData[2];
|
|
if(aCmd == cmQueryBoardModel){
|
|
switch(tHwType){
|
|
case btKeyPad:
|
|
for(i=0;(i<tLen)&&(i<16);i++) IList->PnVerKeyPad[i]=pData[i+3];
|
|
IList->KeyPadOk |= 1;
|
|
break;
|
|
case btPowerSuply:
|
|
|
|
break;
|
|
default:break;
|
|
}
|
|
Update =1;
|
|
}else
|
|
if(aCmd == cmQueryVer){
|
|
switch(tHwType){
|
|
case btKeyPad:
|
|
for(i=0;i<5;i++) IList->PnVerKeyPad[i+16]=pData[i+3];
|
|
IList->KeyPadOk |= 2;
|
|
break;
|
|
case btPowerSuply:
|
|
if( tNum <4 ){
|
|
IList->PnVerPowerSpy[tNum][0] = 'P';
|
|
IList->PnVerPowerSpy[tNum][1] = 'o';
|
|
IList->PnVerPowerSpy[tNum][2] = 'w';
|
|
IList->PnVerPowerSpy[tNum][3] = 'e';
|
|
IList->PnVerPowerSpy[tNum][4] = 'r';
|
|
IList->PnVerPowerSpy[tNum][5] = 'S';
|
|
IList->PnVerPowerSpy[tNum][6] = 'u';
|
|
IList->PnVerPowerSpy[tNum][7] = 'p';
|
|
IList->PnVerPowerSpy[tNum][8] = 'p';
|
|
IList->PnVerPowerSpy[tNum][9] = 'l';
|
|
IList->PnVerPowerSpy[tNum][10] = 'y';
|
|
IList->PnVerPowerSpy[tNum][11] = '\0';
|
|
for(i=0;i<5;i++) IList->PnVerPowerSpy[tNum][i+16]=pData[i+3];
|
|
IList->PowerSpyOk[tNum] =3;
|
|
}
|
|
break;
|
|
default:break;
|
|
}
|
|
Update =1;
|
|
}
|
|
}
|
|
|
|
void THwInf::CommBrdUartPushData(unsigned char aCmd, unsigned char *pData)
|
|
{
|
|
unsigned char tHwType, tNum, tLen;
|
|
int i,x;
|
|
|
|
if(IsShow == 0)return;
|
|
tHwType = pData[0];
|
|
tNum = pData[1];
|
|
tLen = pData[2];
|
|
if(aCmd == cmQueryBoardModel){
|
|
switch(tHwType){
|
|
case btCommPort:
|
|
for(i=0;(i<tLen)&&(i<16);i++) IList->PnVerCommBoard[i]=pData[i+3];
|
|
IList->CommBoardOk |= 1;
|
|
break;
|
|
default:break;
|
|
}
|
|
Update =1;
|
|
}else
|
|
if(aCmd == cmQueryVer){
|
|
switch(tHwType){
|
|
case btCommPort:
|
|
for(i=0;i<5;i++) IList->PnVerCommBoard[i+16]=pData[i+3];
|
|
IList->CommBoardOk |= 2;
|
|
break;
|
|
default:break;
|
|
}
|
|
Update =1;
|
|
}
|
|
}
|
|
|
|
void THwInf::ExtMemUartPushData(unsigned char aCmd, unsigned char *pData)
|
|
{
|
|
unsigned char tHwType, tNum, tLen;
|
|
int i,x;
|
|
if(IsShow == 0)return;
|
|
tHwType = pData[0];
|
|
tNum = pData[1];
|
|
tLen = pData[2];
|
|
if(aCmd == cmQueryBoardModel){
|
|
switch(tHwType){
|
|
case btExMem:
|
|
for(i=0;(i<tLen)&&(i<16);i++) IList->PnVerExtMem[i]=pData[i+3];
|
|
IList->ExtMemOk |= 1;
|
|
break;
|
|
default:break;
|
|
}
|
|
Update =1;
|
|
}else
|
|
if(aCmd == cmQueryVer){
|
|
switch(tHwType){
|
|
case btExMem:
|
|
for(i=0;i<5;i++) IList->PnVerExtMem[i+16]=pData[i+3];
|
|
IList->ExtMemOk |= 2;
|
|
break;
|
|
default:break;
|
|
}
|
|
Update =1;
|
|
}
|
|
}
|
|
|
|
void THwInf::PrinterUartPushData(unsigned char aCmd, unsigned char *pData)
|
|
{
|
|
if(IsShow == 0)return;
|
|
|
|
}
|
|
|
|
int THwInf::GetVerText(char *pSource, char *pText)
|
|
{
|
|
int i,x;
|
|
unsigned char c;
|
|
x =0;
|
|
for(i=0; i<5;i++){
|
|
c = pSource[i] >> 4;
|
|
if(c<10){
|
|
pText[x] = c +'0';
|
|
}else
|
|
if(c<11){
|
|
pText[x] = '.';
|
|
}else{
|
|
pText[x] = '\0';
|
|
return x;
|
|
}
|
|
x++;
|
|
c = pSource[i] & 0x0F;
|
|
if(c<10){
|
|
pText[x] = c +'0';
|
|
}else
|
|
if(c<11){
|
|
pText[x] = '.';
|
|
}else{
|
|
pText[x] = '\0';
|
|
return x;
|
|
}
|
|
x++;
|
|
}
|
|
return 10;
|
|
}
|
|
|
|
void THwInf::Analy()
|
|
{
|
|
//dAddrSdRam_HwInf
|
|
unsigned int Addr, PnLen, VerLen, PnLenInRam, VerLenInRam;
|
|
int i,x,z,IsEq;
|
|
int CmpStartLine, MatchLine;
|
|
|
|
StrList.LineSize = 256;
|
|
StrList.Addr4LinesType = dAddrSdRam_HwInf;
|
|
StrList.Addr4ItemsCount = dAddrSdRam_HwInf + (128*4);
|
|
StrList.Addr4Items = dAddrSdRam_HwInf + (StrList.LineSize*4);
|
|
|
|
for(i=0; i<16384; i++){
|
|
*(volatile unsigned int *)(dAddrSdRam_HwInf + i*4) = 0;
|
|
}
|
|
|
|
//Clear Lines Type
|
|
Addr = dAddrSdRam_HwInf;
|
|
for(i=0; i<128; i++){
|
|
*(volatile unsigned int *)(Addr + i*4) = 0;
|
|
}
|
|
|
|
StrList.ItemsCount =0;
|
|
*(volatile unsigned int *)(StrList.Addr4LinesType + (StrList.ItemsCount)*4) = btDisplay;
|
|
*(volatile unsigned int *)(StrList.Addr4ItemsCount + (StrList.ItemsCount)*4) = 1;
|
|
TMyString::sClear(IList->Str);
|
|
if(LanguageEnCn==0)TMyString::sAddOnStr("主控板",IList->Str);
|
|
else TMyString::sAddOnStr("Main Board",IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, HwTypeDescpTextLen);
|
|
TMyString::sAddOnStr(PartNum, IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, PartNumTextLen);
|
|
TMyString::sAddOn2Dg(1, IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, CountTextLen);
|
|
TMyString::sAddOnStr(Version, IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, VersionTextLen);
|
|
for(z=0; z<VersionTextLen; z++){
|
|
*(volatile unsigned char *)(StrList.Addr4Items + (StrList.ItemsCount * StrList.LineSize) +z) = IList->Str[z];
|
|
}
|
|
*(volatile unsigned char *)(StrList.Addr4Items + (StrList.ItemsCount * StrList.LineSize) +VersionTextLen) = '\0';
|
|
StrList.ItemsCount++;
|
|
|
|
//Mother Board
|
|
CmpStartLine = StrList.ItemsCount;
|
|
for(i=0; i<5; i++){
|
|
if(IList->MotherBrdOk[i] == 3) {
|
|
IList->StrPn[16] = '\0';
|
|
for(z=0; z<16; z++){
|
|
IList->StrPn[z] = IList->PnVerMotherBoard[i][z];
|
|
if(IList->StrPn[z] == 0)break;
|
|
}
|
|
PnLen = z;
|
|
VerLen = GetVerText(&IList->PnVerMotherBoard[i][16], IList->StrVer);
|
|
MatchLine = -1;
|
|
for(x=CmpStartLine; x<StrList.ItemsCount; x++){
|
|
IList->StrPnInRam[16] = '\0';
|
|
for(z=0; z<16; z++){
|
|
IList->StrPnInRam[z] = *(volatile unsigned char *)(StrList.Addr4Items + (x * StrList.LineSize + HwTypeDescpTextLen) + z);
|
|
if(IList->StrPnInRam[z] == 0)break;
|
|
if(IList->StrPnInRam[z] == ' ')break;
|
|
}
|
|
PnLenInRam = z;
|
|
IList->StrVerInRam[10] = '\0';
|
|
for(z=0; z<10; z++){
|
|
IList->StrVerInRam[z] = *(volatile unsigned char *)(StrList.Addr4Items + (x * StrList.LineSize + CountTextLen) + z);
|
|
if(IList->StrVerInRam[z] == 0)break;
|
|
if(IList->StrVerInRam[z] == ' ')break;
|
|
}
|
|
VerLenInRam = z;
|
|
if( (PnLen == PnLenInRam) && (VerLen == VerLenInRam) ){
|
|
IsEq =1;
|
|
for(z=0; z<PnLen; z++){
|
|
if(IList->StrPnInRam[z] != IList->StrPn[z]){
|
|
IsEq =0;
|
|
break;
|
|
}
|
|
}
|
|
if(IsEq){
|
|
for(z=0; z<VerLen; z++){
|
|
if(IList->StrVerInRam[z] != IList->StrVer[z]){
|
|
IsEq =0;
|
|
break;
|
|
}
|
|
}
|
|
|
|
}
|
|
}else{
|
|
IsEq =0;
|
|
}
|
|
if(IsEq){
|
|
MatchLine = x;
|
|
break;
|
|
}
|
|
}
|
|
if(MatchLine > -1){
|
|
z = *(volatile unsigned int *)(StrList.Addr4ItemsCount + MatchLine*4 ) +1;
|
|
*(volatile unsigned int *)(StrList.Addr4ItemsCount + MatchLine*4 ) = z;
|
|
*(volatile unsigned char *)(StrList.Addr4Items + (MatchLine * StrList.LineSize) +PartNumTextLen +0) = z/10%10 + '0';
|
|
*(volatile unsigned char *)(StrList.Addr4Items + (MatchLine * StrList.LineSize) +PartNumTextLen +1) = z%10 + '0';
|
|
}else{
|
|
*(volatile unsigned int *)(StrList.Addr4LinesType + (StrList.ItemsCount)*4) = btMotherBoard;
|
|
*(volatile unsigned int *)(StrList.Addr4ItemsCount + (StrList.ItemsCount)*4) = 1;
|
|
TMyString::sClear(IList->Str);
|
|
if(LanguageEnCn==0)
|
|
TMyString::sAddOnStr("回路母板", IList->Str);
|
|
else
|
|
TMyString::sAddOnStr("Mother Brd", IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, HwTypeDescpTextLen);
|
|
TMyString::sAddOnStr(IList->StrPn, IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, PartNumTextLen);
|
|
TMyString::sAddOn2Dg(1, IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, CountTextLen);
|
|
TMyString::sAddOnStr(IList->StrVer, IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, VersionTextLen);
|
|
for(z=0; z<VersionTextLen; z++){
|
|
*(volatile unsigned char *)(StrList.Addr4Items + (StrList.ItemsCount * StrList.LineSize) +z) = IList->Str[z];
|
|
}
|
|
*(volatile unsigned char *)(StrList.Addr4Items + (StrList.ItemsCount * StrList.LineSize) +VersionTextLen) = '\0';
|
|
StrList.ItemsCount++;
|
|
}
|
|
}
|
|
}
|
|
|
|
//Port
|
|
CmpStartLine = StrList.ItemsCount;
|
|
for(i=0; i<40; i++){
|
|
if(IList->PortOk[i] == 3) {
|
|
IList->StrPn[16] = '\0';
|
|
for(z=0; z<16; z++){
|
|
IList->StrPn[z] = IList->RealtimeData.PnVerPort[i][z];
|
|
if(IList->StrPn[z] == 0)break;
|
|
}
|
|
PnLen = z;
|
|
VerLen = GetVerText(&IList->RealtimeData.PnVerPort[i][16], IList->StrVer);
|
|
MatchLine = -1;
|
|
for(x=CmpStartLine; x<StrList.ItemsCount; x++){
|
|
IList->StrPnInRam[16] = '\0';
|
|
for(z=0; z<16; z++){
|
|
IList->StrPnInRam[z] = *(volatile unsigned char *)(StrList.Addr4Items + (x * StrList.LineSize + HwTypeDescpTextLen) + z);
|
|
if(IList->StrPnInRam[z] == 0)break;
|
|
if(IList->StrPnInRam[z] == ' ')break;
|
|
}
|
|
PnLenInRam = z;
|
|
IList->StrVerInRam[10] = '\0';
|
|
for(z=0; z<10; z++){
|
|
IList->StrVerInRam[z] = *(volatile unsigned char *)(StrList.Addr4Items + (x * StrList.LineSize + CountTextLen) + z);
|
|
if(IList->StrVerInRam[z] == 0)break;
|
|
if(IList->StrVerInRam[z] == ' ')break;
|
|
}
|
|
VerLenInRam = z;
|
|
|
|
if( (PnLen == PnLenInRam) && (VerLen == VerLenInRam) ){
|
|
IsEq =1;
|
|
for(z=0; z<PnLen; z++){
|
|
if(IList->StrPnInRam[z] != IList->StrPn[z]){
|
|
IsEq =0;
|
|
break;
|
|
}
|
|
}
|
|
if(IsEq){
|
|
for(z=0; z<VerLen; z++){
|
|
if(IList->StrVerInRam[z] != IList->StrVer[z]){
|
|
IsEq =0;
|
|
break;
|
|
}
|
|
}
|
|
|
|
}
|
|
}else{
|
|
IsEq =0;
|
|
}
|
|
if(IsEq){
|
|
MatchLine = x;
|
|
break;
|
|
}
|
|
}
|
|
if(MatchLine > -1){
|
|
z = *(volatile unsigned int *)(StrList.Addr4ItemsCount + MatchLine*4 ) +1;
|
|
*(volatile unsigned int *)(StrList.Addr4ItemsCount + MatchLine*4 ) = z;
|
|
*(volatile unsigned char *)(StrList.Addr4Items + (MatchLine * StrList.LineSize) +PartNumTextLen +0) = z/10%10 + '0';
|
|
*(volatile unsigned char *)(StrList.Addr4Items + (MatchLine * StrList.LineSize) +PartNumTextLen +1) = z%10 + '0';
|
|
}else{
|
|
*(volatile unsigned int *)(StrList.Addr4LinesType + (StrList.ItemsCount)*4) = btPort;
|
|
*(volatile unsigned int *)(StrList.Addr4ItemsCount + (StrList.ItemsCount)*4) = 1;
|
|
TMyString::sClear(IList->Str);
|
|
if(LanguageEnCn==0)
|
|
TMyString::sAddOnStr( "回路卡", IList->Str);
|
|
else
|
|
TMyString::sAddOnStr( "Loop Board", IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, HwTypeDescpTextLen);
|
|
TMyString::sAddOnStr(IList->StrPn, IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, PartNumTextLen);
|
|
TMyString::sAddOn2Dg(1, IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, CountTextLen);
|
|
TMyString::sAddOnStr(IList->StrVer, IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, VersionTextLen);
|
|
for(z=0; z<VersionTextLen; z++){
|
|
*(volatile unsigned char *)(StrList.Addr4Items + (StrList.ItemsCount * StrList.LineSize) +z) = IList->Str[z];
|
|
}
|
|
*(volatile unsigned char *)(StrList.Addr4Items + (StrList.ItemsCount * StrList.LineSize) +VersionTextLen) = '\0';
|
|
StrList.ItemsCount++;
|
|
}
|
|
}
|
|
}
|
|
|
|
//Direct Pad
|
|
CmpStartLine = StrList.ItemsCount;
|
|
for(i=0; i<20; i++){
|
|
if(IList->DirectPadOk[i] == 3) {
|
|
IList->StrPn[16] = '\0';
|
|
for(z=0; z<16; z++){
|
|
IList->StrPn[z] = IList->RealtimeData.PnVerDirectPad[i][z];
|
|
if(IList->StrPn[z] == 0)break;
|
|
}
|
|
PnLen = z;
|
|
VerLen = GetVerText(&IList->RealtimeData.PnVerDirectPad[i][16], IList->StrVer);
|
|
MatchLine = -1;
|
|
for(x=CmpStartLine; x<StrList.ItemsCount; x++){
|
|
IList->StrPnInRam[16] = '\0';
|
|
for(z=0; z<16; z++){
|
|
IList->StrPnInRam[z] = *(volatile unsigned char *)(StrList.Addr4Items + (x * StrList.LineSize + HwTypeDescpTextLen) + z);
|
|
if(IList->StrPnInRam[z] == 0)break;
|
|
if(IList->StrPnInRam[z] == ' ')break;
|
|
}
|
|
PnLenInRam = z;
|
|
IList->StrVerInRam[10] = '\0';
|
|
for(z=0; z<10; z++){
|
|
IList->StrVerInRam[z] = *(volatile unsigned char *)(StrList.Addr4Items + (x * StrList.LineSize + CountTextLen) + z);
|
|
if(IList->StrVerInRam[z] == 0)break;
|
|
if(IList->StrVerInRam[z] == ' ')break;
|
|
}
|
|
VerLenInRam = z;
|
|
|
|
if( (PnLen == PnLenInRam) && (VerLen == VerLenInRam) ){
|
|
IsEq =1;
|
|
for(z=0; z<PnLen; z++){
|
|
if(IList->StrPnInRam[z] != IList->StrPn[z]){
|
|
IsEq =0;
|
|
break;
|
|
}
|
|
}
|
|
if(IsEq){
|
|
for(z=0; z<VerLen; z++){
|
|
if(IList->StrVerInRam[z] != IList->StrVer[z]){
|
|
IsEq =0;
|
|
break;
|
|
}
|
|
}
|
|
|
|
}
|
|
}else{
|
|
IsEq =0;
|
|
}
|
|
if(IsEq){
|
|
MatchLine = x;
|
|
break;
|
|
}
|
|
}
|
|
if(MatchLine > -1){
|
|
z = *(volatile unsigned int *)(StrList.Addr4ItemsCount + MatchLine*4 ) +1;
|
|
*(volatile unsigned int *)(StrList.Addr4ItemsCount + MatchLine*4 ) = z;
|
|
*(volatile unsigned char *)(StrList.Addr4Items + (MatchLine * StrList.LineSize) +PartNumTextLen +0) = z/10%10 + '0';
|
|
*(volatile unsigned char *)(StrList.Addr4Items + (MatchLine * StrList.LineSize) +PartNumTextLen +1) = z%10 + '0';
|
|
}else{
|
|
*(volatile unsigned int *)(StrList.Addr4LinesType + (StrList.ItemsCount)*4) = btDirectPad;
|
|
*(volatile unsigned int *)(StrList.Addr4ItemsCount + (StrList.ItemsCount)*4) = 1;
|
|
TMyString::sClear(IList->Str);
|
|
if(LanguageEnCn==0)
|
|
TMyString::sAddOnStr( "多线盘", IList->Str);
|
|
else
|
|
TMyString::sAddOnStr( "Direct Ctrl", IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, HwTypeDescpTextLen);
|
|
TMyString::sAddOnStr(IList->StrPn, IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, PartNumTextLen);
|
|
TMyString::sAddOn2Dg(1, IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, CountTextLen);
|
|
TMyString::sAddOnStr(IList->StrVer, IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, VersionTextLen);
|
|
for(z=0; z<VersionTextLen; z++){
|
|
*(volatile unsigned char *)(StrList.Addr4Items + (StrList.ItemsCount * StrList.LineSize) +z) = IList->Str[z];
|
|
}
|
|
*(volatile unsigned char *)(StrList.Addr4Items + (StrList.ItemsCount * StrList.LineSize) +VersionTextLen) = '\0';
|
|
StrList.ItemsCount++;
|
|
}
|
|
}
|
|
}
|
|
|
|
//Bus Pad
|
|
CmpStartLine = StrList.ItemsCount;
|
|
for(i=0; i<20; i++){
|
|
if(IList->BusPadOk[i] == 3) {
|
|
IList->StrPn[16] = '\0';
|
|
for(z=0; z<16; z++){
|
|
IList->StrPn[z] = IList->RealtimeData.PnVerBusPad[i][z];
|
|
if(IList->StrPn[z] == 0)break;
|
|
}
|
|
PnLen = z;
|
|
VerLen = GetVerText(&IList->RealtimeData.PnVerBusPad[i][16], IList->StrVer);
|
|
MatchLine = -1;
|
|
for(x=CmpStartLine; x<StrList.ItemsCount; x++){
|
|
IList->StrPnInRam[16] = '\0';
|
|
for(z=0; z<16; z++){
|
|
IList->StrPnInRam[z] = *(volatile unsigned char *)(StrList.Addr4Items + (x * StrList.LineSize + HwTypeDescpTextLen) + z);
|
|
if(IList->StrPnInRam[z] == 0)break;
|
|
if(IList->StrPnInRam[z] == ' ')break;
|
|
}
|
|
PnLenInRam = z;
|
|
IList->StrVerInRam[10] = '\0';
|
|
for(z=0; z<10; z++){
|
|
IList->StrVerInRam[z] = *(volatile unsigned char *)(StrList.Addr4Items + (x * StrList.LineSize + CountTextLen) + z);
|
|
if(IList->StrVerInRam[z] == 0)break;
|
|
if(IList->StrVerInRam[z] == ' ')break;
|
|
}
|
|
VerLenInRam = z;
|
|
|
|
|
|
if( (PnLen == PnLenInRam) && (VerLen == VerLenInRam) ){
|
|
IsEq =1;
|
|
for(z=0; z<PnLen; z++){
|
|
if(IList->StrPnInRam[z] != IList->StrPn[z]){
|
|
IsEq =0;
|
|
break;
|
|
}
|
|
}
|
|
if(IsEq){
|
|
for(z=0; z<VerLen; z++){
|
|
if(IList->StrVerInRam[z] != IList->StrVer[z]){
|
|
IsEq =0;
|
|
break;
|
|
}
|
|
}
|
|
|
|
}
|
|
}else{
|
|
IsEq =0;
|
|
}
|
|
if(IsEq){
|
|
MatchLine = x;
|
|
break;
|
|
}
|
|
}
|
|
if(MatchLine > -1){
|
|
z = *(volatile unsigned int *)(StrList.Addr4ItemsCount + MatchLine*4 ) +1;
|
|
*(volatile unsigned int *)(StrList.Addr4ItemsCount + MatchLine*4 ) = z;
|
|
*(volatile unsigned char *)(StrList.Addr4Items + (MatchLine * StrList.LineSize) +PartNumTextLen +0) = z/10%10 + '0';
|
|
*(volatile unsigned char *)(StrList.Addr4Items + (MatchLine * StrList.LineSize) +PartNumTextLen +1) = z%10 + '0';
|
|
}else{
|
|
*(volatile unsigned int *)(StrList.Addr4LinesType + (StrList.ItemsCount)*4) = btBusPad;
|
|
*(volatile unsigned int *)(StrList.Addr4ItemsCount + (StrList.ItemsCount)*4) = 1;
|
|
TMyString::sClear(IList->Str);
|
|
if(LanguageEnCn==0)TMyString::sAddOnStr( "总线盘", IList->Str);
|
|
else TMyString::sAddOnStr( "Bus Pads", IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, HwTypeDescpTextLen);
|
|
TMyString::sAddOnStr(IList->StrPn, IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, PartNumTextLen);
|
|
TMyString::sAddOn2Dg(1, IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, CountTextLen);
|
|
TMyString::sAddOnStr(IList->StrVer, IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, VersionTextLen);
|
|
for(z=0; z<VersionTextLen; z++){
|
|
*(volatile unsigned char *)(StrList.Addr4Items + (StrList.ItemsCount * StrList.LineSize) +z) = IList->Str[z];
|
|
}
|
|
*(volatile unsigned char *)(StrList.Addr4Items + (StrList.ItemsCount * StrList.LineSize) +VersionTextLen) = '\0';
|
|
StrList.ItemsCount++;
|
|
}
|
|
}
|
|
}
|
|
|
|
//EthNetwork Not NowCmpStartLine = StrList.ItemsCount;
|
|
if(IList->EthNetworkOk == 3) {
|
|
IList->StrPn[16] = '\0';
|
|
for(z=0; z<16; z++){
|
|
IList->StrPn[z] = IList->PnVerEth[z];
|
|
if(IList->StrPn[z] == 0)break;
|
|
}
|
|
PnLen = z;
|
|
VerLen = GetVerText(&IList->PnVerEth[16], IList->StrVer);
|
|
|
|
*(volatile unsigned int *)(StrList.Addr4LinesType + (StrList.ItemsCount)*4) = btEthNet;
|
|
*(volatile unsigned int *)(StrList.Addr4ItemsCount + (StrList.ItemsCount)*4) = 1;
|
|
TMyString::sClear(IList->Str);
|
|
if(LanguageEnCn==0)TMyString::sAddOnStr( "以太网卡", IList->Str);
|
|
else TMyString::sAddOnStr( "Ethernet", IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, HwTypeDescpTextLen);
|
|
TMyString::sAddOnStr(IList->StrPn, IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, PartNumTextLen);
|
|
TMyString::sAddOn2Dg(1, IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, CountTextLen);
|
|
TMyString::sAddOnStr(IList->StrVer, IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, VersionTextLen);
|
|
for(z=0; z<VersionTextLen; z++){
|
|
*(volatile unsigned char *)(StrList.Addr4Items + (StrList.ItemsCount * StrList.LineSize) +z) = IList->Str[z];
|
|
}
|
|
*(volatile unsigned char *)(StrList.Addr4Items + (StrList.ItemsCount * StrList.LineSize) +VersionTextLen) = '\0';
|
|
StrList.ItemsCount++;
|
|
}
|
|
|
|
//Wifi Not Now btWireless
|
|
if(IList->WirelessOk == 3) {
|
|
IList->StrPn[16] = '\0';
|
|
for(z=0; z<16; z++){
|
|
IList->StrPn[z] = IList->PnVerWireless[z];
|
|
if(IList->StrPn[z] == 0)break;
|
|
}
|
|
PnLen = z;
|
|
VerLen = GetVerText(&IList->PnVerWireless[16], IList->StrVer);
|
|
|
|
*(volatile unsigned int *)(StrList.Addr4LinesType + (StrList.ItemsCount)*4) = btWireless;
|
|
*(volatile unsigned int *)(StrList.Addr4ItemsCount + (StrList.ItemsCount)*4) = 1;
|
|
TMyString::sClear(IList->Str);
|
|
if(LanguageEnCn==0)TMyString::sAddOnStr( "无线通讯卡", IList->Str);
|
|
else TMyString::sAddOnStr( "Wifi Brd", IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, HwTypeDescpTextLen);
|
|
TMyString::sAddOnStr(IList->StrPn, IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, PartNumTextLen);
|
|
TMyString::sAddOn2Dg(1, IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, CountTextLen);
|
|
TMyString::sAddOnStr(IList->StrVer, IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, VersionTextLen);
|
|
for(z=0; z<VersionTextLen; z++){
|
|
*(volatile unsigned char *)(StrList.Addr4Items + (StrList.ItemsCount * StrList.LineSize) +z) = IList->Str[z];
|
|
}
|
|
*(volatile unsigned char *)(StrList.Addr4Items + (StrList.ItemsCount * StrList.LineSize) +VersionTextLen) = '\0';
|
|
StrList.ItemsCount++;
|
|
}
|
|
|
|
//Can Network
|
|
CmpStartLine = StrList.ItemsCount;
|
|
if(IList->CommBoardOk == 3) {
|
|
IList->StrPn[16] = '\0';
|
|
for(z=0; z<16; z++){
|
|
IList->StrPn[z] = IList->PnVerCommBoard[z];
|
|
if(IList->StrPn[z] == 0)break;
|
|
}
|
|
PnLen = z;
|
|
VerLen = GetVerText(&IList->PnVerCommBoard[16], IList->StrVer);
|
|
|
|
*(volatile unsigned int *)(StrList.Addr4LinesType + (StrList.ItemsCount)*4) = btCommPort;
|
|
*(volatile unsigned int *)(StrList.Addr4ItemsCount + (StrList.ItemsCount)*4) = 1;
|
|
TMyString::sClear(IList->Str);
|
|
if(LanguageEnCn==0)TMyString::sAddOnStr( "联网接口卡", IList->Str);
|
|
else TMyString::sAddOnStr( "Network Brd", IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, HwTypeDescpTextLen);
|
|
TMyString::sAddOnStr(IList->StrPn, IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, PartNumTextLen);
|
|
TMyString::sAddOn2Dg(1, IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, CountTextLen);
|
|
TMyString::sAddOnStr(IList->StrVer, IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, VersionTextLen);
|
|
for(z=0; z<VersionTextLen; z++){
|
|
*(volatile unsigned char *)(StrList.Addr4Items + (StrList.ItemsCount * StrList.LineSize) +z) = IList->Str[z];
|
|
}
|
|
*(volatile unsigned char *)(StrList.Addr4Items + (StrList.ItemsCount * StrList.LineSize) +VersionTextLen) = '\0';
|
|
StrList.ItemsCount++;
|
|
}
|
|
|
|
//Printer
|
|
CmpStartLine = StrList.ItemsCount;
|
|
if(IList->PrinterOk == 3) {
|
|
IList->StrPn[16] = '\0';
|
|
for(z=0; z<16; z++){
|
|
IList->StrPn[z] = IList->PnVerPrinter[z];
|
|
if(IList->StrPn[z] == 0)break;
|
|
}
|
|
PnLen = z;
|
|
VerLen = GetVerText(&IList->PnVerPrinter[16], IList->StrVer);
|
|
|
|
*(volatile unsigned int *)(StrList.Addr4LinesType + (StrList.ItemsCount)*4) = btPrinter;
|
|
*(volatile unsigned int *)(StrList.Addr4ItemsCount + (StrList.ItemsCount)*4) = 1;
|
|
TMyString::sClear(IList->Str);
|
|
if(LanguageEnCn==0)TMyString::sAddOnStr( "打印机", IList->Str);
|
|
else TMyString::sAddOnStr( "Printer", IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, HwTypeDescpTextLen);
|
|
TMyString::sAddOnStr(IList->StrPn, IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, PartNumTextLen);
|
|
TMyString::sAddOn2Dg(1, IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, CountTextLen);
|
|
TMyString::sAddOnStr(IList->StrVer, IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, VersionTextLen);
|
|
for(z=0; z<VersionTextLen; z++){
|
|
*(volatile unsigned char *)(StrList.Addr4Items + (StrList.ItemsCount * StrList.LineSize) +z) = IList->Str[z];
|
|
}
|
|
*(volatile unsigned char *)(StrList.Addr4Items + (StrList.ItemsCount * StrList.LineSize) +VersionTextLen) = '\0';
|
|
StrList.ItemsCount++;
|
|
}
|
|
|
|
//Power suply
|
|
CmpStartLine = StrList.ItemsCount;
|
|
for(i=0; i<4; i++){
|
|
if(IList->PowerSpyOk[i] == 3) {
|
|
IList->StrPn[16] = '\0';
|
|
for(z=0; z<16; z++){
|
|
IList->StrPn[z] = IList->PnVerPowerSpy[i][z];
|
|
if(IList->StrPn[z] == 0)break;
|
|
}
|
|
PnLen = z;
|
|
VerLen = GetVerText(&IList->PnVerPowerSpy[i][16], IList->StrVer);
|
|
MatchLine = -1;
|
|
for(x=CmpStartLine; x<StrList.ItemsCount; x++){
|
|
IList->StrPnInRam[16] = '\0';
|
|
for(z=0; z<16; z++){
|
|
IList->StrPnInRam[z] = *(volatile unsigned char *)(StrList.Addr4Items + (x * StrList.LineSize + HwTypeDescpTextLen) + z);
|
|
if(IList->StrPnInRam[z] == 0)break;
|
|
if(IList->StrPnInRam[z] == ' ')break;
|
|
}
|
|
PnLenInRam = z;
|
|
IList->StrVerInRam[10] = '\0';
|
|
for(z=0; z<10; z++){
|
|
IList->StrVerInRam[z] = *(volatile unsigned char *)(StrList.Addr4Items + (x * StrList.LineSize + CountTextLen) + z);
|
|
if(IList->StrVerInRam[z] == 0)break;
|
|
if(IList->StrVerInRam[z] == ' ')break;
|
|
}
|
|
VerLenInRam = z;
|
|
|
|
|
|
if( (PnLen == PnLenInRam) && (VerLen == VerLenInRam) ){
|
|
IsEq =1;
|
|
for(z=0; z<PnLen; z++){
|
|
if(IList->StrPnInRam[z] != IList->StrPn[z]){
|
|
IsEq =0;
|
|
break;
|
|
}
|
|
}
|
|
if(IsEq){
|
|
for(z=0; z<VerLen; z++){
|
|
if(IList->StrVerInRam[z] != IList->StrVer[z]){
|
|
IsEq =0;
|
|
break;
|
|
}
|
|
}
|
|
|
|
}
|
|
}else{
|
|
IsEq =0;
|
|
}
|
|
if(IsEq){
|
|
MatchLine = x;
|
|
break;
|
|
}
|
|
}
|
|
if(MatchLine > -1){
|
|
z = *(volatile unsigned int *)(StrList.Addr4ItemsCount + MatchLine*4 ) +1;
|
|
*(volatile unsigned int *)(StrList.Addr4ItemsCount + MatchLine*4 ) = z;
|
|
*(volatile unsigned char *)(StrList.Addr4Items + (MatchLine * StrList.LineSize) +PartNumTextLen +0) = z/10%10 + '0';
|
|
*(volatile unsigned char *)(StrList.Addr4Items + (MatchLine * StrList.LineSize) +PartNumTextLen +1) = z%10 + '0';
|
|
}else{
|
|
*(volatile unsigned int *)(StrList.Addr4LinesType + (StrList.ItemsCount)*4) = btPowerSuply;
|
|
*(volatile unsigned int *)(StrList.Addr4ItemsCount + (StrList.ItemsCount)*4) = 1;
|
|
TMyString::sClear(IList->Str);
|
|
if(LanguageEnCn==0)TMyString::sAddOnStr( "电源", IList->Str);
|
|
else TMyString::sAddOnStr( "Power Supply", IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, HwTypeDescpTextLen);
|
|
TMyString::sAddOnStr(IList->StrPn, IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, PartNumTextLen);
|
|
TMyString::sAddOn2Dg(1, IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, CountTextLen);
|
|
TMyString::sAddOnStr(IList->StrVer, IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, VersionTextLen);
|
|
for(z=0; z<VersionTextLen; z++){
|
|
*(volatile unsigned char *)(StrList.Addr4Items + (StrList.ItemsCount * StrList.LineSize) +z) = IList->Str[z];
|
|
}
|
|
*(volatile unsigned char *)(StrList.Addr4Items + (StrList.ItemsCount * StrList.LineSize) +VersionTextLen) = '\0';
|
|
StrList.ItemsCount++;
|
|
}
|
|
}
|
|
}
|
|
|
|
//Key Pad
|
|
CmpStartLine = StrList.ItemsCount;
|
|
if(IList->KeyPadOk == 3) {
|
|
IList->StrPn[16] = '\0';
|
|
for(z=0; z<16; z++){
|
|
IList->StrPn[z] = IList->PnVerKeyPad[z];
|
|
if(IList->StrPn[z] == 0)break;
|
|
}
|
|
PnLen = z;
|
|
VerLen = GetVerText(&IList->PnVerKeyPad[16], IList->StrVer);
|
|
|
|
*(volatile unsigned int *)(StrList.Addr4LinesType + (StrList.ItemsCount)*4) = btKeyPad;
|
|
*(volatile unsigned int *)(StrList.Addr4ItemsCount + (StrList.ItemsCount)*4) = 1;
|
|
TMyString::sClear(IList->Str);
|
|
if(LanguageEnCn==0)TMyString::sAddOnStr( "按键板", IList->Str);
|
|
else TMyString::sAddOnStr( "User KeyBoard", IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, HwTypeDescpTextLen);
|
|
TMyString::sAddOnStr(IList->StrPn, IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, PartNumTextLen);
|
|
TMyString::sAddOn2Dg(1, IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, CountTextLen);
|
|
TMyString::sAddOnStr(IList->StrVer, IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, VersionTextLen);
|
|
for(z=0; z<VersionTextLen; z++){
|
|
*(volatile unsigned char *)(StrList.Addr4Items + (StrList.ItemsCount * StrList.LineSize) +z) = IList->Str[z];
|
|
}
|
|
*(volatile unsigned char *)(StrList.Addr4Items + (StrList.ItemsCount * StrList.LineSize) +VersionTextLen) = '\0';
|
|
StrList.ItemsCount++;
|
|
}
|
|
|
|
//Ex Mem Card
|
|
CmpStartLine = StrList.ItemsCount;
|
|
if(IList->ExtMemOk == 3) {
|
|
IList->StrPn[16] = '\0';
|
|
for(z=0; z<16; z++){
|
|
IList->StrPn[z] = IList->PnVerExtMem[z];
|
|
if(IList->StrPn[z] == 0)break;
|
|
}
|
|
PnLen = z;
|
|
VerLen = GetVerText(&IList->PnVerExtMem[16], IList->StrVer);
|
|
|
|
*(volatile unsigned int *)(StrList.Addr4LinesType + (StrList.ItemsCount)*4) = btExMem;
|
|
*(volatile unsigned int *)(StrList.Addr4ItemsCount + (StrList.ItemsCount)*4) = 1;
|
|
TMyString::sClear(IList->Str);
|
|
if(LanguageEnCn==0)TMyString::sAddOnStr( "存储单元", IList->Str);
|
|
else TMyString::sAddOnStr( "Memory Unit", IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, HwTypeDescpTextLen);
|
|
TMyString::sAddOnStr(IList->StrPn, IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, PartNumTextLen);
|
|
TMyString::sAddOn2Dg(1, IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, CountTextLen);
|
|
TMyString::sAddOnStr(IList->StrVer, IList->Str);
|
|
TMyString::sFillFixLen(IList->Str, VersionTextLen);
|
|
for(z=0; z<VersionTextLen; z++){
|
|
*(volatile unsigned char *)(StrList.Addr4Items + (StrList.ItemsCount * StrList.LineSize) +z) = IList->Str[z];
|
|
}
|
|
*(volatile unsigned char *)(StrList.Addr4Items + (StrList.ItemsCount * StrList.LineSize) +VersionTextLen) = '\0';
|
|
StrList.ItemsCount++;
|
|
}
|
|
}
|
|
|
|
void THwInf::Task1000Ms()
|
|
{
|
|
if(IsShow == 0)return;
|
|
if(Update){
|
|
Analy();
|
|
DrawText();
|
|
Update =0;
|
|
}
|
|
}
|
|
|