Changeset 408


Ignore:
Timestamp:
04/30/2010 01:39:11 PM (11 years ago)
Author:
KDucasse
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • UH/SAMGAR/SAMGAR LIB/Trunk/SourceFiles/SAMGARMAIN.cpp

    r289 r408  
    341341 
    342342/*! Gets int data from port, you give it the int you want changed and it changes it, it also replys with weather the port has been updated True/False !*/ 
    343 bool SamgarModule::GetIntData   (string NameOfPort,int    *I){return GetDataFromPort(NameOfPort,TypeInt     ,I,0,0,0,0);} 
     343bool SamgarModule::GetIntData   (string NameOfPort,int    *I, int mode){return GetDataFromPort(NameOfPort,TypeInt     ,I,0,0,0,0,mode);} 
    344344/*! Gets float data from port, you give it the int you want changed and it changes it, it also replys with weather the port has been updated True/False !*/ 
    345 bool SamgarModule::GetFloatData (string NameOfPort,float  *I){return GetDataFromPort(NameOfPort,TypeFloat   ,0,I,0,0,0);} 
     345bool SamgarModule::GetFloatData (string NameOfPort,float  *I, int mode){return GetDataFromPort(NameOfPort,TypeFloat   ,0,I,0,0,0,mode);} 
    346346/*! Gets double data from port, you give it the int you want changed and it changes it, it also replys with weather the port has been updated True/False !*/ 
    347 bool SamgarModule::GetDoubleData(string NameOfPort,double *I){return GetDataFromPort(NameOfPort,TypeDouble  ,0,0,I,0,0);} 
     347bool SamgarModule::GetDoubleData(string NameOfPort,double *I, int mode){return GetDataFromPort(NameOfPort,TypeDouble  ,0,0,I,0,0,mode);} 
    348348/*! Gets string data from port, you give it the int you want changed and it changes it, it also replys with weather the port has been updated True/False !*/ 
    349 bool SamgarModule::GetStringData(string NameOfPort,string *I){return GetDataFromPort(NameOfPort,TypeString  ,0,0,0,I,0);} 
     349bool SamgarModule::GetStringData(string NameOfPort,string *I, int mode){return GetDataFromPort(NameOfPort,TypeString  ,0,0,0,I,0,mode);} 
    350350/*! Gets Bottle data from port, you give it the int you want changed and it changes it, it also replys with weather the port has been updated True/False !*/ 
    351 bool SamgarModule::GetBottleData(string NameOfPort,Bottle *I){return GetDataFromPort(NameOfPort,TypeBottle  ,0,0,0,0,I);} 
     351bool SamgarModule::GetBottleData(string NameOfPort,Bottle *I, int mode){return GetDataFromPort(NameOfPort,TypeBottle  ,0,0,0,0,I,mode);} 
    352352 
    353353 
    354354/*! DO NOT CALL DIRECTLY !*/ 
    355 bool SamgarModule::GetDataFromPort(string NameOfPort,int TypeOfData, int *I ,float *F ,double *D, string *S ,Bottle *B) 
     355bool SamgarModule::GetDataFromPort(string NameOfPort,int TypeOfData, int *I ,float *F ,double *D, string *S ,Bottle *B, int mode) 
    356356{ 
    357357 
    358358//BufferedPort<Bottle> *MyTempPort; 
     359static int oo=0; 
    359360 
    360361DataPort *MyTempPort; 
     
    379380 
    380381//Bottle *MyBottle = MyTempPort->read(); 
    381 if(MyTempPort->istherebottle==1) 
    382 { 
    383  MyBottle = MyTempPort->SavedBottle; 
    384 MyTempPort->istherebottle=0; 
     382if(MyTempPort->istherebottle==1 && MyTempPort->InRead==false) 
     383{ 
     384//puts("getting bottle data"); 
     385 
     386        if(mode == SamgarModule::NoStep) 
     387        { 
     388        if         (MyTempPort->bottlenum==1){MyBottle = MyTempPort->SavedBottle0;} 
     389        else if(MyTempPort->bottlenum==2){MyBottle = MyTempPort->SavedBottle1;} 
     390        else if(MyTempPort->bottlenum==0){MyBottle = MyTempPort->SavedBottle2;} 
     391        } 
     392        else // therefore this is step 
     393        { 
     394        if         (MyTempPort->bottlenum==0){MyBottle = MyTempPort->SavedBottle0;} 
     395        else if(MyTempPort->bottlenum==1){MyBottle = MyTempPort->SavedBottle1;} 
     396        else if(MyTempPort->bottlenum==2){MyBottle = MyTempPort->SavedBottle2;} 
     397        } 
     398        //puts("finnished getting bottle data"); 
     399    MyTempPort->istherebottle=0; 
    385400} 
    386401else 
Note: See TracChangeset for help on using the changeset viewer.