Example #1
0
void wgt_base::synchro_depended_init_slot()
{
	try {
		if (robot->state.edp.pid != -1) {
			if (robot->state.edp.is_synchronised) // Czy robot jest zsynchronizowany?
				synchro_depended_widgets_disable(false);
			else
				synchro_depended_widgets_disable(true); // Wygaszanie elementow przy niezsynchronizowanym robocie
		}
	}
	CATCH_SECTION_UI_PTR
}
Example #2
0
void wgt_bird_hand_command::init()
{
	try {

		mrrocpp::lib::bird_hand::status &bhsrs = robot.ui_ecp_robot->bird_hand_status_reply_data_request_port->data;

	    joint_status.append(&bhsrs.thumb_f[0]);
	    joint_status.append(&bhsrs.thumb_f[1]);
	    joint_status.append(&bhsrs.index_f[0]);
	    joint_status.append(&bhsrs.index_f[1]);
	    joint_status.append(&bhsrs.index_f[2]);
	    joint_status.append(&bhsrs.ring_f[0]);
	    joint_status.append(&bhsrs.ring_f[1]);
	    joint_status.append(&bhsrs.ring_f[2]);

	    mrrocpp::lib::bird_hand::command &bhcs = robot.ui_ecp_robot->bird_hand_command_data_port->data;

	    joint_command.append(&bhcs.thumb_f[0]);
	    joint_command.append(&bhcs.thumb_f[1]);
	    joint_command.append(&bhcs.index_f[0]);
	    joint_command.append(&bhcs.index_f[1]);
	    joint_command.append(&bhcs.index_f[2]);
	    joint_command.append(&bhcs.ring_f[0]);
	    joint_command.append(&bhcs.ring_f[1]);
	    joint_command.append(&bhcs.ring_f[2]);

		if (robot.state.edp.pid != -1) {
			if (robot.state.edp.is_synchronised) // Czy robot jest zsynchronizowany?
			{
				synchro_depended_widgets_disable(false);

//				robot.ui_ecp_robot-> ;// co tutaj ma być?

				for (int i = 0; i < robot.number_of_servos; i++) {
					doubleSpinBox_curpos_Vector[i]->setValue(joint_status[i]->meassured_position);

				}

			} else {
				// Wygaszanie elementow przy niezsynchronizowanym robocie
				synchro_depended_widgets_disable(true);

			}
		}

	} // end try
	CATCH_SECTION_UI


}
Example #3
0
void wgt_irp6_m_motors::synchro_depended_init_slot()
{

	try {

		if (robot.state.edp.pid != -1) {
			if (robot.state.edp.is_synchronised) // Czy robot jest zsynchronizowany?
			{
				synchro_depended_widgets_disable(false);

			} else {
				// Wygaszanie elementow przy niezsynchronizowanym robocie
				synchro_depended_widgets_disable(true);
			}
		}

	} // end try
	CATCH_SECTION_UI
}
Example #4
0
int wgt_spkm_inc::copy()
{

	if (robot->state.edp.pid != -1) {
		if (robot->state.edp.is_synchronised) // Czy robot jest zsynchronizowany?
		{
			synchro_depended_widgets_disable(false);

			for (int i = 0; i < robot->number_of_servos; i++) {
				doubleSpinBox_des_Vector[i]->setValue(doubleSpinBox_cur_Vector[i]->value());
			}
		} else {
			// Wygaszanie elementow przy niezsynchronizowanym robocie
			synchro_depended_widgets_disable(true);
		}

	}

	return 1;
}
void wgt_irp6_m_relative_angle_axis::init()
{
	try {

		if (robot->state.edp.pid != -1) {
			if (robot->state.edp.is_synchronised) // Czy robot jest zsynchronizowany?
			{
				synchro_depended_widgets_disable(false);

				//robot->ui_ecp_robot->read_xyz_angle_axis(robot->current_pos);

				for (int i = 0; i < angle_axis_number; i++) {
					desired_pos_spin_boxes[i]->setValue(0.0);
					robot->desired_pos[i] = robot->current_pos[i];
				}

			} else {
				// Wygaszanie elementow przy niezsynchronizowanym robocie
				synchro_depended_widgets_disable(true);
			}
		}
	} // end try
	CATCH_SECTION_UI_PTR
}
void wgt_single_motor_move::init_mr()
{

	try {

		if (robot->state.edp.pid != -1) {
			if (robot->state.edp.is_synchronised) // Czy robot jest zsynchronizowany?
			{
				synchro_depended_widgets_disable(false);

				robot->ui_ecp_robot->read_motors(robot->current_pos); // Odczyt polozenia walow silnikow
				ui.doubleSpinBox_cur_mr->setValue(robot->current_pos[0]);

				robot->desired_pos[0] = robot->current_pos[0];

			} else {
				// Wygaszanie elementow przy niezsynchronizowanym robocie
				synchro_depended_widgets_disable(true);
			}
		}

	} // end try
	CATCH_SECTION_UI_PTR
}
Example #7
0
void wgt_smb_command::init()
{
	interface.ui_msg->message("init");

	try {

		if (robot->state.edp.pid != -1) {
			if (robot->state.edp.is_synchronised) // Czy robot jest zsynchronizowany?
			{
				synchro_depended_widgets_disable(false);
				if (ui.radioButton_m_motor->isChecked()) {
					robot->ui_ecp_robot->the_robot->epos_motor_reply_data_request_port.set_request();
				} else if (ui.radioButton_m_joint->isChecked()) {
					robot->ui_ecp_robot->the_robot->epos_joint_reply_data_request_port.set_request();
				} else if (ui.radioButton_m_ext->isChecked()) {
					robot->ui_ecp_robot->the_robot->epos_external_reply_data_request_port.set_request();
				}
				robot->ui_ecp_robot->the_robot->smb_multi_leg_reply_data_request_port.set_request();
				robot->ui_ecp_robot->execute_motion();
				robot->ui_ecp_robot->the_robot->smb_multi_leg_reply_data_request_port.get();
				lib::epos::epos_reply *er;
				lib::smb::smb_ext_epos_reply *ser;

				if (ui.radioButton_m_motor->isChecked()) {

					robot->ui_ecp_robot->the_robot->epos_motor_reply_data_request_port.get();
					er = &robot->ui_ecp_robot->the_robot->epos_motor_reply_data_request_port.data;
				} else if (ui.radioButton_m_joint->isChecked()) {
					robot->ui_ecp_robot->the_robot->epos_joint_reply_data_request_port.get();
					er = &robot->ui_ecp_robot->the_robot->epos_joint_reply_data_request_port.data;
				} else if (ui.radioButton_m_ext->isChecked()) {
					robot->ui_ecp_robot->the_robot->epos_external_reply_data_request_port.get();
					ser = &robot->ui_ecp_robot->the_robot->epos_external_reply_data_request_port.data;
				}

				// sets leg state

				lib::smb::multi_leg_reply_td &mlr =
						robot->ui_ecp_robot->the_robot->smb_multi_leg_reply_data_request_port.data;

				for (int i = 0; i < lib::smb::LEG_CLAMP_NUMBER; i++) {
					checkBox_fl_in_Vector[i]->setChecked(mlr.leg[i].is_in);
					checkBox_fl_out_Vector[i]->setChecked(mlr.leg[i].is_out);
					checkBox_fl_attached_Vector[i]->setChecked(mlr.leg[i].is_attached);
				}

				if (ui.radioButton_m_motor->isChecked()) {
					for (int i = 0; i < lib::smb::NUM_OF_SERVOS; i++) {
						checkBox_m_mip_Vector[i]->setChecked(er->epos_controller[i].motion_in_progress);
						doubleSpinBox_m_current_position_Vector[i]->setValue(er->epos_controller[i].position);
					}
				} else if (ui.radioButton_m_joint->isChecked()) {
					for (int i = 0; i < lib::smb::NUM_OF_SERVOS; i++) {
						checkBox_m_mip_Vector[i]->setChecked(er->epos_controller[i].motion_in_progress);
						doubleSpinBox_m_current_position_Vector[i]->setValue(er->epos_controller[i].position);
					}
				} else if (ui.radioButton_m_ext->isChecked()) {
					for (int i = 0; i < lib::smb::NUM_OF_SERVOS; i++) {
						checkBox_m_mip_Vector[i]->setChecked(ser->epos_controller[i].motion_in_progress);
						doubleSpinBox_m_current_position_Vector[i]->setValue(ser->epos_controller[i].position);
					}
				}

			} else {
				// Wygaszanie elementow przy niezsynchronizowanym robocie
				synchro_depended_widgets_disable(true);
			}
		}

	} // end try
	CATCH_SECTION_UI_PTR
}
Example #8
0
void wgt_shead_command::init()
{
	interface.ui_msg->message("init");

	try {

		if (robot->state.edp.pid != -1) {
			if (robot->state.edp.is_synchronised) // Czy robot jest zsynchronizowany?
			{

				synchro_depended_widgets_disable(false);
				if (ui.radioButton_m_motor->isChecked()) {
					robot->ui_ecp_robot->the_robot->epos_motor_reply_data_request_port.set_request();
				} else if (ui.radioButton_m_joint->isChecked()) {
					robot->ui_ecp_robot->the_robot->epos_joint_reply_data_request_port.set_request();
				}

				robot->ui_ecp_robot->the_robot->shead_reply_data_request_port.set_request();
				robot->ui_ecp_robot->execute_motion();
				robot->ui_ecp_robot->the_robot->shead_reply_data_request_port.get();

				lib::epos::epos_reply *er;

				if (ui.radioButton_m_motor->isChecked()) {
					robot->ui_ecp_robot->the_robot->epos_motor_reply_data_request_port.get();
					er = &robot->ui_ecp_robot->the_robot->epos_motor_reply_data_request_port.data;
				} else if (ui.radioButton_m_joint->isChecked()) {
					robot->ui_ecp_robot->the_robot->epos_joint_reply_data_request_port.get();
					er = &robot->ui_ecp_robot->the_robot->epos_joint_reply_data_request_port.data;
				}

				lib::shead::reply &rep = robot->ui_ecp_robot->the_robot->shead_reply_data_request_port.data;

				// sets soldification state
				switch (rep.solidification_state)
				{
					case lib::shead::SOLIDIFICATION_STATE_ON:
						ui.checkBox_sol_on->setChecked(true);
						ui.checkBox_sol_off->setChecked(false);
						ui.checkBox_sol_int->setChecked(false);
						break;
					case lib::shead::SOLIDIFICATION_STATE_OFF:
						ui.checkBox_sol_on->setChecked(false);
						ui.checkBox_sol_off->setChecked(true);
						ui.checkBox_sol_int->setChecked(false);
						break;
					case lib::shead::SOLIDIFICATION_STATE_INTERMEDIATE:
						ui.checkBox_sol_on->setChecked(false);
						ui.checkBox_sol_off->setChecked(false);
						ui.checkBox_sol_int->setChecked(true);
						break;
					default:
						break;
				}

				// sets vacumization state
				switch (rep.vacuum_state)
				{
					case lib::shead::VACUUM_STATE_ON:
						ui.checkBox_vac_on->setChecked(true);
						ui.checkBox_vac_off->setChecked(false);
						ui.checkBox_vac_int->setChecked(false);
						break;
					case lib::shead::VACUUM_STATE_OFF:
						ui.checkBox_vac_on->setChecked(false);
						ui.checkBox_vac_off->setChecked(true);
						ui.checkBox_vac_int->setChecked(false);
						break;
					case lib::shead::VACUUM_STATE_INTERMEDIATE:
						ui.checkBox_vac_on->setChecked(false);
						ui.checkBox_vac_off->setChecked(false);
						ui.checkBox_vac_int->setChecked(true);
						break;
					default:
						break;
				}

				for (int i = 0; i < lib::shead::NUM_OF_SERVOS; i++) {
					checkBox_m_mip_Vector[i]->setChecked(er->epos_controller[i].motion_in_progress);
					doubleSpinBox_m_current_position_Vector[i]->setValue(er->epos_controller[i].position);
				}

			} else {
				// Wygaszanie elementow przy niezsynchronizowanym robocie
				synchro_depended_widgets_disable(true);
			}
		}

	} // end try
	CATCH_SECTION_UI_PTR
}