Example #1
0
// <editor-fold defaultstate="collapsed" desc="RL_Error        0xFF">
void ErrorLevel(void){
//    d_clr();
//    d_print("ERROR     \n");
//    //VFLD.Symbol[VFLD_CN2]=1;
//    d_value(OS.prev_runlevel);
    RefreshDisplay();
} // </editor-fold>
Example #2
0
/*virtual*/ void Framework3D::HandleEvent(const WBEvent& Event) {
  XTRACE_FUNCTION;

  STATIC_HASHED_STRING(QuitGame);
  STATIC_HASHED_STRING(ResetRenderer);
  STATIC_HASHED_STRING(ConditionalRefreshDisplay);
  STATIC_HASHED_STRING(RefreshDisplay);

  const HashedString EventName = Event.GetEventName();
  if (EventName == sQuitGame) {
#if BUILD_WINDOWS_NO_SDL
    XTRACE_NAMED(PostQuitMessage);
    PostQuitMessage(0);
#endif
#if BUILD_SDL
    SDL_Event QuitEvent;
    QuitEvent.type = SDL_QUIT;
    const int Success = SDL_PushEvent(&QuitEvent);
    ASSERT(Success);
    Unused(Success);
#endif
  } else if (EventName == sResetRenderer) {
    ResetRenderer();
  } else if (EventName == sConditionalRefreshDisplay) {
    ConditionalRefreshDisplay();
  } else if (EventName == sRefreshDisplay) {
    RefreshDisplay(m_Display->m_Fullscreen, m_Display->m_Width,
                   m_Display->m_Height);
  }
}
Example #3
0
DataField *
WndProperty::SetDataField(DataField *Value)
{
  DataField *res = mDataField;

  if (mDataField != Value) {
    if (mDataField != NULL) {
      if (!mDataField->Unuse()) {
        delete (mDataField);
        res = NULL;
      }
    }

    Value->Use();

    mDataField = Value;

    mDialogStyle = has_pointer() && mDataField->SupportCombo;

    UpdateLayout();

    RefreshDisplay();
  }

  return res;
}
Example #4
0
void
RollEnhanceCB ( Widget w, XtPointer client_data, XtPointer xt_call_data )
{

	WindowObjectType        *wo;
	int			cbank;
	int			scale;
	int			verbose;

	XmScaleCallbackStruct *cbs =
		(XmScaleCallbackStruct *) xt_call_data;

	verbose = GetVerboseLevel();

        wo = GetActiveWindowObject();


	cbank = GetGempakColorBank( wo );
	
	scale =   cbs->value ;
	
	if( verbose > VERBOSE_1 )
		printf ("RollEnhanceCB - value: %d", cbs->value );

	if ( cbank == -1 ) return;

	RollColorEnhancement ( wo, cbank, scale );

        if( DefaultDepthOfScreen(DefaultScreenOfDisplay(XtDisplay(w))) != 8 ) {
            RefreshDisplay ( );  /* Necessary for > 8-bit displays to redraw
                                    images with new pixel values reflecting
                                    new read-only color table entries */
        }
}
Example #5
0
void
WndProperty::BeginEditing()
{
  if (edit.is_read_only()) {
    /* this would display xml file help on a read-only wndproperty if
       it exists */
    OnHelp();
  } else if (mDataField != NULL && mDataField->SupportCombo) {
    SingleWindow *root = (SingleWindow *)get_root_owner();

    /* if this asserton fails, then there no valid root window could
       be found - maybe it didn't register its wndproc? */
    assert(root != NULL);

    dlgComboPicker(*root, this);
  } else if (CanEditInPlace()) {
    edit.set_focus();
  } else if (mDataField != NULL) {
    const TCHAR *value = mDataField->GetAsString();
    if (value == NULL)
      return;

    StaticString<EDITSTRINGSIZE> buffer(value);
    if (!TextEntryDialog(*(SingleWindow *)get_root_owner(), buffer,
                         GetCaption()))
      return;

    mDataField->SetAsString(buffer);
    RefreshDisplay();
  }
}
Example #6
0
// <editor-fold defaultstate="collapsed" desc="RL_Boot         0xFE">
void BootLevel(void){
    //d_clr();
    //d_print("  READY   \n");
    RefreshDisplay();
    OS_delay_1S();
    OS_SetRunlevel(Startmode);
}// </editor-fold>
Example #7
0
void Framework3D::ConditionalRefreshDisplay()
{
	XTRACE_FUNCTION;

	// We shouldn't mess with this during initialization!
	if( m_IsInitializing || m_IsShuttingDown )
	{
		return;
	}

	// Resync display after changing config vars out from under it.
	STATICHASH( Fullscreen );
	const bool Fullscreen		= ConfigManager::GetBool( sFullscreen );

	STATICHASH( DisplayWidth );
	const uint DisplayWidth		= ConfigManager::GetInt( sDisplayWidth );

	STATICHASH( DisplayHeight );
	const uint DisplayHeight	= ConfigManager::GetInt( sDisplayHeight );

	ASSERT( m_Display );
	if( m_Display->NeedsUpdate()					||
		m_Display->m_Fullscreen	!= Fullscreen		||
		m_Display->m_Width		!= DisplayWidth		||
		m_Display->m_Height		!= DisplayHeight	)
	{
		RefreshDisplay( Fullscreen, DisplayWidth, DisplayHeight );
	}
}
Example #8
0
void
FadeScaleCB (Widget w, XtPointer client_data, XtPointer xt_call_data )
{

	WindowObjectType		*wo;
	int				cbank;
	int				scale;
	int				fadeWid;
	int				verbose;
	GuiImageEnhanceDialogType	*img;
	Widget				fadeW = NULL;
	
        XmScaleCallbackStruct *cbs =
	       (XmScaleCallbackStruct *) xt_call_data;

	fadeWid = (int) client_data;

	verbose = GetVerboseLevel();

	wo = GetActiveWindowObject();


/*
 *	Get Gempak Color bank number.  
 *		-1   no image loaded
 *		 1   satellite
 *		 2   nids/nowrad 
 */
	cbank = GetGempakColorBank( wo );
	
	scale =   cbs->value ;
	
	if( verbose > VERBOSE_1 )
	    printf ("FadeScaleCB - value: %d\n", cbs->value );

	if ( cbank == -1 ) return;

	ChangeImageBrightness ( wo, cbank, scale );

        if( DefaultDepthOfScreen(DefaultScreenOfDisplay(XtDisplay(w))) != 8 ) {
            RefreshDisplay ( );  /* Necessary for > 8-bit displays to redraw
                                    images with new pixel values reflecting
                                    new read-only color table entries */
        }

/*
 *	Synchronize the fade slider controls. Set the one who did NOT
 *	call this routine.
 */
 	img = GetGuiImageEnhanceDialog();

	if ( fadeWid == MAIN_CONTROL_FADER )
		fadeW = GetSatImageFadeScaleW ( img );
	else if ( fadeWid == ENHANCE_POPUP_FADER )
		fadeW = GetImageFadeScaleW ( img );

	if( fadeW ) XtVaSetValues ( fadeW, XmNvalue, scale, NULL );

}
Example #9
0
int
WndProperty::IncValue()
{
  if (mDataField != NULL) {
    mDataField->Inc();
    RefreshDisplay();
  }
  return 0;
}
Example #10
0
int
WndProperty::CallSpecial(void)
{
  if (mDataField != NULL) {
    mDataField->Special();
    RefreshDisplay();
  }
  return 0;
}
Example #11
0
int
WndProperty::DecValue(void)
{
  if (mDataField != NULL) {
    mDataField->Dec();
    RefreshDisplay();
  }
  return 0;
}
Example #12
0
void
SatEnhancementCB  (Widget w, XtPointer client_data, XtPointer xt_call_data )
{
	extern Widget	sat_enhance_list;
	extern Widget	sat_enhance_but;

	extern struct enhance_list	satenhance_list;

	char		color_table[20];
	int		*pos_list;
	int		pos_cnt;
	int		i;

	GlobalDataObjectType	*gd;

	XmListCallbackStruct *cbs =
	              (XmListCallbackStruct *) xt_call_data;

/*
 *	Get color table to use.
 */
	if ( ! ( XmListGetSelectedPos ( sat_enhance_list,
	                              &pos_list, &pos_cnt ) &&
	                            ( pos_cnt == 1 ) ) ) return;
	i = pos_list[0] - 1;
	free ( pos_list );
	strcpy ( color_table, satenhance_list.list[i] );

/*
 *	Add extension for color tables.
 */
	if ( ! ( strcmp ( color_table, "DEFAULT" ) == 0 ||
	         strcmp ( color_table, "gray" )    == 0  ) )
	    strcat ( color_table, ".tbl" );

/*
 *	Save parameters.
 */
	gd = GetGlobalDataObject();

	SetDefColortable ( gd, color_table );
	SetBackgroundColors ( gd, satenhance_list.background[i] );
	SetForegroundColors ( gd, satenhance_list.foreground[i] );

/*
 *	Change lutfile.
 */
	newlut ( color_table );

	if( DefaultDepthOfScreen(DefaultScreenOfDisplay(XtDisplay(w))) != 8 ) {
	    RefreshDisplay ( );  /* Necessary for > 8-bit displays to redraw
				    images with new pixel values reflecting
				    new read-only color table entries */
	}
}
Example #13
0
void ASSDrawEngine::OnPaint(wxPaintEvent& event)
{
	draw();
	onPaint(event);
	if (setfitviewpoint)
	{
		FitToViewPoint( fitviewpoint_hmargin, fitviewpoint_vmargin );
		setfitviewpoint = false;
		RefreshDisplay();
	}
}
Example #14
0
void
WndProperty::SetDataField(DataField *Value)
{
  assert(mDataField == NULL || mDataField != Value);

  delete mDataField;
  mDataField = Value;

  UpdateLayout();

  RefreshDisplay();
}
Example #15
0
int main()
{	
	
	ConfigPins();
	int i=5000;	
	while(1) 
	{
	
		DisplayNumber(i--);
		RefreshDisplay();
		if (i < 0)
			i=5000;
		
	}    
}
Example #16
0
void CDlgSqlErrorHistory::OnSqlerrFirst()
{
	CaSqlErrorInfo* SqlError;
	if (m_listSqlError.IsEmpty())
		return;
	m_posDisplayErrorView = m_listSqlError.GetHeadPosition();
	m_posNextErrorView = m_posDisplayErrorView;
	m_posPrevErrorView = m_posDisplayErrorView;

	SqlError = m_listSqlError.GetNext(m_posNextErrorView);
	RefreshDisplay(SqlError);
	m_bEndList    = FALSE;
	m_bBegingList = TRUE;
	m_bMidleList  = FALSE;
	SqlErrUpdButtonsStates();
}
Example #17
0
void ASSDrawEngine::FitToViewPoint(int hmargin, int vmargin)
{
	wxSize v = GetClientSize();
	double wide = rendered_max_x - rendered_min_x;
	double high = rendered_max_y - rendered_min_y;
	double widthratio = (double) (v.x - hmargin * 2) / wide;
	double heightratio = (double) (v.y - vmargin * 2) / high;
	double ratio = (widthratio < heightratio? widthratio:heightratio);
	pointsys->scale = pointsys->scale * ratio;
	if (pointsys->scale < 0.01) pointsys->scale = 0.01;
	double new_min_x = pointsys->originx + (rendered_min_x - pointsys->originx) * ratio;
	double new_max_x = pointsys->originx + (rendered_max_x - pointsys->originx) * ratio;
	pointsys->originx += (v.x - new_max_x + new_min_x) / 2 - new_min_x;
	double new_min_y = pointsys->originy + (rendered_min_y - pointsys->originy) * ratio;
	double new_max_y = pointsys->originy + (rendered_max_y - pointsys->originy) * ratio;
	pointsys->originy += (v.y - new_max_y + new_min_y) / 2 - new_min_y;
	RefreshDisplay();
}
Example #18
0
LONG CuDlgDomPropIceSecRole::OnLoad (WPARAM wParam, LPARAM lParam)
{
  // Precheck consistency of class name
  LPCTSTR pClass = (LPCTSTR)wParam;
  ASSERT (lstrcmp (pClass, "CuDomPropDataIceSecRole") == 0);
  ResetDisplay();
  // Get class pointer, and check for it's class runtime type
  CuDomPropDataIceSecRole* pData = (CuDomPropDataIceSecRole*)lParam;
  ASSERT (pData->IsKindOf(RUNTIME_CLASS(CuDomPropDataIceSecRole)));

  // Update current m_Data using operator = overloading
  m_Data = *pData;

  // Refresh display
  RefreshDisplay();

  return 0L;
}
Example #19
0
void
RefreshBackgroundsCB (Widget w, XtPointer client_data, XtPointer call_data )
{
	WindowObjectType        *wo;
	PixmapObjectType        *po;
	char			*proj, *garea;
	
	XmPushButtonCallbackStruct *cbs = 
			(XmPushButtonCallbackStruct *) call_data;

/*
 *	Make sure we have a pixmap to draw into and supply some default
 *	georeferencing
 */
	wo = GetActiveWindowObject();
	if ( wo->numPixmapObjects == 0 )
		po = GetNextPot (wo);

	if( ! GetGeoRefObject(wo) ) {
 
            proj = GetConfigValue ( "default_proj" );
	    if ( proj == NULL ) proj = strdup ( "lcc/30.0;-100;50.0//nm" );

	    garea = GetConfigValue ( "default_garea" );
	    if ( garea == NULL ) garea = strdup ( "23.0;-120.0;47.0;-65.0" );

	    SetGeoRefObjectViewType( wo, PLAN );
	    SetGeoRefObjectGarea( wo, garea );
	    SetGeoRefObjectFilename( wo, NULL );
	    SetGeoRefObjectProjection( wo, proj );

	    Free ( proj );
	    Free ( garea );

	}

/*
 *	Redraw
 */
	RefreshDisplay();

	return;
}
Example #20
0
LONG CuDlgDomPropTblPages::OnLoad (WPARAM wParam, LPARAM lParam)
{
  // Precheck consistency of class name
  LPCTSTR pClass = (LPCTSTR)wParam;
  ASSERT (_tcscmp (pClass, _T("CuDomPropDataPages")) == 0);
  ResetDisplay();
  // Get class pointer, and check for it's class runtime type
  CuDomPropDataPages* pData = (CuDomPropDataPages*)lParam;
  ASSERT (pData->IsKindOf(RUNTIME_CLASS(CuDomPropDataPages)));

  // Update current m_Data using operator = overloading
  m_Data = *pData;

  // flag loaded object that it must delete the array itself
  pData->SetMustDeleteArray();

  // Refresh display
  RefreshDisplay();

  return 0L;

}
Example #21
0
void
InvertImageColorsCB (Widget w, XtPointer client_data, XtPointer xt_call_data )
/*
 * Invert color table for image.
 */
{
	WindowObjectType	*wo;
	int			verbose, cbank;


        XmToggleButtonCallbackStruct *cbs = 
		      (XmToggleButtonCallbackStruct *) xt_call_data;

	verbose = GetVerboseLevel();

	wo = GetActiveWindowObject();

/*
 *	Get Gempak Color bank number.
 *		-1   no image loaded
 *		 1   satellite
 *		 2   nids/nowrad
 */
	cbank = GetGempakColorBank( wo );

	if( verbose > VERBOSE_1 ) {
		printf ("InvertImageColors, bank: %d", cbank );
		printf (" toggle setting: %d\n", cbs->set );
	}

	if ( cbank == -1 ) return;

	InvertImageColors ( wo, cbank, cbs->set );

	if( DefaultDepthOfScreen(DefaultScreenOfDisplay(XtDisplay(w))) > 8 )
            RefreshDisplay ( );  /* Necessary for > 8-bit displays to redraw
                                    images with new pixel values reflecting
                                    new read-only color table entries */
}
Example #22
0
void CDlgSqlErrorHistory::OnSqlerrPrev()
{
	CaSqlErrorInfo* SqlError;
	if (m_listSqlError.IsEmpty() || !m_posPrevErrorView)
		return;
	m_posDisplayErrorView = m_posPrevErrorView;
	m_posNextErrorView = m_posDisplayErrorView;
	m_listSqlError.GetNext(m_posNextErrorView); 

	SqlError = m_listSqlError.GetPrev(m_posPrevErrorView);
	if (SqlError)
		RefreshDisplay(SqlError);
	if (!m_posPrevErrorView)// Begining of List is reached
	{
		m_bBegingList = TRUE;
		m_bEndList    = FALSE;
		m_bMidleList  = FALSE;
		m_posPrevErrorView = m_listSqlError.GetHeadPosition();
	}
	else
		m_bMidleList = TRUE;
	SqlErrUpdButtonsStates();}
Example #23
0
DataField *
WndProperty::SetDataField(DataField *Value)
{
  DataField *res = mDataField;

  if (mDataField != Value) {
    if (mDataField != NULL) {
      if (!mDataField->Unuse()) {
        delete (mDataField);
        res = NULL;
      }
    }

    Value->Use();

    mDataField = Value;

    UpdateLayout();

    RefreshDisplay();
  }

  return res;
}
Example #24
0
LONG CuDlgDomPropIceSecRole::OnUpdateData (WPARAM wParam, LPARAM lParam)
{
  // cast received parameters
  int nNodeHandle = (int)wParam;
  LPIPMUPDATEPARAMS pUps = (LPIPMUPDATEPARAMS)lParam;
  ASSERT (nNodeHandle != -1);
  ASSERT (pUps);

  // ignore selected actions on filters
  switch (pUps->nIpmHint)
  {
    case 0:
      //case FILTER_DOM_SYSTEMOBJECTS:
      //case FILTER_DOM_BASEOWNER:
      //case FILTER_DOM_OTHEROWNER:
      break;

    case FILTER_DOM_BKREFRESH_DETAIL:
      if (m_Data.m_refreshParams.MustRefresh(pUps->pSFilter->bOnLoad, pUps->pSFilter->refreshtime))
        break;    // need to update
      else
        return 0; // no need to update
      break;

    default:
      return 0L;    // nothing to change on the display
  }


  LPTREERECORD  lpRecord = (LPTREERECORD)pUps->pStruct;
  ASSERT (lpRecord);
  ResetDisplay();
  // double check type
  int objType = lpRecord->recType;
  ASSERT (objType == OT_ICE_BUNIT_SEC_ROLE);

  // Get Info
  ICEBUSUNITROLEDATA  iceStruct;
  memset (&iceStruct, 0, sizeof(iceStruct));
  x_strcpy((LPSTR)iceStruct.icerole.RoleName, (LPCSTR)lpRecord->objName);
  x_strcpy((LPSTR)iceStruct.icebusunit.Name, (LPCSTR)lpRecord->extra);
  int iResult = GetICEInfo ((LPUCHAR)GetVirtNodeName(nNodeHandle),
                            objType,
                            &iceStruct);
  if (iResult != RES_SUCCESS) {
    ASSERT (FALSE);

    // Reset m_Data
    CuDomPropDataIceSecRole tempData;
    tempData.m_refreshParams = m_Data.m_refreshParams;
    m_Data = tempData;

    // Refresh display
    RefreshDisplay();

    return 0L;
  }

  // Update refresh info
  m_Data.m_refreshParams.UpdateRefreshParams();

  //
  // update member variables, for display/load/save purpose
  //
  m_Data.m_bExecDoc   = iceStruct.bExecDoc;
  m_Data.m_bCreateDoc = iceStruct.bCreateDoc;
  m_Data.m_bReadDoc   = iceStruct.bReadDoc;

  // Refresh display
  RefreshDisplay();

  return 0L;
}
Example #25
0
LONG CuDlgDomPropRoleXGrantedDb::OnUpdateData (WPARAM wParam, LPARAM lParam)
{
  // cast received parameters
  int nNodeHandle = (int)wParam;
  LPIPMUPDATEPARAMS pUps = (LPIPMUPDATEPARAMS)lParam;
  ASSERT (nNodeHandle != -1);
  ASSERT (pUps);

  // ignore selected actions on filters
  switch (pUps->nIpmHint)
  {
    case 0:
      case FILTER_DOM_SYSTEMOBJECTS:  // can be system objects (replicator dd_xyz)
      //case FILTER_DOM_BASEOWNER:
      //case FILTER_DOM_OTHEROWNER:
      break;

    case FILTER_DOM_BKREFRESH:
      // eligible if UpdateType is compatible with DomGetFirst/Next object type,
      // or is ot_virtnode, which means refresh for all whatever the type is
      if (pUps->pSFilter->UpdateType != OT_VIRTNODE &&
          pUps->pSFilter->UpdateType != OT_DATABASE)
        return 0L;
      break;
    case FILTER_SETTING_CHANGE:
        VDBA_OnGeneralSettingChange(&m_cListCtrl);
        return 0L;
    default:
      return 0L;    // nothing to change on the display
  }

  // Get info on the current item
  LPTREERECORD  lpRecord = (LPTREERECORD)pUps->pStruct;
  ASSERT (lpRecord);
  ResetDisplay();
  //
  // Get list of granted objects
  //
  m_Data.m_uaRoleXGrantedDb.RemoveAll();

  int     iret;
  LPUCHAR aparentsTemp[MAXPLEVEL];

  UCHAR   buf[MAXOBJECTNAME];
  UCHAR   bufOwner[MAXOBJECTNAME];
  UCHAR   bufComplim[MAXOBJECTNAME];

  memset (&bufComplim, '\0', sizeof(bufComplim));
  memset (&bufOwner, '\0', sizeof(bufOwner));

  // Xref return code
  LPUCHAR aparentsResult[MAXPLEVEL];
  UCHAR   bufParResult0[MAXOBJECTNAME];
  UCHAR   bufParResult1[MAXOBJECTNAME];
  UCHAR   bufParResult2[MAXOBJECTNAME];
  aparentsResult[0] = bufParResult0;
  aparentsResult[1] = bufParResult1;
  aparentsResult[2] = bufParResult2;

  // prepare parenthood with schema where relevant
  aparentsTemp[0] = lpRecord->objName;
  aparentsTemp[1] = aparentsTemp[2] = NULL;

  BOOL bError = FALSE;
  for (int index = 0; index < NBDBGRANTED; index++) {
    iret =  DOMGetFirstRelObject(nNodeHandle,
                                 aGrantedType[index],
                                 1,                           // level,
                                 aparentsTemp,                // Temp mandatory!
                                 pUps->pSFilter->bWithSystem, // bwithsystem
                                 NULL,                        // base owner
                                 NULL,                        // other owner
                                 aparentsResult,
                                 buf,
                                 bufOwner,
                                 bufComplim);
     if (iret != RES_SUCCESS && iret != RES_ENDOFDATA) {
       bError = TRUE;
       continue;
    }
    else {
      while (iret == RES_SUCCESS) {
        CuGrantedDb grantedDb((const char *)buf,                // obj name
                              (const char *)_T(""),             // No obj owner
                              (const char *)_T(""),             // No obj parent
                              aGrantedType[index]               // grant type
                              );
        CuMultFlag *pRefGrantedDb = m_Data.m_uaRoleXGrantedDb.Find(&grantedDb);
        if (pRefGrantedDb)
          m_Data.m_uaRoleXGrantedDb.Merge(pRefGrantedDb, &grantedDb);
        else
          m_Data.m_uaRoleXGrantedDb.Add(grantedDb);

        iret = DOMGetNextRelObject(aparentsResult, buf, bufOwner, bufComplim);
      }
    }
  }

  // Manage error case
  if (bError)
  {
    /* "<Data Unavailable>" */
    CuGrantedDb grantedDb1(VDBA_MfcResourceString (IDS_DATA_UNAVAILABLE));
    m_Data.m_uaRoleXGrantedDb.Add(grantedDb1);
  }

  // Manage no granted object
  if (m_Data.m_uaRoleXGrantedDb.GetCount() == 0)
  {
    CuGrantedDb grantedDb2(VDBA_MfcResourceString (IDS_E_NO_GRANTED_DB));
    m_Data.m_uaRoleXGrantedDb.Add(grantedDb2);
  }

  ASSERT (m_Data.m_uaRoleXGrantedDb.GetCount() > 0 );

  // Refresh display
  RefreshDisplay();

  return 0L;
}
Example #26
0
LONG CuDlgDomPropStaticProfile::OnUpdateData (WPARAM wParam, LPARAM lParam)
{
  // cast received parameters
  int nNodeHandle = (int)wParam;
  LPIPMUPDATEPARAMS pUps = (LPIPMUPDATEPARAMS)lParam;
  ASSERT (nNodeHandle != -1);
  ASSERT (pUps);

  // ignore selected actions on filters
  switch (pUps->nIpmHint)
  {
    case 0:
      case FILTER_DOM_SYSTEMOBJECTS:    // eligible
      case FILTER_DOM_BASEOWNER:
      //case FILTER_DOM_OTHEROWNER:
      break;

    case FILTER_DOM_BKREFRESH:
      // eligible if UpdateType is compatible with DomGetFirst/Next object type,
      // or is ot_virtnode, which means refresh for all whatever the type is
      if (pUps->pSFilter->UpdateType != OT_VIRTNODE &&
          pUps->pSFilter->UpdateType != OT_PROFILE)
        return 0L;
      break;
    case FILTER_SETTING_CHANGE:
        VDBA_OnGeneralSettingChange(&m_cListCtrl);
        return 0L;
    default:
      return 0L;    // nothing to change on the display
  }

  // Get info on the current item
  LPTREERECORD  lpRecord = (LPTREERECORD)pUps->pStruct;
  ASSERT (lpRecord);
  ResetDisplay();
  //
  // Get list of Profiles
  //
  m_Data.m_uaStaticProfile.RemoveAll();

  int     iret;
  LPUCHAR aparentsTemp[MAXPLEVEL];

  UCHAR   buf[MAXOBJECTNAME];
  UCHAR   bufOwner[MAXOBJECTNAME];
  UCHAR   bufComplim[MAXOBJECTNAME];

  // parent preparation
  aparentsTemp[0] = aparentsTemp[1] = aparentsTemp[2] = NULL;

  memset (&bufComplim, '\0', sizeof(bufComplim));
  memset (&bufOwner, '\0', sizeof(bufOwner));
  iret =  DOMGetFirstObject(nNodeHandle,
                            OT_PROFILE,
                            0,                            // level,
                            aparentsTemp,                 // Temp mandatory!
                            pUps->pSFilter->bWithSystem,  // bwithsystem
                            NULL,                         // lpowner
                            buf,
                            bufOwner,
                            bufComplim);
  if (iret != RES_SUCCESS && iret != RES_ENDOFDATA) {
    // Erroneous case!
    CuNameOnly errItem(VDBA_MfcResourceString (IDS_DATA_UNAVAILABLE), TRUE);   // Special"<Data Unavailable>"
    m_Data.m_uaStaticProfile.Add(errItem);
  }
  else {
    while (iret == RES_SUCCESS) {
      CuNameOnly item((const char*)buf, FALSE);   // Not special, but regular
      m_Data.m_uaStaticProfile.Add(item);

      iret = DOMGetNextObject(buf, bufOwner, bufComplim);
    }
  }
  if (m_Data.m_uaStaticProfile.GetCount() == 0) {
    CuNameOnly noItem(VDBA_MfcResourceString (IDS_E_NO_PROFILE), TRUE);//"<No Profile>"
    m_Data.m_uaStaticProfile.Add(noItem);
  }

  // Refresh display
  RefreshDisplay();

  return 0L;
}
Example #27
0
LONG CuDlgDomPropTblInteg::OnUpdateData (WPARAM wParam, LPARAM lParam)
{
  // cast received parameters
  int nNodeHandle = (int)wParam;
  LPIPMUPDATEPARAMS pUps = (LPIPMUPDATEPARAMS)lParam;
  ASSERT (nNodeHandle != -1);
  ASSERT (pUps);

  // ignore selected actions on filters
  switch (pUps->nIpmHint)
  {
    case 0:
      case FILTER_DOM_SYSTEMOBJECTS:    // eligible
      //case FILTER_DOM_BASEOWNER:
      //case FILTER_DOM_OTHEROWNER:
      break;

    case FILTER_DOM_BKREFRESH:
      // eligible if UpdateType is compatible with DomGetFirst/Next object type,
      // or is ot_virtnode, which means refresh for all whatever the type is
      if (pUps->pSFilter->UpdateType != OT_VIRTNODE &&
          pUps->pSFilter->UpdateType != OT_INTEGRITY)
        return 0L;
      break;
    case FILTER_SETTING_CHANGE:
        VDBA_OnGeneralSettingChange(&m_cListCtrl);
        return 0L;
    default:
      return 0L;    // nothing to change on the display
  }

  // Get info on the current item
  LPTREERECORD  lpRecord = (LPTREERECORD)pUps->pStruct;
  ASSERT (lpRecord);
  ResetDisplay();
  //
  // Get list of Tbl for the replication
  //
  m_Data.m_uaTblInteg.RemoveAll();

  int     iret;
  UCHAR   buf[MAXOBJECTNAME];
  UCHAR   bufOwner[MAXOBJECTNAME];
  UCHAR   bufComplim[MAXOBJECTNAME];

  //
  // CHECK EXISTENCE SINCE REGISTERED TABLE MIGHT NOT REALLY EXIST YET
  //
  int   resultType;
  UCHAR resultObjectName[MAXOBJECTNAME];
  UCHAR resultOwnerName[MAXOBJECTNAME];
  UCHAR resultExtraData[MAXOBJECTNAME];
  char* parentStrings[3];
  parentStrings[0] = (char*)lpRecord->extra;  // DBName
  parentStrings[1] = parentStrings[2] = NULL;

  // preparation for get limited info - added static type - added all related granted types
  LPUCHAR lpName = NULL;
  LPUCHAR lpOwner = NULL;
  int basicType = GetBasicType(lpRecord->recType);
  m_Data.m_objType = basicType;
  switch (basicType) {
    case OT_TABLE:
    case OT_SCHEMAUSER_TABLE:
      lpName = (LPUCHAR)lpRecord->objName;
      lpOwner = (LPUCHAR)lpRecord->ownerName;
      break;
    case OT_STATIC_INTEGRITY:
      lpName = (LPUCHAR)lpRecord->extra2;
      lpOwner = (LPUCHAR)lpRecord->tableOwner;
      break;
    default:
      ASSERT(FALSE);
      return 0L;
  }

  iret = DOMGetObjectLimitedInfo(nNodeHandle,
                                 lpName,                           // object name,
                                 lpOwner,                          // object owner
                                 OT_TABLE,                         // iobjecttype
                                 1,                                // level
                                 (unsigned char **)parentStrings,  // parenthood
                                 TRUE,                             // bwithsystem
                                 &resultType,
                                 resultObjectName,
                                 resultOwnerName,
                                 resultExtraData
                                 );
  if (iret == RES_ENDOFDATA)
    iret = RES_ERR;           // Non-existent: ERROR !!!
  if (iret == RES_SUCCESS) {
    LPUCHAR aparentsTemp[MAXPLEVEL];

    // prepare parenthood with schema where relevant
    aparentsTemp[0] = lpRecord->extra;  // DBName

    UCHAR bufParent1[MAXOBJECTNAME];
    aparentsTemp[1] = bufParent1;
    x_strcpy((char *)buf, (const char *)resultObjectName);
    StringWithOwner(buf, resultOwnerName, aparentsTemp[1]); // schema.name

    aparentsTemp[2] = NULL;

    memset (&bufComplim, '\0', sizeof(bufComplim));
    memset (&bufOwner, '\0', sizeof(bufOwner));
    iret =  DOMGetFirstObject(nNodeHandle,
                              OT_INTEGRITY,
                              2,                            // level,
                              aparentsTemp,                 // Temp mandatory!
                              pUps->pSFilter->bWithSystem,  // bwithsystem
                              NULL,                         // lpowner
                              buf,
                              bufOwner,
                              bufComplim);
  }
  if (iret != RES_SUCCESS && iret != RES_ENDOFDATA) {
    // Erroneous case!
    CuNameWithOwner errItem(VDBA_MfcResourceString (IDS_DATA_UNAVAILABLE));//"<Data Unavailable>"
    m_Data.m_uaTblInteg.Add(errItem);
  }
  else {
    while (iret == RES_SUCCESS) {
      CuNameWithOwner item((const char*)buf, _T(""));   // no owner
      m_Data.m_uaTblInteg.Add(item);

      iret = DOMGetNextObject(buf, bufOwner, bufComplim);
    }
  }
  if (m_Data.m_uaTblInteg.GetCount() == 0) {
    CuNameWithOwner noItem(VDBA_MfcResourceString (IDS_E_NO_INTEGRITY));//"<No Integrity>"
    m_Data.m_uaTblInteg.Add(noItem);
  }

  // Refresh display
  RefreshDisplay();

  return 0L;
}
Example #28
0
LONG CuDlgDomPropTblPages::OnUpdateData (WPARAM wParam, LPARAM lParam)
{
  // cast received parameters
  int nNodeHandle = (int)wParam;
  LPIPMUPDATEPARAMS pUps = (LPIPMUPDATEPARAMS)lParam;
  ASSERT (nNodeHandle != -1);
  ASSERT (pUps);

  // ignore selected actions on filters
  switch (pUps->nIpmHint)
  {
    case 0:
      //case FILTER_DOM_SYSTEMOBJECTS:
      //case FILTER_DOM_BASEOWNER:
      //case FILTER_DOM_OTHEROWNER:
      break;

    case FILTER_DOM_BKREFRESH_DETAIL:
      if (m_Data.m_refreshParams.MustRefresh(pUps->pSFilter->bOnLoad, pUps->pSFilter->refreshtime))
        break;    // need to update
      else
        return 0; // no need to update
      break;
    default:
      return 0L;    // nothing to change on the display
  }

  // Get info on the current item
  LPTREERECORD  lpRecord = (LPTREERECORD)pUps->pStruct;
  ASSERT (lpRecord);
  ResetDisplay();
  //
  // Get pages of table, even if system object (lpRecord->ownerName is "$ingres" )
  //
  INGRESPAGEINFO pageinfo;
  memset(&pageinfo, 0, sizeof(INGRESPAGEINFO));
  BOOL bOK = GetIngresPageInfo(nNodeHandle, lpRecord->extra, lpRecord->objName, lpRecord->ownerName, &pageinfo);
  if (!bOK) {
    // Need to reset pageinfo since has been partially filled by GetIngresPageInfo
    memset(&pageinfo, 0, sizeof(INGRESPAGEINFO));
    // "Cannot Access Page Information"
    MessageWithHistoryButton(m_hWnd, VDBA_MfcResourceString (IDS_E_PAGE_INFORMATION));
  }

  ASSERT (m_pPieCtrl && m_pPieCtrlHashTable);
  if (m_pPieCtrl && m_pPieCtrlHashTable)
  {
     //
     // Hash Table or Non-Hash Table. This value should be changed
     // upon the table's structure:
   //  BOOL bHashTable = TRUE; 
     ShowPieChartCtrl ((LPVOID)&pageinfo, pageinfo.bNewHash);

  /*
    double dPercent = 0.0;
    CString strTitle;
    CaPieInfoData* pData = m_pPieCtrl->GetPieInformation();
    pData->Cleanup();
    pData->SetCapacity ((double)pageinfo.ltotal, _T(""));
    if (pageinfo.linuse > 0)
    {
        dPercent = ((double)pageinfo.linuse / (double)pageinfo.ltotal) * 100.00;
        pData->AddPie2 (_T("In Use"), dPercent, RGB(0, 0, 192), (double)pageinfo.linuse);
    }
    else
        pData->AddLegend (_T("In Use"), RGB(0, 0, 192));

    if (pageinfo.lfreed > 0)
    {
        dPercent = ((double)pageinfo.lfreed / (double)pageinfo.ltotal) * 100.00;
        pData->AddPie2 (_T("Freed"), dPercent, RGB(0, 192, .0), (double)pageinfo.lfreed);
    }
    else
        pData->AddLegend (_T("Freed"), RGB(0, 192, .0));

    if (pageinfo.lneverused > 0)
    {
        dPercent = ((double)pageinfo.lneverused / (double)pageinfo.ltotal) * 100.00;
        pData->AddPie2 (_T("Never Used"), dPercent, RGB(255, 255, 0), (double)pageinfo.lneverused);
    }
    else
        pData->AddLegend (_T("Never Used"), RGB(255, 255, 0));

    if (pageinfo.loverflow > 0)
    {
        dPercent = ((double)pageinfo.loverflow / (double)pageinfo.ltotal) * 100.00;
        pData->AddPie2 (_T("Overflow"),  dPercent, RGB(255, 0, 0), (double)pageinfo.lneverused);
    }
    else
        pData->AddLegend (_T("Overflow"), RGB(255, 0, 0));

    strTitle.Format (_T("Total = %d"), pageinfo.ltotal);
    pData->SetTitle(strTitle);
    m_pPieCtrl->UpdateLegend();
    m_pPieCtrl->UpdatePieChart();
   */
  }
  // Update refresh info
  m_Data.m_refreshParams.UpdateRefreshParams();

  CopyData (&m_Data, &pageinfo, TRUE); // pageinfo -> m_Data

  // Refresh display
  RefreshDisplay();

  return 0L;
}
Example #29
0
LONG CuDlgDomPropDDb::OnUpdateData (WPARAM wParam, LPARAM lParam)
{
  // cast received parameters
  int nNodeHandle = (int)wParam;
  LPIPMUPDATEPARAMS pUps = (LPIPMUPDATEPARAMS)lParam;
  ASSERT (nNodeHandle != -1);
  ASSERT (pUps);

  // ignore selected actions on filters
  switch (pUps->nIpmHint)
  {
    case 0:
      //case FILTER_DOM_SYSTEMOBJECTS:
      //case FILTER_DOM_BASEOWNER:
      //case FILTER_DOM_OTHEROWNER:
      break;

    case FILTER_DOM_BKREFRESH_DETAIL:
      if (m_Data.m_refreshParams.MustRefresh(pUps->pSFilter->bOnLoad, pUps->pSFilter->refreshtime))
        break;    // need to update
      else
        return 0; // no need to update
      break;

    default:
      return 0L;    // nothing to change on the display
  }

  ResetDisplay();
  // Get info on the object
  DATABASEPARAMS DbParams;
  memset (&DbParams, 0, sizeof (DbParams));

  LPTREERECORD  lpRecord = (LPTREERECORD)pUps->pStruct;
  ASSERT (lpRecord);

  //
  // Get Detail Info
  //
  lstrcpy ((LPTSTR)DbParams.objectname, (LPCTSTR)lpRecord->objName);
  DbParams.DbType = lpRecord->parentDbType;
  int dummySesHndl;
  int iResult = GetDetailInfo ((LPUCHAR)GetVirtNodeName(nNodeHandle),
                               OT_DATABASE,
                               &DbParams,
                               FALSE,
                               &dummySesHndl);
  if (iResult != RES_SUCCESS) {
    ASSERT (FALSE);

    // Reset m_Data
    CuDomPropDataDDb tempData;
    tempData.m_refreshParams = m_Data.m_refreshParams;
    m_Data = tempData;

    // Refresh display
    RefreshDisplay();

    return 0L;
  }

  // Update refresh info
  m_Data.m_refreshParams.UpdateRefreshParams();

  // update member variables, for display/load/save purpose
  m_Data.m_csOwner  = DbParams.szOwner ;
  m_Data.m_csLocDb  = DbParams.szDbDev ;
  m_Data.m_csLocChk = DbParams.szChkpDev;
  m_Data.m_csLocJnl = DbParams.szJrnlDev;
  m_Data.m_csLocDmp = DbParams.szDmpDev;
  m_Data.m_csLocSrt = DbParams.szSortDev;

  // liberate detail structure
  FreeAttachedPointers (&DbParams, OT_DATABASE);

  //
  // Get name of Coordinator Database
  //
  int     iret;
  LPUCHAR aparentsTemp[MAXPLEVEL];

  LPUCHAR aparentsResult[MAXPLEVEL];
  UCHAR   bufParResult0[MAXOBJECTNAME];
  UCHAR   bufParResult1[MAXOBJECTNAME];
  UCHAR   bufParResult2[MAXOBJECTNAME];

  UCHAR   buf[MAXOBJECTNAME];
  UCHAR   bufOwner[MAXOBJECTNAME];
  UCHAR   bufComplim[MAXOBJECTNAME];

  aparentsResult[0] = bufParResult0;
  aparentsResult[1] = bufParResult1;
  aparentsResult[2] = bufParResult2;

  memset (&bufComplim, '\0', sizeof(bufComplim));
  memset (&bufOwner, '\0', sizeof(bufOwner));
  aparentsTemp[0] = lpRecord->objName;
  aparentsTemp[1] = aparentsTemp[2] = NULL;

  iret =  DOMGetFirstRelObject(nNodeHandle,
                               OTR_CDB,
                               1,                           // level,
                               aparentsTemp,                // Temp mandatory!
                               TRUE,                        // bwithsystem
                               NULL,                        // base owner
                               NULL,                        // other owner
                               aparentsResult,
                               buf,
                               bufOwner,
                               bufComplim);
  if (iret != RES_SUCCESS) {
    ASSERT (FALSE);

    // Reset m_Data
    CuDomPropDataDDb tempData;
    m_Data = tempData;

    // Refresh display
    RefreshDisplay();

    return 0L;
  }
  m_Data.m_csCoordinator = buf;

  // Refresh display
  RefreshDisplay();

  return 0L;
}
Example #30
0
LONG CuDlgDomPropTableColumns::OnUpdateData (WPARAM wParam, LPARAM lParam)
{
  // cast received parameters
  int nNodeHandle = (int)wParam;
  LPIPMUPDATEPARAMS pUps = (LPIPMUPDATEPARAMS)lParam;
  ASSERT (nNodeHandle != -1);
  ASSERT (pUps);

  // ignore selected actions on filters
  switch (pUps->nIpmHint)
  {
    case 0:
    //case FILTER_DOM_SYSTEMOBJECTS:
    //case FILTER_DOM_BASEOWNER:
    //case FILTER_DOM_OTHEROWNER:
      break;

    case FILTER_DOM_BKREFRESH_DETAIL:
      if (m_Data.m_refreshParams.MustRefresh(pUps->pSFilter->bOnLoad, pUps->pSFilter->refreshtime))
        break;    // need to update
      else
        return 0; // no need to update
      break;
    case FILTER_SETTING_CHANGE:
        VDBA_OnGeneralSettingChange(&m_cListColumns);
        return 0L;
    default:
      return 0L;    // nothing to change on the display
  }

  // Get info on the object
  TABLEPARAMS tableparams;
  memset (&tableparams, 0, sizeof (tableparams));

  LPTREERECORD  lpRecord = (LPTREERECORD)pUps->pStruct;
  ASSERT (lpRecord);
  ResetDisplay();
  x_strcpy ((char *)tableparams.DBName,     (const char *)lpRecord->extra);
  x_strcpy ((char *)tableparams.objectname, RemoveDisplayQuotesIfAny((LPCTSTR)StringWithoutOwner(lpRecord->objName)));
  x_strcpy ((char *)tableparams.szSchema,   (const char *)lpRecord->ownerName);
  tableparams.detailSubset = TABLE_SUBSET_COLUMNSONLY;  // minimize query duration

  int dummySesHndl;
  int iResult = GetDetailInfo ((LPUCHAR)GetVirtNodeName(nNodeHandle),
                               OT_TABLE,
                               &tableparams,
                               FALSE,
                               &dummySesHndl);
  if (iResult != RES_SUCCESS) {
    // Table may not exist if propagate too fast
    if (iResult != RES_ENDOFDATA)
      ASSERT (FALSE);

    // Reset m_Data
    CuDomPropDataTableColumns tempData;
    tempData.m_refreshParams = m_Data.m_refreshParams;
    m_Data = tempData;

    // Create error item and that's it!
    /* "<Data Unavailable>" */
    CuTblColumn tblColumn1(VDBA_MfcResourceString (IDS_DATA_UNAVAILABLE));
    m_Data.m_uaColumns.Add(tblColumn1);

    // Refresh display
    RefreshDisplay();

    return 0L;
  }

  // Update refresh info
  m_Data.m_refreshParams.UpdateRefreshParams();
  TCHAR *lpObjComment = NULL;
  int iret = RES_SUCCESS;
  LPOBJECTLIST ls ,lpColTemp,lpObjCol = NULL;
  LPCOMMENTCOLUMN lpCommentCol;
  ls = tableparams.lpColumns;
  while (ls)
  {
    lpColTemp = AddListObjectTail(&lpObjCol, sizeof(COMMENTCOLUMN));
    if (!lpColTemp)
    {
      // Need to free previously allocated objects.
      FreeObjectList(lpObjCol);
      lpObjCol = NULL;
      break;
    }
    LPCOLUMNPARAMS lstbl=(LPCOLUMNPARAMS)ls->lpObject;
    lpCommentCol = (LPCOMMENTCOLUMN)lpColTemp->lpObject;
    lstrcpy((LPTSTR)lpCommentCol->szColumnName,(LPCTSTR)(LPUCHAR)lstbl->szColumn);
    lpCommentCol->lpszComment = NULL;
    ls=(LPOBJECTLIST)ls->lpNext;
  }

  if (lpObjCol)
    iret = VDBAGetCommentInfo ( (LPTSTR)(LPUCHAR)GetVirtNodeName(nNodeHandle),
                                (LPTSTR)tableparams.DBName, (LPTSTR)tableparams.objectname,
                                (LPTSTR)tableparams.szSchema, &lpObjComment, lpObjCol);
  else
    ASSERT (FALSE);

  // update member variables, for display/load/save purpose

  // list of columns
  m_Data.m_uaColumns.RemoveAll();
  ls = tableparams.lpColumns;
  ASSERT (ls);    // No columns is unacceptable
  while (ls) {
    LPCOLUMNPARAMS lpCol = (LPCOLUMNPARAMS)ls->lpObject;
    ASSERT (lpCol);

    // Column name
    CString csName = lpCol->szColumn;

    // Format "column type"
    CString csType = "";
    if (lstrcmpi(lpCol->tchszInternalDataType, lpCol->tchszDataType) != 0)  {
      ASSERT (lpCol->tchszInternalDataType[0]);
      csType = lpCol->tchszInternalDataType;  // UDTs
      if (lstrcmpi(lpCol->tchszInternalDataType,VDBA_MfcResourceString(IDS_OBJECT_KEY)) == 0 ||
          lstrcmpi(lpCol->tchszInternalDataType,VDBA_MfcResourceString(IDS_TABLE_KEY) ) == 0) {
          if (lpCol->bSystemMaintained)
              csType += VDBA_MfcResourceString(IDS_SYSTEM_MAINTAINED);
          else
              csType += VDBA_MfcResourceString(IDS_NO_SYSTEM_MAINTAINED);
      }
    }
    else {
      LPUCHAR lpType;
      lpType = GetColTypeStr(lpCol);
      if (lpType) {
        csType = lpType;
        ESL_FreeMem(lpType);
      }
      else {
        // Unknown type: put type name "as is" - length will not be displayed
        csType = lpCol->tchszDataType;
	  }
    }

    // Format "default specification"
    CString csDefSpec = "";
    if (lpCol->lpszDefSpec)
      csDefSpec = lpCol->lpszDefSpec;

    // Format "Comment"
    CString csTblComment = "";
    LPOBJECTLIST LsObj = lpObjCol;
    LPCOMMENTCOLUMN lpCommentCol;

    while (LsObj)
    {
      lpCommentCol = (LPCOMMENTCOLUMN)LsObj->lpObject;
      if (strcmp((LPTSTR)lpCommentCol->szColumnName,(LPTSTR)lpCol->szColumn) == 0)
      {
        if (iret!=RES_SUCCESS && !lpCommentCol->lpszComment)
          csTblComment.LoadString(IDS_NOT_AVAILABLE);
        else
        {
            if (lpCommentCol->lpszComment)
              csTblComment = lpCommentCol->lpszComment;
        }
      }
      LsObj = (LPOBJECTLIST)LsObj->lpNext;
    }

    // item on the stack
    CuTblColumn tblColumn(csName,             // LPCTSTR name,
                          csType,             // LPCTSTR type, ??? Code complexe
                          lpCol->nKeySequence,// int primKeyRank,
                          lpCol->bNullable,   // BOOL bNullable,
                          lpCol->bDefault,    // BOOL bWithDefault,
                          csDefSpec,          // LPCTSTR defSpec
                          csTblComment );     // LPCTSTR comment on column
    CuMultFlag *pRefCol = m_Data.m_uaColumns.Find(&tblColumn);
    ASSERT (!pRefCol);
    m_Data.m_uaColumns.Add(tblColumn);

    // Loop on next column
    ls = (LPOBJECTLIST)ls->lpNext;
  }

  // liberate detail structure
  FreeAttachedPointers (&tableparams,  OT_TABLE);
  // liberate column comment
  ls = lpObjCol;
  while (ls)
  {
    lpCommentCol = (LPCOMMENTCOLUMN)ls->lpObject;
    if (lpCommentCol->lpszComment)
      ESL_FreeMem (lpCommentCol->lpszComment);
    ls = (LPOBJECTLIST)ls->lpNext;
  }
  FreeObjectList(lpObjCol);
  if (lpObjComment)
    ESL_FreeMem (lpObjComment);
  // Refresh display
  RefreshDisplay();

  return 0L;
}