|
楼主 |
发表于 2009-5-14 20:36:43
|
显示全部楼层
回复: PR 261818 Load program attached to #239837 and PC-DMIS crashes (only in
case DIMENSION_COAXIALITY: // PR261818 - need to set up nominals on any datums at material condition
case DIMENSION_CONCENTRICITY:
case DIMENSION_PROFILE_SURFACE:
case DIMENSION_PROFILE_LINE:
case DIMENSION_TOTAL_RUNOUT:
case DIMENSION_CIRCULAR_RUNOUT:
// PR261818 - set the nominal diameter/length on the datum feature
void CPCDFeatCtrlFrm::SetDatumNominal(CPCDcommand * pStartCmd,int which,AXIS_INFO & axis_data,E_DIAM_ENUM size)
{
CPCDcommand * datum = NULL;
CPCDcommand * datum_constrained = NULL;
GetDatum(pStartCmd,which,datum,datum_constrained);
if( datum && datum->type() != CONST_SET )
{
double saveDatumNominal = 0.0;
BOOL bStatus = (E_DIAMETER == size) ?
SetDatumDiameter(datum,axis_data.Nominal(),&saveDatumNominal) : SetDatumLength(datum,axis_data.Nominal(),&saveDatumNominal);
axis_data.SaveFeatureNominal(saveDatumNominal);
}
if( datum_constrained && datum_constrained->type() != CONST_SET )
{
BOOL bStatus = (E_DIAMETER == size) ?
SetDatumDiameter(datum_constrained,axis_data.Nominal()) : SetDatumLength(datum_constrained,axis_data.Nominal());
}
}
// PR261818
void CPCDFeatCtrlFrm::GetDatum(CPCDcommand * pStartCmd,int which,CPCDcommand * &datum,CPCDcommand * &datum_constrained)
{
if( pStartCmd )
{
switch( pStartCmd->type() )
{
case DIMENSION_TRUE_START_POSITION:
{
switch(which)
{
case PRIMARY:
datum = ((CPCDtp_start_location*)pStartCmd)->m_datum1;
datum_constrained = ((CPCDtp_start_location*)pStartCmd)->m_datum1_constrained;
break;
case SECONDARY:
datum = ((CPCDtp_start_location*)pStartCmd)->m_datum2;
datum_constrained = ((CPCDtp_start_location*)pStartCmd)->m_datum2_constrained;
break;
case TERTIARY:
datum = ((CPCDtp_start_location*)pStartCmd)->m_datum3;
datum_constrained = ((CPCDtp_start_location*)pStartCmd)->m_datum3_constrained;
break;
}
}
break;
case DIMENSION_PERPENDICULARITY:
{
switch(which)
{
case PRIMARY:
datum = ((CPCDdim_perpendicularity*)pStartCmd)->m_pPrimary;
break;
case SECONDARY:
datum = ((CPCDdim_perpendicularity*)pStartCmd)->m_pSecondary;
break;
case TERTIARY:
datum = ((CPCDdim_perpendicularity*)pStartCmd)->m_pTertiary;
break;
}
}
break;
case DIMENSION_PARALLELISM:
{
switch(which)
{
case PRIMARY:
datum = ((CPCDdim_parallel*)pStartCmd)->m_pPrimary;
break;
case SECONDARY:
datum = ((CPCDdim_parallel*)pStartCmd)->m_pSecondary;
break;
case TERTIARY:
datum = ((CPCDdim_parallel*)pStartCmd)->m_pTertiary;
break;
}
}
break;
case DIMENSION_ANGULARITY:
{
switch(which)
{
case PRIMARY:
datum = ((CPCDdim_angularity*)pStartCmd)->m_pPrimary;
break;
case SECONDARY:
datum = ((CPCDdim_angularity*)pStartCmd)->m_pSecondary;
break;
case TERTIARY:
datum = ((CPCDdim_angularity*)pStartCmd)->m_pTertiary;
break;
}
}
break;
case DIMENSION_COAXIALITY:
{
switch(which)
{
case PRIMARY:
datum = ((CPCDdim_coaxiality*)pStartCmd)->m_pPrimary;
break;
case SECONDARY:
datum = ((CPCDdim_coaxiality*)pStartCmd)->m_pSecondary;
break;
case TERTIARY:
datum = ((CPCDdim_coaxiality*)pStartCmd)->m_pTertiary;
break;
}
}
break;
case DIMENSION_CONCENTRICITY:
{
switch(which)
{
case PRIMARY:
datum = ((CPCDdim_concentricity*)pStartCmd)->m_pPrimary;
break;
case SECONDARY:
datum = ((CPCDdim_concentricity*)pStartCmd)->m_pSecondary;
break;
case TERTIARY:
datum = ((CPCDdim_concentricity*)pStartCmd)->m_pTertiary;
break;
}
}
break;
case DIMENSION_PROFILE_SURFACE:
case DIMENSION_PROFILE_LINE:
{
switch(which)
{
case PRIMARY:
datum = ((CPCDdim_profile*)pStartCmd)->m_pPrimary;
break;
case SECONDARY:
datum = ((CPCDdim_profile*)pStartCmd)->m_pSecondary;
break;
case TERTIARY:
datum = ((CPCDdim_profile*)pStartCmd)->m_pTertiary;
break;
}
}
break;
case DIMENSION_TOTAL_RUNOUT:
case DIMENSION_CIRCULAR_RUNOUT:
{
switch(which)
{
case PRIMARY:
datum = ((CPCDdim_runout*)pStartCmd)->m_pPrimary;
break;
case SECONDARY:
datum = ((CPCDdim_runout*)pStartCmd)->m_pSecondary;
break;
case TERTIARY:
datum = ((CPCDdim_runout*)pStartCmd)->m_pTertiary;
break;
}
}
break;
}
}
} |
|