private void BUTTON_GET_HOME_POS_Click(object sender, EventArgs e) { if (m_samlight.ScIsRunning() == 0) { MessageBox.Show("SAMLight not found", "Warning", MessageBoxButtons.OK); return; } EDIT_HOME_POS_X.Text = Convert.ToString(m_samlight.ScGetDoubleValue(( int )ScComSAMLightClientCtrlValueTypes.scComSAMLightClientCtrlDoubleValueTypeHomePosX), CultureInfo.InvariantCulture); EDIT_HOME_POS_Y.Text = Convert.ToString(m_samlight.ScGetDoubleValue(( int )ScComSAMLightClientCtrlValueTypes.scComSAMLightClientCtrlDoubleValueTypeHomePosY), CultureInfo.InvariantCulture); EDIT_HOME_POS_Z.Text = Convert.ToString(m_samlight.ScGetDoubleValue(( int )ScComSAMLightClientCtrlValueTypes.scComSAMLightClientCtrlDoubleValueTypeHomePosZ), CultureInfo.InvariantCulture); }
private void BUTTON_SAVE_JOB_Click(object sender, EventArgs e) { if (m_samlight.ScIsRunning() == 0) { MessageBox.Show("SAMLight not found", "Warning", MessageBoxButtons.OK); return; } int flags = 1; m_samlight.ScSaveJob(EDIT_JOB_FILE_NAME.Text, flags); }
private void BUTTON_CHANGE_TEXT_BY_NAME_Click(object sender, EventArgs e) { if (m_samlight.ScIsRunning() == 0) { MessageBox.Show("SAMLight not found", "Warning", MessageBoxButtons.OK); return; } m_samlight.ScChangeTextByName(EDIT_ENTITY_NAME.Text, EDIT_TEXT_STRING.Text); }
//private void BUTTON_CHANGE_TEXT_BY_NAME_Click(object sender, EventArgs e) //{ //} private void BUTTON_CHANGE_TEXT_BY_NAME_Click(object sender, EventArgs e) { if (m_samlight.ScIsRunning() == 0) { MessageBox.Show("SAMLight not found", "Warning", MessageBoxButtons.OK); return; } EDIT_TEXT_STRING.Text = (Convert.ToInt64(EDIT_TEXT_STRING.Text) + 1).ToString(); EDIT_TEXT_STRING.Text = EDIT_TEXT_STRING.Text.PadLeft(5, '0'); m_samlight.ScChangeTextByName(EDIT_ENTITY_NAME.Text, EDIT_TEXT_STRING.Text); HeatCodeEdit.Text = HeatCodeEdit.Text.PadLeft(4, '0'); m_samlight.ScChangeTextByName(HeatCodeText.Text, HeatCodeEdit.Text); if (Application.MessageLoop) { // WinForms app Application.Exit(); } }
private void BUTTON_GET_LAST_MARK_TIME_Click(object sender, EventArgs e) { if (m_samlight.ScIsRunning() == 0) { MessageBox.Show("SAMLight not found", "Warning", MessageBoxButtons.OK); return; } double mark_time = 0.0; mark_time = m_samlight.ScGetDoubleValue(( int )ScComSAMLightClientCtrlValueTypes.scComSAMLightClientCtrlDoubleValueTypeLastMarkTime); String mark_time_string = String.Concat("Last mark time was: ", mark_time, " seconds"); MessageBox.Show(mark_time_string, "Info", MessageBoxButtons.OK); }
private void BUTTON_GET_BITMAP_INTENSITY_Click(object sender, EventArgs e) { if (m_samlight.ScIsRunning() == 0) { MessageBox.Show("SAMLight not found", "Warning", MessageBoxButtons.OK); return; } double m_bitmap_intensity = Convert.ToDouble(EDIT_BITMAP_INTENSITY.Text, CultureInfo.InvariantCulture); m_samlight.ScGetEntityDoubleData(EDIT_ENTITY_NAME.Text, ( int )ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlDoubleDataIdBitmapIntensity, ref m_bitmap_intensity); EDIT_BITMAP_INTENSITY.Text = Convert.ToString(m_bitmap_intensity, CultureInfo.InvariantCulture); }
private void BUTTON_GET_OUTLINE_Click(object sender, EventArgs e) { if (m_samlight.ScIsRunning() == 0) { MessageBox.Show("SAMLight not found", "Warning", MessageBoxButtons.OK); return; } // here we calc the outline EDIT_OUTLINE_MIN_X.Text = Convert.ToString(m_samlight.ScGetEntityOutline(EDIT_ENTITY_NAME.Text, 0), CultureInfo.InvariantCulture); EDIT_OUTLINE_MIN_Y.Text = Convert.ToString(m_samlight.ScGetEntityOutline(EDIT_ENTITY_NAME.Text, 1), CultureInfo.InvariantCulture); EDIT_OUTLINE_MIN_Z.Text = Convert.ToString(m_samlight.ScGetEntityOutline(EDIT_ENTITY_NAME.Text, 2), CultureInfo.InvariantCulture); EDIT_OUTLINE_MAX_X.Text = Convert.ToString(m_samlight.ScGetEntityOutline(EDIT_ENTITY_NAME.Text, 3), CultureInfo.InvariantCulture); EDIT_OUTLINE_MAX_Y.Text = Convert.ToString(m_samlight.ScGetEntityOutline(EDIT_ENTITY_NAME.Text, 4), CultureInfo.InvariantCulture); EDIT_OUTLINE_MAX_Z.Text = Convert.ToString(m_samlight.ScGetEntityOutline(EDIT_ENTITY_NAME.Text, 5), CultureInfo.InvariantCulture); }
private void BUTTON_GET_HATCH1_Click(object sender, EventArgs e) { double dbl = 0.0; if (m_samlight.ScIsRunning() == 0) { MessageBox.Show("SAMLight not found", "Warning", MessageBoxButtons.OK); return; } m_samlight.ScSetLongValue(( int )ScComSAMLightClientCtrlValueTypes.scComSAMLightClientCtrlLongValueTypeSelectHatchPair, m_current_pair); m_samlight.ScGetEntityDoubleData(EDIT_ENTITY_NAME.Text, ( int )ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlDoubleDataIdHatchAngle1, ref dbl); EDIT_HATCH_ANGLE1.Text = Convert.ToString(dbl, CultureInfo.InvariantCulture); m_samlight.ScGetEntityDoubleData(EDIT_ENTITY_NAME.Text, ( int )ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlDoubleDataIdHatchDistance1, ref dbl); EDIT_HATCH_DISTANCE1.Text = Convert.ToString(dbl, CultureInfo.InvariantCulture); }
public int mark_entity(String entity_name_to_mark) { if (axScSamlightClientCtrl1.ScIsRunning() == 0) { MessageBox.Show(MultiLanguage.GeSamlightNotFoundString(), MultiLanguage.GeSamlightWarningString(), MessageBoxButtons.OK); return(0); } Set_Output(3, true); long mark_flags = 0x4;//0x0; axScSamlightClientCtrl1.ScSetMarkFlags((int)mark_flags); axScSamlightClientCtrl1.ScMarkEntityByName(entity_name_to_mark, 0); int i = 0; while (true) { i++; Application.DoEvents(); if (i % 10 == 0) { if (axScSamlightClientCtrl1.ScIsMarking() == 0) { break; } } } axScSamlightClientCtrl1.ScStopMarking(); Set_Output(3, false); return(1); }