[GME-commit] GMESRC/GME/Gme GMEView.cpp,1.126,1.127

gme-commit at list.isis.vanderbilt.edu gme-commit at list.isis.vanderbilt.edu
Mon Mar 8 14:47:11 CST 2004


Update of /var/lib/gme/GMESRC/GME/Gme
In directory braindrain:/tmp/cvs-serv20282

Modified Files:
	GMEView.cpp 
Log Message:
more Event logging stuff, mostly logging the AfxMessageBoxes that report user errors to the user.

CVS User: brianw

Index: GMEView.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/Gme/GMEView.cpp,v
retrieving revision 1.126
retrieving revision 1.127
diff -C2 -d -r1.126 -r1.127
*** GMEView.cpp	5 Mar 2004 22:04:16 -0000	1.126
--- GMEView.cpp	8 Mar 2004 20:47:09 -0000	1.127
***************
*** 738,741 ****
--- 738,742 ----
  		AbortTransaction(e.hr);
  		AfxMessageBox("Unable to open model",MB_OK | MB_ICONSTOP);
+ 		CGMEEventLogger::LogGMEEvent("CGMEView::OnInitialUpdate - Unable to open model.\r\n");
  		frame->PostMessage(WM_CLOSE);
  		EndWaitCursor();
***************
*** 1454,1457 ****
--- 1455,1459 ----
  		AbortTransaction(e.hr);
  		AfxMessageBox("Unable to refresh model");
+ 		CGMEEventLogger::LogGMEEvent("CGMEView::Reset - Unable to refresh model.\r\n");
  		frame->PostMessage(WM_CLOSE);
  		EndWaitCursor();
***************
*** 1669,1672 ****
--- 1671,1675 ----
  		AbortTransaction(e.hr);
  		AfxMessageBox("Unable to access context-specific help information!",MB_OK | MB_ICONSTOP);
+ 		CGMEEventLogger::LogGMEEvent("CGMEView::ShowHelp - Unable to access context-specific help information.\r\n");
  	}
  }
***************
*** 1699,1702 ****
--- 1702,1706 ----
  	try {
  		BeginTransaction(TRANSACTION_READ_ONLY);
+ 		CGMEEventLogger::GMEEventPrintf("CGMEView::FindDerivedFrom(model=%Z,type=%z)\r\n",model,type);
  		COMTHROW(model->get_DerivedFrom(&der));
  		if(der != 0)
***************
*** 1707,1710 ****
--- 1711,1715 ----
  		AbortTransaction(e.hr);
  		AfxMessageBox("Unable to find type model",MB_ICONSTOP | MB_OK);
+ 		CGMEEventLogger::LogGMEEvent("    Unable to find type model\r\n");
  	}
  }
***************
*** 2087,2090 ****
--- 2092,2096 ----
  				AbortTransaction(e.hr);
  				AfxMessageBox("Unable to delete connection",MB_ICONSTOP | MB_OK);
+ 				CGMEEventLogger::LogGMEEvent("    Unable to delete connection.\r\n");
  			}
  		}
***************
*** 2134,2137 ****
--- 2140,2144 ----
  		AbortTransaction(e.hr);
  		AfxMessageBox("Unable to delete connection",MB_ICONSTOP | MB_OK);
+ 		CGMEEventLogger::LogGMEEvent("    Unable to delete connection.\r\n");
  	}
  	return ok;
***************
*** 2166,2169 ****
--- 2173,2177 ----
  		if(!CheckBeforeDeleteObjects(objectList,msg)) {
  			AfxMessageBox("The following object(s) cannot be deleted: " + msg);
+ 			CGMEEventLogger::LogGMEEvent("    The following object(s) cannot be deleted: "+msg+"\r\n");
  			return;
  		}
***************
*** 2210,2213 ****
--- 2218,2222 ----
  		AbortTransaction(e.hr);
  		AfxMessageBox("Unable to delete models",MB_ICONSTOP | MB_OK);
+ 		CGMEEventLogger::LogGMEEvent("    Unable to delete models.\r\n");
  		EndWaitCursor();
  		return;
***************
*** 2234,2237 ****
--- 2243,2247 ----
  		AbortTransaction(e.hr);
  		AfxMessageBox("Unable to delete annotations",MB_ICONSTOP | MB_OK);
+ 		CGMEEventLogger::LogGMEEvent("    Unable to delete annotations.\r\n");
  		EndWaitCursor();
  		return;
***************
*** 2244,2247 ****
--- 2254,2269 ----
  bool CGMEView::DoPasteItem(COleDataObject* pDataObject,bool drag,bool move,bool reference,bool derive,bool instance,CGuiObject *ref,CPoint pt)
  {
+ 	CGMEEventLogger::LogGMEEvent("CGMEView::DoPasteItem");
+ 	if(drag)
+ 		CGMEEventLogger::LogGMEEvent(" DRAG");
+ 	if(move)
+ 		CGMEEventLogger::LogGMEEvent(" MOVE");
+ 	if(reference)
+ 		CGMEEventLogger::LogGMEEvent(" REFERENCE");
+ 	if(derive)
+ 		CGMEEventLogger::LogGMEEvent(" DERIVE");
+ 	if(instance)
+ 		CGMEEventLogger::LogGMEEvent(" INSTANCE");
+ 	CGMEEventLogger::LogGMEEvent(" in "+path+name+"\r\n");
  	if(ref)
  		VERIFY(reference);
***************
*** 2277,2280 ****
--- 2299,2314 ----
  bool CGMEView::DoPasteNative(COleDataObject *pDataObject,bool drag,bool move,bool reference,bool derive,bool instance,CGuiObject *ref,CPoint point)
  {
+ 	CGMEEventLogger::LogGMEEvent("CGMEView::DoPasteNative");
+ 	if(drag)
+ 		CGMEEventLogger::LogGMEEvent(" DRAG");
+ 	if(move)
+ 		CGMEEventLogger::LogGMEEvent(" MOVE");
+ 	if(reference)
+ 		CGMEEventLogger::LogGMEEvent(" REFERENCE");
+ 	if(derive)
+ 		CGMEEventLogger::LogGMEEvent(" DERIVE");
+ 	if(instance)
+ 		CGMEEventLogger::LogGMEEvent(" INSTANCE");
+ 	CGMEEventLogger::LogGMEEvent(" in "+path+name+"\r\n");
  	CComPtr<IDataObject> p = pDataObject->GetIDataObject(FALSE);
  	CComPtr<IMgaDataSource> pt;
***************
*** 2389,2393 ****
--- 2423,2430 ----
  						COMTHROW(doc->resolver->get_RoleByMeta(currentModel,kind,OBJTYPE_NULL,role,aspect,&newRole));
  						if(newRole == 0)
+ 						{
  							AfxMessageBox("Cannot insert object derived from " + fcoName);
+ 							CGMEEventLogger::LogGMEEvent("    Cannot insert object derived from "+fcoName+"\r\n");
+ 						}
  						else {
  							CComPtr<IMgaFCO> obj;
***************
*** 2397,2400 ****
--- 2434,2438 ----
  							if((hr = currentModel->DeriveChildObject(fco,newRole,inst,&obj)) != S_OK) {
  								AfxMessageBox(fcoName + " cannot be derived!");
+ 								CGMEEventLogger::LogGMEEvent("    "+fcoName+" cannot be derived.\r\n");
  								normalExit = false;
  								break;
***************
*** 2419,2422 ****
--- 2457,2461 ----
  				else if(reference) {
  					if(ref) {
+ 						CGMEEventLogger::LogGMEEvent("    ref="+ref->GetName()+" "+ref->GetID()+"\r\n");
  						CComPtr<IMgaReference> mgaRef;
  						COMTHROW(ref->mgaFco.QueryInterface(&mgaRef));
***************
*** 2429,2432 ****
--- 2468,2472 ----
  						if(count < 1) {
  							AfxMessageBox("Cannot redirect reference to specified object!");
+ 							CGMEEventLogger::LogGMEEvent("    Cannot redirect reference to specified object.\r\n");
  							throw hresult_exception(E_FAIL);
  						}
***************
*** 2446,2449 ****
--- 2486,2490 ----
  								AbortTransaction(e.hr);
  								AfxMessageBox("Cannot redirect reference to specified object!");
+ 								CGMEEventLogger::LogGMEEvent("    Cannot redirect reference to specified object.\r\n");
  								return false;
  							}
***************
*** 2467,2471 ****
--- 2508,2515 ----
  								COMTHROW(doc->resolver->get_RefRoleByMeta(currentModel,aspect,fco,&role));
  								if(role == 0)
+ 								{
  									AfxMessageBox("Cannot create reference");
+ 									CGMEEventLogger::LogGMEEvent("    Cannot create reference.\r\n");
+ 								}
  								else {
  									CComPtr<IMgaFCO> ref;
***************
*** 2622,2625 ****
--- 2666,2670 ----
  				CommitTransaction();
  				AfxMessageBox("Paradigm violation: cannot insert new part!");
+ 				CGMEEventLogger::LogGMEEvent("    Paradigm violation: cannot insert new part.\r\n");
  				return false;
  			}
***************
*** 2628,2631 ****
--- 2673,2677 ----
  			AbortTransaction(e.hr);
  			AfxMessageBox("Unable to insert objects",MB_ICONSTOP | MB_OK);
+ 			CGMEEventLogger::LogGMEEvent("    Unable to insert objects.\r\n");
  			newObjectIDs.RemoveAll();
  			return false;
***************
*** 2898,2906 ****
  		else {
  			CommitTransaction();
- 			AfxMessageBox("Paradigm violation: cannot connect selected objects!",MB_ICONSTOP | MB_OK);
  			CGMEEventLogger::LogGMEEvent("    Paradigm violation: cannot connect selected objects!\r\n");
  		}
  	}
  	catch(hresult_exception &e) {
  		AbortTransaction(e.hr);
  //		AfxMessageBox("Unable to connect specified parts!",MB_ICONSTOP | MB_OK);
--- 2944,2953 ----
  		else {
  			CommitTransaction();
  			CGMEEventLogger::LogGMEEvent("    Paradigm violation: cannot connect selected objects!\r\n");
+ 			AfxMessageBox("Paradigm violation: cannot connect selected objects!",MB_ICONSTOP | MB_OK);
  		}
  	}
  	catch(hresult_exception &e) {
+ 		CGMEEventLogger::LogGMEEvent("    Cannot Connect, hresult_exception in CGMEView::Connect\r\n");
  		AbortTransaction(e.hr);
  //		AfxMessageBox("Unable to connect specified parts!",MB_ICONSTOP | MB_OK);
***************
*** 2926,2929 ****
--- 2973,2977 ----
  		if(!currentAspect->GetRoleByName(roleName,role,true)) {
  			AfxMessageBox("Internal Program Error in CGMEView::InsertNewPart");
+ 			CGMEEventLogger::LogGMEEvent("    Internaml Program Error in CGMEView::InsertNewPart.\r\n");
  			return;
  		}
***************
*** 2946,2949 ****
--- 2994,2998 ----
  		newObjectIDs.RemoveAll();
  		AfxMessageBox("Unable to insert new part",MB_ICONSTOP | MB_OK);
+ 		CGMEEventLogger::LogGMEEvent("    Unable to insert new part.\r\n");
  		return;
  	}
***************
*** 2958,2961 ****
--- 3007,3011 ----
  		AbortTransaction(e.hr);
  		AfxMessageBox("Unable to update parent",MB_ICONSTOP | MB_OK);
+ 		CGMEEventLogger::LogGMEEvent("    Unable to update parent.\r\n");
  	}
  	Invalidate(true);
***************
*** 2997,3001 ****
  	VERIFY(am);
  	ChangeAspect(am->name);
- 	CGMEEventLogger::LogGMEEvent("CGMEView::ChangeAspect("+am->name+") in "+path+name+"\r\n");
  }
  
--- 3047,3050 ----
***************
*** 3536,3540 ****
--- 3585,3592 ----
  					}
  					else
+ 					{
  						AfxMessageBox("Unable to show referred object of null reference!");
+ 						CGMEEventLogger::LogGMEEvent("    Unable to show referred object of null reference.\r\n");
+ 					}
  				}
  			}
***************
*** 3981,3984 ****
--- 4033,4037 ----
  		AbortTransaction(e.hr);
  		AfxMessageBox("Unable to nudge objects",MB_ICONSTOP | MB_OK);
+ 		CGMEEventLogger::LogGMEEvent("    Unable to nudge objects.\r\n");
  		return;
  	}
***************
*** 4006,4009 ****
--- 4059,4063 ----
  		AbortTransaction(e.hr);
  		AfxMessageBox("Unable to nudge objects",MB_ICONSTOP | MB_OK);
+ 		CGMEEventLogger::LogGMEEvent("    Unable to nudge objects.\r\n");
  		return;
  	}
***************
*** 4031,4034 ****
--- 4085,4089 ----
  		AbortTransaction(e.hr);
  		AfxMessageBox("Unable to nudge objects",MB_ICONSTOP | MB_OK);
+ 		CGMEEventLogger::LogGMEEvent("    Unable to nudge objects.\r\n");
  		return;
  	}
***************
*** 4056,4059 ****
--- 4111,4115 ----
  		AbortTransaction(e.hr);
  		AfxMessageBox("Unable to nudge objects",MB_ICONSTOP | MB_OK);
+ 		CGMEEventLogger::LogGMEEvent("    Unable to nudge objects.\r\n");
  		return;
  	}
***************
*** 4187,4190 ****
--- 4243,4247 ----
  				AbortTransaction(e.hr);
  				AfxMessageBox("Could not complete disconnect operation",MB_OK | MB_ICONSTOP);
+ 				CGMEEventLogger::LogGMEEvent("    Could not complete disconnect operation.\r\n");
  			}
  		}
***************
*** 4230,4233 ****
--- 4287,4291 ----
  		AbortTransaction(e.hr);
  		AfxMessageBox("Unable to get model attributes",MB_OK | MB_ICONSTOP);
+ 		CGMEEventLogger::LogGMEEvent("    Unable to get model attributes.\r\n");
  	}
  	pCmdUI->Enable(enable);
***************
*** 4543,4546 ****
--- 4601,4605 ----
  		if(!launcher) {
  			AfxMessageBox("Cannot start up component launcher");
+ 			CGMEEventLogger::LogGMEEvent("    Cannot start up component launcher.\r\n");
  		}
  		else {
***************
*** 4558,4561 ****
--- 4617,4621 ----
  			if(launcher->RunComponent(NULL, theApp.mgaProject, focus, selfcos, GME_MAIN_START) != S_OK) {
  				AfxMessageBox("Component execution failed");
+ 				CGMEEventLogger::LogGMEEvent("    Component execution failed.\r\n");
  			}
  		}
***************
*** 4571,4574 ****
--- 4631,4635 ----
  void CGMEView::OnConncntxDelete()
  {
+ 	CGMEEventLogger::LogGMEEvent("CGMEView::OnConncntxDelete in "+path+name+"\r\n");
  	if(isType) {
  		CGuiConnection *conn = dynamic_cast<CGuiConnection *>(contextSelection);
***************
*** 4932,4935 ****
--- 4993,4997 ----
  		AbortTransaction(e.hr);
  		AfxMessageBox("Unable to access object registry",MB_OK | MB_ICONSTOP);
+ 		CGMEEventLogger::LogGMEEvent("    Unable to access object registry.\r\n");
  	}
  }
***************
*** 4948,4951 ****
--- 5010,5014 ----
  		AbortTransaction(e.hr);
  		AfxMessageBox("Unable to access annotations",MB_OK | MB_ICONSTOP);
+ 		CGMEEventLogger::LogGMEEvent("    Unable to access annotations.\r\n");
  	}
  }
***************
*** 5018,5021 ****
--- 5081,5091 ----
  {
  	CGMEEventLogger::LogGMEEvent("CGMEView::SyncAspects in "+path+name+"\r\n");
+ 	if(srcAspect)
+ 		CGMEEventLogger::LogGMEEvent("    srcAspect="+srcAspect->name+"\r\n");
+ 	CGMEEventLogger::LogGMEEvent("    moving objects:");
+ 	GMEEVENTLOG_GUIOBJS(movingObjects);
+ 	CGMEEventLogger::LogGMEEvent("    sedentary objects:");
+ 	GMEEVENTLOG_GUIOBJS(sedentaryObjects);
+ 	CGMEEventLogger::LogGMEEvent("    dstAspects:\r\n");
  	try {
  		BeginTransaction(TRANSACTION_GENERAL);
***************
*** 5029,5032 ****
--- 5099,5103 ----
  			if (dstAspect == srcAspect)
  				continue;
+ 			CGMEEventLogger::LogGMEEvent("    "+dstAspect->name+"\r\n");
  
  			modelGrid.Clear();
***************
*** 5098,5101 ****
--- 5169,5173 ----
  		AbortTransaction(e.hr);
  		AfxMessageBox("Unable to synchronize aspects",MB_OK | MB_ICONSTOP);
+ 		CGMEEventLogger::LogGMEEvent("    Unable to synchronize aspects.\r\n");
  		EndWaitCursor();
  		return;
***************
*** 5480,5483 ****
--- 5552,5556 ----
  		AbortTransaction(e.hr);
  		AfxMessageBox("Unable to insert annotation",MB_ICONSTOP | MB_OK);
+ 		CGMEEventLogger::LogGMEEvent("    Unable to insert annotation.\r\n");
  		return;
  	}



More information about the GME-commit mailing list