EgtMachKernel 1.6t1 :

- aggiunto a Disposizione flag di presenza movimenti manuali
- portata in interfaccia funzione per rimovere movimento finale in home da operazione.
This commit is contained in:
Dario Sassi
2016-08-05 18:40:59 +00:00
parent fec9890054
commit aaa94a79a0
23 changed files with 100 additions and 47 deletions
+20 -2
View File
@@ -43,6 +43,7 @@ static std::string DIS_MVD_FLAG = "MvF" ;
static std::string DIS_NUM = "NUM" ;
static std::string DIS_HEAD = "Head" ;
static std::string DIS_EXIT = "Exit" ;
static std::string DIS_SOMEBYHAND = "Sbh" ;
//----------------------------------------------------------------------------
USEROBJ_REGISTER( "EMkDisposition", Disposition) ;
@@ -71,6 +72,7 @@ Disposition::Clone( void) const
pDisp->m_sHead = m_sHead ;
pDisp->m_nExit = m_nExit ;
pDisp->m_nShifts = m_nShifts ;
pDisp->m_bSomeByHand = m_bSomeByHand ;
}
catch( ...) {
delete pDisp ;
@@ -116,6 +118,7 @@ Disposition::Dump( string& sOut, bool bMM, const char* szNewLine) const
sOut += "Num=" + ToString( m_nShifts) + szNewLine ;
sOut += "Head=" + m_sHead + szNewLine ;
sOut += "Exit=" + ToString( m_nExit) + szNewLine ;
sOut += "ByHand=" + ToString( m_bSomeByHand) + szNewLine ;
return true ;
}
@@ -129,7 +132,7 @@ Disposition::Save( STRVECTOR& vString) const
int nFxdLines = 1 + 3 * nFxdTot ;
int nMvdTot = int( m_vMvrData.size()) ;
int nMvdLines = 1 + 4 * nMvdTot ;
int nOther = 3 ;
int nOther = 4 ;
vString.insert( vString.begin(), 4 + nFxdLines + nMvdLines + nOther, "") ;
// Nome
if ( ! SetVal( DIS_TABLE, m_sTabName, vString[++k]))
@@ -169,6 +172,8 @@ Disposition::Save( STRVECTOR& vString) const
return false ;
if ( ! SetVal( DIS_EXIT, m_nExit, vString[++k]))
return false ;
if ( ! SetVal( DIS_SOMEBYHAND, m_bSomeByHand, vString[++k]))
return false ;
}
catch( ...) { return false ; }
return true ;
@@ -237,13 +242,17 @@ Disposition::Load( const STRVECTOR& vString, int nBaseGdbId)
if ( ! GetVal( vString[++k], DIS_EXIT, m_nExit))
return false ;
}
if ( k + 1 < int( vString.size())) {
if ( ! GetVal( vString[++k], DIS_SOMEBYHAND, m_bSomeByHand))
return false ;
}
return true ;
}
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
Disposition::Disposition( void)
: m_bTabOk( false), m_nExit( 0), m_nShifts( 0)
: m_bTabOk( false), m_nExit( 0), m_nShifts( 0), m_bSomeByHand( false)
{
}
@@ -836,6 +845,7 @@ Disposition::SpecialApply( bool bRecalc)
static const string EVAR_HEAD = ".HEAD" ; // OUT (string) nome della testa
static const string EVAR_EXIT = ".EXIT" ; // OUT (int) indice dell'uscita
static const string EVAR_SHIFTS = ".SHIFTS" ; // OUT (int) numero di movimenti eseguiti
static const string EVAR_SBH = ".SBH" ; // OUT (bool) flag presenza operazioni manuali
static const string ON_SPECIAL_APPLY = "OnSpecialApplyDisposition" ;
// eseguo l'azione
@@ -853,6 +863,7 @@ Disposition::SpecialApply( bool bRecalc)
bOk = bOk && pMch->LuaGetGlobVar( EMC_VAR + EVAR_HEAD, m_sHead) ;
bOk = bOk && pMch->LuaGetGlobVar( EMC_VAR + EVAR_EXIT, m_nExit) ;
bOk = bOk && pMch->LuaGetGlobVar( EMC_VAR + EVAR_SHIFTS, m_nShifts) ;
bOk = bOk && pMch->LuaGetGlobVar( EMC_VAR + EVAR_SBH, m_bSomeByHand) ;
bOk = bOk && pMch->LuaResetGlobVar( EMC_VAR) ;
// segnalo errori
if ( nErr != 0) {
@@ -912,3 +923,10 @@ Disposition::GetToolTcPos( void) const
static string sDummy = "" ;
return sDummy ;
}
//----------------------------------------------------------------------------
bool
Disposition:: NeedPrevHome( void) const
{
return ( IsEmpty() || m_bSomeByHand) ;
}