Esempio n. 1
0
 private void BUTTON_HOME_Click(object sender, EventArgs e)
 {
     // Homing of all three axes
     m_samlight.ScSetLongValue((int)ScComSAMLightClientCtrlValueTypes.scComSAMLightClientCtrlLongValueTypeMotionWaitForEnd, 0);
     m_samlight.ScSetLongValue(( int )ScComSAMLightClientCtrlValueTypes.scComSAMLightClientCtrlLongValueTypeMotionAxis, -1);
     m_samlight.ScExecCommand((int)ScComSAMLightClientCtrlExecCommandConstants.scComSAMLightClientCtrlExecCommandMotionHome);
 }
Esempio n. 2
0
        public void ShowRedPointer()
        {
            if (axScSamlightClientCtrl1.ScIsRunning() == 0)
            {
                MessageBox.Show(MultiLanguage.GeSamlightNotFoundString(), MultiLanguage.GeSamlightWarningString(), MessageBoxButtons.OK);
                //MessageBox.Show("SAMLight not found", "Warning", MessageBoxButtons.OK);
                return;
            }
            axScSamlightClientCtrl1.ScSetLongValue((int)65, 2);

            axScSamlightClientCtrl1.ScExecCommand(( int )SAMLIGHT_CLIENT_CTRL_OCXLib.ScComSAMLightClientCtrlExecCommandConstants.scComSAMLightClientCtrlExecCommandRedPointerStart);            
            //axScSamlightClientCtrl1.ScExecCommand( ( int )SAMLIGHT_CLIENT_CTRL_OCXLib.ScComSAMLightClientCtrlExecCommandConstants.scComSAMLightClientCtrlExecCommandRedPointerStop ); 
            //axScSamlightClientCtrl1.ScExecCommand( ( int )SAMLIGHT_CLIENT_CTRL_OCXLib.ScComSAMLightClientCtrlExecCommandConstants.scComSAMLightClientCtrlExecCommandCloseMarkDialog );
            ////scComSAMLightClientCtrlLongValueTypeRedpointerMode
                isRedPointerShown = true;
        }
Esempio n. 3
0
 private void BUTTON_NEW_JOB_Click(object sender, EventArgs e)
 {
     if (m_samlight.ScIsRunning() == 0)
     {
         MessageBox.Show("SAMLight not found", "Warning", MessageBoxButtons.OK);
         return;
     }
     m_samlight.ScExecCommand(3);
 }
Esempio n. 4
0
        private void BUTTON_OPTIMIZE_PERFORMANCE_Click(object sender, EventArgs e)
        {
            //Generate one string 'all_entity_names' with all entity names separated by ";"
            //and generate one string 'all_entity_texts' with all entity textes separated by "\v"

            // Load job

            m_samlight.ScLoadJob(EDIT_JOB_PATH.Text, 1, 0, 0);

            string all_entity_names = "barcode1";
            string all_entity_texts = "This is the text of barcode 1";

            string temp;

            for (int i = 2; i <= 20; i++)
            {
                temp              = String.Format(";barcode{0}", i);
                all_entity_names += temp;
                temp              = String.Format("\vThis is the text of barcode{0}", i);
                all_entity_texts += temp;
            }

            //enable entity name separated by semicolon mode
            //disable View2D
            //enable top level entities only

            m_samlight.ScSetMode(( int )ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlModeFlagEntityNamesSeparatedBySemicolon |
                                 ( int )ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlModeFlagDontUpdateView |
                                 ( int )ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlModeFlagTopLevelOnly);

            //change all texts of all entities
            m_samlight.ScChangeTextByName(all_entity_names, all_entity_texts);

            //enable Hatching1 and Hatching2 for all entities, suppress entity update after enabling Hatching 1
            //so the entities will be updated after the enabling of Hatching 2 (second call)
            m_samlight.ScSetEntityLongData(all_entity_names,
                                           ( int )ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlLongDataIdEnableHatching1 |
                                           ( int )ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlDoubleDataIdFlagDontUpdateEntity, 1);

            m_samlight.ScSetEntityLongData(all_entity_names,
                                           ( int )ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlLongDataIdEnableHatching2, 6);

            //reset ScSetMode
            m_samlight.ScSetMode(0);

            //manually update View2D
            m_samlight.ScExecCommand(( int )ScComSAMLightClientCtrlExecCommandConstants.scComSAMLightClientCtrlExecCommandUpdateViewNow);
        }