コード例 #1
0
 public PopupText()
 {
     App.Current.MainWindow.Opacity = 0.7;
     InitializeComponent();
     IDInput.Focus();
     IDInput.SelectAll();
 }
コード例 #2
0
 private void SearchPhraseClear_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     foreach (int index in IDInput.CheckedIndices)
     {
         IDInput.SetItemChecked(index, false);
     }
 }
コード例 #3
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            var xmlConfigFileName = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "syncAxis", "syncAXISConfig.xml");

            if (!File.Exists(xmlConfigFileName))
            {
                MessageBox.Show($"XML configuration file is not founded : {xmlConfigFileName}");
                return;
            }

            #region SyncAxis 초기화
            bool success = true;
            var  rtc     = new Rtc6SyncAxis(0, xmlConfigFileName);
            rtc.Name = "SyncAxis";
            success &= rtc.Initialize(0, LaserMode.None, string.Empty);
            success &= rtc.CtlFrequency(50 * 1000, 2); // laser frequency : 50KHz, pulse width : 2usec
            success &= rtc.CtlSpeed(100, 100);         // default scanner jump and mark speed : 100mm/s

            //스테이지 이동시 기본 값 설정
            rtc.StageMoveSpeed   = 10;
            rtc.StageMoveTimeOut = 5;
            #endregion


            #region 레이저 소스 초기화
            var laser = new LaserVirtual(0, "virtual", 20);  // virtual laser source with max 20W power (최대 출력 20W 의 가상 레이저 소스 생성)
            //var laser = new IPGYLP(0, "IPG YLP", 1, 20);
            //var laser = new JPTTypeE(0, "JPT Type E", 1, 20);
            //var laser = new SPIG4(0, "SPI G3/4", 1, 20);
            //var laser = new PhotonicsIndustryDX(0, "PI", 1, 20);
            //var laser = new AdvancedOptoWaveFotia(0, "Fotia", 1, 20);
            //var laser = new CoherentAviaLX(0, "Avia LX", 1, 20);
            laser.Rtc = rtc;
            laser.Initialize();
            laser.CtlPower(2);
            #endregion


            #region 마커 지정
            var marker = new MarkerDefault(0, " SyncAxis Marker ");
            #endregion

            #region RTC 확장 IO
            this.RtcExt1DInput = new RtcDInput(rtc, 0, "DIN RTC EXT1");
            this.RtcExt1DInput.Initialize();
            this.RtcExt1DOutput = new RtcDOutputExt1(rtc, 0, "DOUT RTC EXT1");
            this.RtcExt1DOutput.Initialize();
            this.RtcExt2DOutput = new RtcDOutputExt2(rtc, 0, "DIN RTC EXT2");
            this.RtcExt2DOutput.Initialize();
            this.siriusEditorForm1.RtcExtension1Input  = this.RtcExt1DInput;
            this.siriusEditorForm1.RtcExtension1Output = this.RtcExt1DOutput;
            this.siriusEditorForm1.RtcExtension2Output = this.RtcExt2DOutput;
            #endregion

            this.Rtc = rtc;
            this.siriusEditorForm1.Rtc    = rtc;
            this.siriusEditorForm1.Laser  = laser;
            this.siriusEditorForm1.Marker = marker;
        }
コード例 #4
0
        private void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            HelixGenModel theModel = ((HelixGen.App)(App.Current)).Model;

            theModel.initializationProgress += TheModel_initializationProgress;

            // Show the version.

            Version thisVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;

            tbVersion.Text = string.Format("CopyRight To Helixgen,Version: {0}.{1}",
                                           thisVersion.Major.ToString(),
                                           thisVersion.Minor.ToString());

            // showMainPage();
            //AnalysPage = new AnalysePage(this);

            startupPage = new StartupPage(theModel);

            setUpPage   = new setUp(this);
            idInputPage = new IDInput(this);

            Loginpage = new loginPage(this);

            AnalysPage    = new AnalysePage(this);
            runResultPage = new RunResultPage(this);
            //_mainPage = new MainPage(this);

            NavFrame.Navigate(Loginpage);

            /*
             * StartupPage startupPage = new StartupPage(theModel);
             *
             * NavFrame.Navigate(startupPage);
             * Thread.Sleep(0);
             *
             * NavFrame.LoadCompleted += NavFrame_Startup_Navigated;
             */

#if false
            OpticsControlPage opticsPage = new OpticsControlPage();
            NavFrame.Navigate(opticsPage);

            opticsPage.Initialize();
#endif
#if false
            Thread.Sleep(10000);

            Task.Factory.StartNew(() => {
                Application.Current.Dispatcher.Invoke(
                    delegate { showMainPage(); }
                    );
            }
                                  );
#endif
        }
コード例 #5
0
        private void ArchiveLocationInput_TextChanged(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(ArchiveLocationInput.Text) && Directory.Exists(ArchiveLocationInput.Text))
            {
                // Specified directory is a valid one.
                try
                {
                    this.Cursor = Cursors.WaitCursor;

                    string[] matches = Directory.GetFiles(ArchiveLocationInput.Text, "*_archive.d");

                    if (matches.Length > 0)
                    {
                        // Open the active archive
                        m_archiveReader.Open(matches[0]);

                        MetadataRecord definition;
                        List <string>  previousSelection = new List <string>(ConfigurationFile.Current.Settings.General["Selection", true].ValueAs("").Split(','));

                        IDInput.Items.Clear();

                        for (int i = 1; i <= m_archiveReader.MetadataFile.RecordsOnDisk; i++)
                        {
                            definition = m_archiveReader.MetadataFile.Read(i);

                            if (definition.GeneralFlags.Enabled)
                            {
                                IDInput.Items.Add(new Metadata(definition));

                                if (previousSelection.Contains(definition.HistorianID.ToString()))
                                {
                                    IDInput.SetItemChecked(IDInput.Items.Count - 1, true);
                                }

                                Application.DoEvents();
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    ShowUpdateMessage("Error initializing application - {0}", ex.Message);
                }
                finally
                {
                    this.Cursor = Cursors.Default;
                }
            }
        }
コード例 #6
0
        private void MotionForm_Load(object sender, EventArgs e)
        {
            UpdateNames();

            var motorParameterFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "motion", "ajinmotorparameterfile.mot");

            MotorAjinExtek.LoadParameterFile(motorParameterFile);

            MotorZ = new MotorAjinExtek(0, "Z Axis");
            MotorZ.Initialize();

            DigitalInput = new AjinExtekDInput(0, "D.IN");
            //DigitalInput = new AdlinkDInput(0, "D.IN", 7230, 0);
            //DigitalInput = new RtcDInput(rtc, 0, "D.IN");
            DigitalInput.Initialize();

            DigitalOutput = new AjinExtekDOutput(0, "D.OUT");
            //DigitalOutput = new AdlinkDOutput(0, "D.OUT", 7230, 0);
            //DigitalOutput = new RtcDOutput(rtc, 0, "D.OUT");
            DigitalOutput.Initialize();

            timer.Enabled = true;
        }
コード例 #7
0
        private void SearchPhraseFind_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            try
            {
                // Search for points matching the search criteria.
                int      pointID;
                Metadata definition;
                string   searchPhrase = SearchPhraseInput.Text.ToLower();
                int.TryParse(searchPhrase, out pointID);

                this.Cursor = Cursors.WaitCursor;

                ShowUpdateMessage("Searching for points matching \"{0}\"...", searchPhrase);

                for (int i = 0; i < IDInput.Items.Count; i++)
                {
                    definition = (Metadata)IDInput.Items[i];
                    if (definition.PointID == pointID ||
                        definition.PointName.ToLower().Contains(searchPhrase) ||
                        definition.PointDescription.ToLower().Contains(searchPhrase))
                    {
                        IDInput.SetItemChecked(i, true);
                    }
                }

                ShowUpdateMessage("Found {0} point(s) matching \"{1}\".", IDInput.CheckedIndices.Count, searchPhrase);
            }
            catch (Exception ex)
            {
                ShowUpdateMessage("Error finding points - {0}", ex.Message);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
コード例 #8
0
 private void IDInputDialog_Load(object sender, EventArgs e)
 {
     IDInput.Select();
     IDInput.Select(0, IDInput.Text.Length);
 }
コード例 #9
0
        public MainForm()
        {
            InitializeComponent();

            this.FormClosing += MainForm_FormClosing;

            SpiralLab.Core.Initialize();
            // 신규 문서 생성
            var doc = new DocumentDefault();

            // 문서 지정
            siriusEditorForm1.Document = doc;

            if (!siriusEditorForm1.EnablePens)
            {
                // 기본 펜 생성후 문서에 추가
                var pen = new PenDefault();
                doc.Action.ActEntityAdd(pen);
            }

            // 내부 데이타(IDocument) 가 변경될경우 이를 이벤트 통지를 받는 핸들러 등록
            siriusEditorForm1.OnDocumentSourceChanged += SiriusEditorForm1_OnDocumentSourceChanged;

            #region RTC 초기화
            //var rtc = new RtcVirtual(0); //create Rtc for dummy
            var rtc = new Rtc5(0); //create Rtc5 controller
            //var rtc = new Rtc6(0); //create Rtc6 controller
            //var rtc = new Rtc6Ethernet(0, "192.168.0.100", "255.255.255.0"); //실험적인 상태 (Scanlab Rtc6 Ethernet 제어기)
            //var rtc = new Rtc6SyncAxis(0, Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "syncAxis", "syncAXISConfig.xml")); //실험적인 상태 (Scanlab XLSCAN 솔류션)

            float fov            = 60.0f;                            ///scanner field of view : 60mm
            float kfactor        = (float)Math.Pow(2, 20) / fov;     // k factor (bits/mm) = 2^20 / fov
            var   correctionFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "correction", "cor_1to1.ct5");
            rtc.Initialize(kfactor, LaserMode.Yag1, correctionFile); // 스캐너 보정 파일 지정 : correction file
            rtc.CtlFrequency(50 * 1000, 2);                          // laser frequency : 50KHz, pulse width : 2usec
            rtc.CtlSpeed(100, 100);                                  // default jump and mark speed : 100mm/s
            rtc.CtlDelay(10, 100, 200, 200, 0);                      // scanner and laser delays
            #endregion
            this.siriusEditorForm1.Rtc = rtc;

            #region 레이저 소스 초기화
            var laser = new LaserVirtual(0, "virtual", 20);  // virtual laser source with max 20W power (최대 출력 20W 의 가상 레이저 소스 생성)
            //var laser = new IPGYLP(0, "IPG YLP", 1, 20);
            //var laser = new JPTTypeE(0, "JPT Type E", 1, 20);
            //var laser = new SPIG4(0, "SPI G3/4", 1, 20);
            //var laser = new PhotonicsIndustryDX(0, "PI", 1, 20);
            //var laser = new AdvancedOptoWaveFotia(0, "Fotia", 1, 20);
            //var laser = new CoherentAviaLX(0, "Avia LX", 1, 20);
            laser.Rtc = rtc;
            laser.Initialize();
            laser.CtlPower(2);
            #endregion

            this.siriusEditorForm1.Laser = laser;

            #region 마커 지정
            var marker = new MarkerDefault(0);
            #endregion
            this.siriusEditorForm1.Marker = marker;

            #region RTC 확장 IO
            this.RtcExt1DInput = new RtcDInput(rtc, 0, "DIN RTC EXT1");
            this.RtcExt1DInput.Initialize();
            this.RtcExt1DOutput = new RtcDOutputExt1(rtc, 0, "DOUT RTC EXT1");
            this.RtcExt1DOutput.Initialize();
            this.RtcExt2DOutput = new RtcDOutputExt2(rtc, 0, "DIN RTC EXT2");
            this.RtcExt2DOutput.Initialize();
            this.siriusEditorForm1.RtcExtension1Input  = this.RtcExt1DInput;
            this.siriusEditorForm1.RtcExtension1Output = this.RtcExt1DOutput;
            this.siriusEditorForm1.RtcExtension2Output = this.RtcExt2DOutput;
            #endregion
        }