src/libYARP_dev/galil/winnt/yarp/YARPGalilDeviceDriver.cpp
int YARPGalilDeviceDriver::check_motion_done(void *flag)
{
	long rc = 0;

	bool *tmp = (bool *)flag;
	*tmp = true;
	bool subflag = false;

	for (int i = 0; i < m_njoints; i++)
	{
		rc = check_motion_done(&subflag,i);
		*tmp = *tmp && subflag;
	}

	return rc;
/*

	long rc = 0;

	bool *tmp = (bool *) flag;
	
	char cmd[] = "MG _BGABCDEFGH";
	char *buff = m_buffer_out;

	memcpy(buff, cmd, sizeof(cmd)-1);
	buff+=(sizeof(cmd)-1);

	// close command
	buff = _append_cmd('\0', buff);
	
	rc = DMCCommand((HANDLEDMC) m_handle,
					m_buffer_out,
					m_buffer_in, buff_length);

	if (atoi(m_buffer_in))
		*tmp = false;
	else	*tmp = true;
	//_ascii_to_binary(m_buffer_in, tmp);

	return rc;

*/
}
// FIX: This must be improved! The axes added to the _BG Operand should be variable
// Now I am checking all the axis in the control card. The axis that are not being used should return 
// "motion done" because no motion was ordered on them, therefore only the axis participating in a movement
// should contribute to the command. 
This must be improved. The axes added to the _BG Operand should be variable
Now I am checking all the axis in the control card. The axis that are not being used should return
"motion done" because no motion was ordered on them, therefore only the axis participating in a movement
should contribute to the command.
This must be improved . The axes added to the _BG Operand should be variable Now I am checking all the axis in the control card . The axis that are not being used should return " motion done " because no motion was ordered on them therefore only the axis participating in a movement should contribute to the command .
int YARPGalilDeviceDriver::check_motion_done(void *flag)
{
	long rc = 0;
	bool *tmp = (bool *)flag;
	*tmp = true;
	bool subflag = false;
	for (int i = 0; i < m_njoints; i++)
	{
		rc = check_motion_done(&subflag,i);
		*tmp = *tmp && subflag;
	}
	return rc;
}
int YARPGalilDeviceDriver :: check_motion_done ( void * flag ) { long rc = 0 ; bool * tmp = ( bool * ) flag ; * tmp = true ; bool subflag = false ; for ( int i = 0 ; i < m_njoints ; i ++ ) { rc = check_motion_done ( & subflag , i ) ; * tmp = * tmp && subflag ; } return rc ; }
FIX: This must be improved!
FIX : This must be improved!
/*

	long rc = 0;

	bool *tmp = (bool *) flag;
	
	char cmd[] = "MG _BGABCDEFGH";
	char *buff = m_buffer_out;

	memcpy(buff, cmd, sizeof(cmd)-1);
	buff+=(sizeof(cmd)-1);

	// close command
	buff = _append_cmd('\0', buff);
	
	rc = DMCCommand((HANDLEDMC) m_handle,
					m_buffer_out,
					m_buffer_in, buff_length);

	if (atoi(m_buffer_in))
		*tmp = false;
	else	*tmp = true;
	//_ascii_to_binary(m_buffer_in, tmp);

	return rc;

*/