|
@@ -7,16 +7,25 @@
|
|
|
|
|
|
sterraes::sterraes(std::string strdbcname) {
|
|
|
|
|
|
- mpPacker = new CANPacker(strdbcname);
|
|
|
- initsig();
|
|
|
+ mpdbcsigpacker = new dbcsigpacker(strdbcname);
|
|
|
+ // mpPacker = new CANPacker(strdbcname);
|
|
|
+ // initsig();
|
|
|
}
|
|
|
|
|
|
sterraes::sterraes(std::string strdbcname,std::istringstream & strsteam)
|
|
|
{
|
|
|
- mpPacker = new CANPacker(strdbcname,strsteam);
|
|
|
- initsig();
|
|
|
+ mpdbcsigpacker = new dbcsigpacker(strdbcname,strsteam);
|
|
|
+
|
|
|
+ // mpPacker = new CANPacker(strdbcname,strsteam);=
|
|
|
+ // initsig();
|
|
|
}
|
|
|
|
|
|
+void sterraes::SetMsgSignal(std::string strmsgname,std::string strsigname,const double fvalue){
|
|
|
+
|
|
|
+ mpdbcsigpacker->SetMsgSignal(strmsgname,strsigname,fvalue);
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
void sterraes::initsig()
|
|
|
{
|
|
|
SignalPackValue sv;
|
|
@@ -205,7 +214,14 @@ void sterraes::fillcrc(unsigned short dataid,unsigned char * pdata){
|
|
|
}
|
|
|
|
|
|
void sterraes::GetEPS1Data(unsigned char * pdata){
|
|
|
- std::vector<uint8_t> xpack = mpPacker->pack(0x195,mvectorADSEPS1);
|
|
|
+ // std::vector<uint8_t> xpack = mpPacker->pack(0x195,mvectorADSEPS1);
|
|
|
+
|
|
|
+ std::vector<uint8_t> xpack = mpdbcsigpacker->GetPack("ADS_EPS_1");
|
|
|
+
|
|
|
+ if(xpack.size()<24){
|
|
|
+ std::cout<<"GetEPS1Data Fail. pack size: "<<xpack.size()<<std::endl;
|
|
|
+ return;
|
|
|
+ }
|
|
|
int i;
|
|
|
for(i=0;i<24;i++)pdata[i] = xpack[i];
|
|
|
|
|
@@ -214,16 +230,33 @@ void sterraes::GetEPS1Data(unsigned char * pdata){
|
|
|
}
|
|
|
|
|
|
void sterraes::GetEPS3Data(unsigned char * pdata){
|
|
|
- std::vector<uint8_t> xpack = mpPacker->pack(0x1BC,mvectorADSEPS3);
|
|
|
+ // std::vector<uint8_t> xpack = mpPacker->pack(0x1BC,mvectorADSEPS3);
|
|
|
+ std::vector<uint8_t> xpack = mpdbcsigpacker->GetPack("ADS_EPS_3");
|
|
|
+
|
|
|
+ if(xpack.size()<24){
|
|
|
+ std::cout<<"GetEPS3Data Fail. pack size: "<<xpack.size()<<std::endl;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
int i;
|
|
|
for(i=0;i<24;i++)pdata[i] = xpack[i];
|
|
|
|
|
|
+
|
|
|
fillcrc(0x0006,pdata);
|
|
|
fillcrc(0x0007,pdata+8);
|
|
|
}
|
|
|
|
|
|
void sterraes::GetONEBOX1Data(unsigned char * pdata){
|
|
|
- std::vector<uint8_t> xpack = mpPacker->pack(0x159,mvectorADSONEBOX1);
|
|
|
+// std::vector<uint8_t> xpack = mpPacker->pack(0x159,mvectorADSONEBOX1);
|
|
|
+
|
|
|
+ std::vector<uint8_t> xpack = mpdbcsigpacker->GetPack("ADS_ONEBOX_1");
|
|
|
+
|
|
|
+ if(xpack.size()<24){
|
|
|
+ std::cout<<"GetONEBOX1Data Fail. pack size: "<<xpack.size()<<std::endl;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
int i;
|
|
|
for(i=0;i<24;i++)pdata[i] = xpack[i];
|
|
|
|
|
@@ -231,7 +264,15 @@ void sterraes::GetONEBOX1Data(unsigned char * pdata){
|
|
|
}
|
|
|
|
|
|
void sterraes::GetVCU1Data(unsigned char * pdata){
|
|
|
- std::vector<uint8_t> xpack = mpPacker->pack(0x167,mvectorADSVCU1);
|
|
|
+// std::vector<uint8_t> xpack = mpPacker->pack(0x167,mvectorADSVCU1);
|
|
|
+
|
|
|
+ std::vector<uint8_t> xpack = mpdbcsigpacker->GetPack("ADS_VCU_1");
|
|
|
+
|
|
|
+ if(xpack.size()<24){
|
|
|
+ std::cout<<"GetVCU1Data Fail. pack size: "<<xpack.size()<<std::endl;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
int i;
|
|
|
for(i=0;i<24;i++)pdata[i] = xpack[i];
|
|
|
|
|
@@ -240,7 +281,16 @@ void sterraes::GetVCU1Data(unsigned char * pdata){
|
|
|
}
|
|
|
|
|
|
void sterraes::GetONEBOX2Data(unsigned char * pdata){
|
|
|
- std::vector<uint8_t> xpack = mpPacker->pack(0x145,mvectorADSONEBOX2);
|
|
|
+// std::vector<uint8_t> xpack = mpPacker->pack(0x145,mvectorADSONEBOX2);
|
|
|
+
|
|
|
+ std::vector<uint8_t> xpack = mpdbcsigpacker->GetPack("ADS_ONEBOX_2");
|
|
|
+
|
|
|
+ if(xpack.size()<24){
|
|
|
+ std::cout<<"GetONEBOX2Data Fail. pack size: "<<xpack.size()<<std::endl;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
int i;
|
|
|
for(i=0;i<24;i++)pdata[i] = xpack[i];
|
|
|
|
|
@@ -248,7 +298,14 @@ void sterraes::GetONEBOX2Data(unsigned char * pdata){
|
|
|
}
|
|
|
|
|
|
void sterraes::GetONEBOX3Data(unsigned char * pdata){
|
|
|
- std::vector<uint8_t> xpack = mpPacker->pack(0x14A,mvectorADSONEBOX3);
|
|
|
+// std::vector<uint8_t> xpack = mpPacker->pack(0x14A,mvectorADSONEBOX3);
|
|
|
+ std::vector<uint8_t> xpack = mpdbcsigpacker->GetPack("ADS_ONEBOX_3");
|
|
|
+
|
|
|
+ if(xpack.size()<24){
|
|
|
+ std::cout<<"GetONEBOX3Data Fail. pack size: "<<xpack.size()<<std::endl;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
int i;
|
|
|
for(i=0;i<24;i++)pdata[i] = xpack[i];
|
|
|
|
|
@@ -256,7 +313,16 @@ void sterraes::GetONEBOX3Data(unsigned char * pdata){
|
|
|
}
|
|
|
|
|
|
void sterraes::GetADSCOM3Data(unsigned char * pdata){
|
|
|
- std::vector<uint8_t> xpack = mpPacker->pack(0x31A,mvectorADSCOM3);
|
|
|
+// std::vector<uint8_t> xpack = mpPacker->pack(0x31A,mvectorADSCOM3);
|
|
|
+
|
|
|
+ std::vector<uint8_t> xpack = mpdbcsigpacker->GetPack("ADS_COM_2");
|
|
|
+
|
|
|
+ if(xpack.size()<24){
|
|
|
+ std::cout<<"GetADSCOM3Data Fail. pack size: "<<xpack.size()<<std::endl;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
int i;
|
|
|
for(i=0;i<24;i++)pdata[i] = xpack[i];
|
|
|
|
|
@@ -264,13 +330,17 @@ void sterraes::GetADSCOM3Data(unsigned char * pdata){
|
|
|
}
|
|
|
|
|
|
void sterraes::GetADSCOM2Data(unsigned char * pdata){
|
|
|
- std::vector<uint8_t> xpack = mpPacker->pack(0x314,mvectorADSCOM2);
|
|
|
+// std::vector<uint8_t> xpack = mpPacker->pack(0x314,mvectorADSCOM2);
|
|
|
+ std::vector<uint8_t> xpack = mpdbcsigpacker->GetPack("ADS_COM_3");
|
|
|
+
|
|
|
+ if(xpack.size()<8){
|
|
|
+ std::cout<<"GetADSCOM2Data Fail. pack size: "<<xpack.size()<<std::endl;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
int i;
|
|
|
for(i=0;i<8;i++)pdata[i] = xpack[i];
|
|
|
|
|
|
fillcrc(0x0010,pdata);
|
|
|
}
|
|
|
|
|
|
-void SetMsgSignal(std::string & strmsgname,std::string & strsigname,const double fvalue){
|
|
|
-
|
|
|
-}
|