Esempio n. 1
0
BOOL APIENTRY
AnaSeismicProc(HWND hDlg, UINT messageID, WPARAM wParam, LPARAM lParam)
{
   switch(messageID)
   {
      case WM_INITDIALOG:
      {
         PROPSHEETPAGE * psp = (PROPSHEETPAGE *)lParam;
         //assert((Analysisdata *)psp->lParam == adglobalfortest);
      }  break;


      case WM_NOTIFY:
         handleNotify(hDlg, lParam);
         break;

      case WM_COMMAND:
      {
         int idEditCtrl = (int) LOWORD(wParam); // identifier of edit control 
         int wNotifyCode = HIWORD(wParam);      // notification code 

         switch (idEditCtrl)
         {
            case IDC_LOADRESIDUAL:
               if (wNotifyCode == EN_KILLFOCUS)
               {
                  MessageBox(hDlg,"Residual edited",NULL,MB_OK);
               }
               break;
         }
      } break;
   }

return 0;
}  /* close AnaSeismicProc() */
Esempio n. 2
0
INT_PTR OptionsPageMore::handleMessage(UINT message, WPARAM wParam, LPARAM lParam)
{
	if (message == WM_INITDIALOG)
	{
		onInitDialog();
		return TRUE;
	}
	else if (message == WM_NOTIFY)
	{
		return handleNotify((NMHDR*)lParam);
	}
	else if (message == WM_COMMAND)
	{
		return handleCommand(HIWORD(wParam), LOWORD(wParam), (HWND)lParam);
	}
	else {
		return FALSE;
	}
}
Esempio n. 3
0
	void Client::socketNewMsgCallback(unsigned char data[], int len)
	{
		int numRead = len;
		int numDecoded = 0;
        char *bufferToDecode;
        if (isWaitingForData)
        {
            int readLen = len;
            len = readLen + incompleteDataBufferSize;
            
            bufferToDecode = new char[len];
            
            for(int i=0; i<incompleteDataBufferSize;++i)
            {
                bufferToDecode[i] = incompleteDataBuffer[i];
            }
            for(int i=incompleteDataBufferSize; i<len;++i)
            {
                bufferToDecode[i] = data[i-incompleteDataBufferSize];
            }
            isWaitingForData = false;
            incompleteDataBufferSize = 0;
            delete incompleteDataBuffer;
            incompleteDataBuffer = NULL;
            numRead =len;
        }
        else
        {
            bufferToDecode = new char[len];
            for(int i=0; i<len;++i)
                bufferToDecode[i] = data[i];
        }
        
		while(numDecoded < numRead)
		{
            bool canDecodeData = canDecode(bufferToDecode,numDecoded,numRead);
            if (canDecodeData)
            {
                if(bufferToDecode[numDecoded] == MessageType::response)
                    numDecoded += handleResponse(bufferToDecode, numDecoded);
                else
                    numDecoded += handleNotify(bufferToDecode, numDecoded);
            }
            else
            {
                incompleteDataBufferSize = numRead-numDecoded;
                if(incompleteDataBuffer != NULL)
                {
                    delete incompleteDataBuffer;
                    incompleteDataBuffer = NULL;
                }
                incompleteDataBuffer = new char[incompleteDataBufferSize];
                
                for(int i=numDecoded; i<numRead; ++i)
                {
                    incompleteDataBuffer[i-numDecoded] = bufferToDecode[i];
                }
                
                isWaitingForData = true;
                
                break;
            }
            
		}
        delete[] bufferToDecode;
	}
Esempio n. 4
0
//-----------------------------------------------------------------------------
MBOOL 
CapBufNodeImp::
threadLoopUpdate()
{
    FUNC_START;
    handleNotify( PASS1_SOF, 0, 0 );
    //
    MUINT32 imgoAddr = 0;
    //
    if(isDataConnected(PASS1_FULLRAW))
    {
        if(mpCapBufMgr != NULL)
        {
            IImageBuffer* pImageBuffer = NULL;
            if(mpCapBufMgr->dequeBuf(pImageBuffer))
            {
                if(pImageBuffer != NULL)
                {
                    imgoAddr = (MUINT32)pImageBuffer;
                    //
                    {
                        Mutex::Autolock _l(mLock);
                        mlpDequeFullBuf.push_back(pImageBuffer);
                    }
                }
                else
                {
                    MY_LOGE("Deque NULL buffer");
                }
            }
            else
            {
                MY_LOGE("Deque fail");
            }
        }
        else
        if(mpImageBuffer != NULL)
        {
            imgoAddr = (MUINT32)mpImageBuffer;
            //
            {
                Mutex::Autolock _l(mLock);
                mlpDequeFullBuf.push_back(mpImageBuffer);
            }
        }
        else
        {
            MY_LOGE("mpCapBufMgr is NULL");
        }
    }
    else
    {
        MY_LOGE("Please connect PASS1_FULLRAW");
        usleep(10*1000);
    }
    //
    if(imgoAddr)
    {
        MUINT32 magicNum;
        MBOOL isRrzo;
        MVOID* pPrivateData;
        MUINT32 privateDataSize;
        //
        mpIspSyncCtrl->queryImgBufInfo(
                            (IImageBuffer*)imgoAddr,
                            magicNum,
                            isRrzo,
                            pPrivateData,
                            privateDataSize);
        //
        MY_LOGD("imgoAddr(0x%08X),MN(0x%08X)",
                imgoAddr,
                magicNum);
        //
        handleNotify(PASS1_EOF, -1, magicNum);
        handlePostBuffer(PASS1_FULLRAW, imgoAddr, 0);
    }
    else
    {
        MY_LOGE("imgoAddr is 0");
    }
    FUNC_END;
    return MTRUE;
}
Esempio n. 5
0
BOOL APIENTRY
AFlagsProc(HWND hDlg, UINT messageID, WPARAM wParam, LPARAM lParam)
{
   static Analysisdata * ad;
   //HWND hpage;

   switch(messageID)
   {
      case WM_INITDIALOG:
      {
         PROPSHEETPAGE * psp = (PROPSHEETPAGE *)lParam;
         ad = (Analysisdata *)psp->lParam;
         if (ad->gravityflag == 0)
            ;
         
         //hpage = psp->phpage[7];

         //MessageBox(hDlg,"Flags up",NULL,MB_OK);
         //return TRUE;
         //assert((Analysisdata *)psp->lParam == adglobalfortest);
      }  break;

      case WM_NOTIFY:
         handleNotify(hDlg, lParam);
         break;


      case WM_COMMAND:
      {
         int idEditCtrl = (int) LOWORD(wParam); // identifier of edit control 
         int wNotifyCode = HIWORD(wParam);      // notification code
         HWND hcontrol = (HWND)lParam;

         switch (idEditCtrl)
         {
            case AD_GRAVITY:
               if (SendMessage(hcontrol,BM_GETCHECK,0,0) == BST_CHECKED)
               {
                  //ad->gravityflag = 1;
                  MessageBox(hDlg,"Gravity checked",NULL,MB_OK);
               }
               else 
               {
                  //ad->gravityflag = 0;
                  MessageBox(hDlg,"Gravity unchecked",NULL,MB_OK);
               }
               break;

            case AD_ROTATION:
               if (SendMessage(hcontrol,BM_GETCHECK,0,0) == BST_CHECKED)
               {
                  //ad->rotationflag = 1;
                  MessageBox(hDlg,"Rotation checked",NULL,MB_OK);
               }
               else 
               {
                  //ad->rotationflag = 0;
                  MessageBox(hDlg,"Rotation unchecked",NULL,MB_OK);
               }
               break;

			case AD_PIPEFLOW:
               if (SendMessage(hcontrol,BM_GETCHECK,0,0) == BST_CHECKED)
               {
                  //ad->pipeflowflag = 1;
                  MessageBox(hDlg,"Pipeflow checked",NULL,MB_OK);
               }
               else 
               {
                  //ad->pipeflowflag = 0;
                  MessageBox(hDlg,"Pipeflow unchecked",NULL,MB_OK);
               }
            break;

            case AD_PSTRESS:
               //ad->planestrain = 0;
               MessageBox(hDlg,"Plane stress",NULL,MB_OK);
               break;

            case AD_PSTRAIN:
               //ad->planestrainflag = 1;
               MessageBox(hDlg,"Plane Strain",NULL,MB_OK);
               break;

            case AD_DYNAMIC:
               //ad->planestrain = 0;
               MessageBox(hDlg,"Dynamic analysis",NULL,MB_OK);
               break;

            case AD_STATIC:
               //ad->planestrainflag = 1;
               //MessageBox(hDlg,"Static analysis",NULL,MB_OK);
               return TRUE; //break;

            default:
               break;

         }
      } break;
   }

return 0;
}  /* close AFlagsProc() */