Пример #1
0
        private void InitDevice()
        {
            _Controller = new KM_Controller();

            _Controller.MessageReceived += new KMConsoleHandler(_Controller_MessageUpdated);
            _Controller.ErrorReceived   += new KMErrorHandler(_Controller_ErrorReceived);
            _Controller.CoordMotion.CoordMotionArcFeed                                += new KM_CoordMotionArcFeedHandler(Interpreter_Interpreter_CoordMotionArcFeed);
            _Controller.CoordMotion.CoordMotionStraightFeed                           += new KM_CoordMotionStraightFeedHandler(Interpreter_Interpreter_CoordMotionStraightFeed);
            _Controller.CoordMotion.CoordMotionStraightTraverse                       += new KM_CoordMotionStraightTraverseHandler(Interpreter_Interpreter_CoordMotionStraightTraverse);
            _Controller.CoordMotion.Interpreter.InterpreterCompleted                  += new KM_Interpreter.KM_GCodeInterpreterCompleteHandler(Interpreter_InterpreterCompleted);
            _Controller.CoordMotion.Interpreter.InterpreterStatusUpdated              += new KM_Interpreter.KM_GCodeInterpreterStatusHandler(Interpreter_InterpreterStatusUpdated);
            _Controller.CoordMotion.Interpreter.InterpreterUserCallbackRequested      += new KM_Interpreter.KM_GCodeInterpreterUserCallbackHandler(Interpreter_InterpreterUserCallbackRequested);
            _Controller.CoordMotion.Interpreter.InterpreterUserMCodeCallbackRequested += new KM_Interpreter.KM_GCodeInterpreterUserMcodeCallbackHandler(Interpreter_InterpreterUserMCodeCallbackRequested);



            var datafile = Path.Combine(_SystemPaths["AppData"], "InterpreterData.xml");

            if (!File.Exists(datafile))
            {
                InterpreterData data = new InterpreterData();
                InterpreterData.SaveXML(datafile, data);
                InterpreterDataFile = data;
            }
            else
            {
                InterpreterDataFile = InterpreterData.LoadXML(datafile);
            }
        }
Пример #2
0
        public Form1()
        {
            InitializeComponent();
            MainPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            MainPath = System.IO.Path.GetDirectoryName(MainPath);
            MainPath = System.IO.Path.GetDirectoryName(MainPath);

            CFileName.Text = MainPath + @"\PC VCS Examples\TeachMotion\Probedata.txt";
            KM = new KMotion_dotNet.KM_Controller();
            FFJoy = new ForceFeedbackJoystick();
            JoystickType = FFJoy.Connect(this);
        }
Пример #3
0
        public Form1()
        {
            InitializeComponent();
            MainPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            MainPath = System.IO.Path.GetDirectoryName(MainPath);
            MainPath = System.IO.Path.GetDirectoryName(MainPath);

            CFileName.Text = MainPath + @"\PC VCS Examples\TeachMotion\Probedata.txt";
            KM             = new KMotion_dotNet.KM_Controller();
            FFJoy          = new ForceFeedbackJoystick();
            JoystickType   = FFJoy.Connect(this);
        }
Пример #4
0
        public Form1()
        {
            InitializeComponent();
            MainPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            MainPath = System.IO.Path.GetDirectoryName(MainPath);
            MainPath = System.IO.Path.GetDirectoryName(MainPath);

            CFileName.Text = MainPath + "\\C Programs\\KStep\\InitKStep3Axis.c";
            KM             = new KMotion_dotNet.KM_Controller();

            //Set the callback for general messages
            KM.MessageReceived += new KMConsoleHandler(ConsoleMessageHandler);
        }
Пример #5
0
        public StageControl(String pathFile)
        {
            _KM = new KMotion_dotNet.KM_Controller();
            CompileAndLoadCoff(pathFile);

            _XAxis = _KM.GetAxis(0, "X");
            _YAxis = _KM.GetAxis(1, "Y");
            _ZAxis = _KM.GetAxis(2, "Z");

            _bReverseX = false;
            _bReverseY = false;
            _bReverseZ = false;
        }
Пример #6
0
        public Form1()
        {
            InitializeComponent();
            MainPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            MainPath = System.IO.Path.GetDirectoryName(MainPath);
            MainPath = System.IO.Path.GetDirectoryName(MainPath);

            CFileName.Text = MainPath + "\\C Programs\\KStep\\InitKStep3Axis.c";
            KM = new KMotion_dotNet.KM_Controller();

            //Set the callback for general messages
            KM.MessageReceived += new KMConsoleHandler(ConsoleMessageHandler);

        }
Пример #7
0
        public Form1()
        {
            InitializeComponent();

            MainPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            MainPath = System.IO.Path.GetDirectoryName(MainPath);
            MainPath = System.IO.Path.GetDirectoryName(MainPath);

            FiducialsName.Text   = MainPath + "\\PC VCS Examples\\MeasureFiducials\\FiducialLocations.txt";
            SettingsFile         = MainPath + "\\PC VCS Examples\\MeasureFiducials\\MeasureFiducialSettings.txt";
            MicroScopeOffsetFile = MainPath + "\\PC VCS Examples\\MeasureFiducials\\MicroscopeOffset.txt";
            KM = new KMotion_dotNet.KM_Controller();
            ReadSettings();
            ReadFiducials();

            ViewCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
        }
Пример #8
0
        public void initdevice()
        {
            Debug.WriteLine("Init Device");

            _Controller = new KMotion_dotNet.KM_Controller();


            _XAxis  = new KMotion_dotNet.KM_Axis(_Controller, 0, "x");
            _YAxis  = new KMotion_dotNet.KM_Axis(_Controller, 1, "y");
            _ZAxis  = new KMotion_dotNet.KM_Axis(_Controller, 2, "z");
            _AAxis  = new KMotion_dotNet.KM_Axis(_Controller, 3, "a");
            _BAxis  = new KMotion_dotNet.KM_Axis(_Controller, 4, "b");
            _CAxis  = new KMotion_dotNet.KM_Axis(_Controller, 5, "c");
            _Motion = new KMotion_dotNet.KM_CoordMotion(_Controller);

            AddHandlers();

            initdevicesettings();
        }
Пример #9
0
        public void initdevice(usbDevice _usb, AppSettings _settings)
        {
            settings = _settings;
            usb      = _usb;
            Debug.WriteLine("Init Device");
            _Controller = new KMotion_dotNet.KM_Controller();
            //  AddHandlers();


            if (_Controller.BoardID > 0)
            {
                initdevicesettings();
                backgroundWorkerSolderJob.DoWork                    += worker_DoWork;
                backgroundWorkerSolderJob.RunWorkerCompleted        += worker_RunWorkerCompleted;
                backgroundWorkerSolderJob.WorkerSupportsCancellation = true;
            }
            else
            {
                MessageBox.Show("Kflop not detected");
            }
        }
Пример #10
0
        public Form1()
        {
            InitializeComponent();

            MainPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            MainPath = System.IO.Path.GetDirectoryName(MainPath);
            MainPath = System.IO.Path.GetDirectoryName(MainPath);

            FiducialsName.Text = MainPath + "\\PC VCS Examples\\MeasureFiducials\\FiducialLocations.txt";
            SettingsFile = MainPath + "\\PC VCS Examples\\MeasureFiducials\\MeasureFiducialSettings.txt";
            MicroScopeOffsetFile = MainPath + "\\PC VCS Examples\\MeasureFiducials\\MicroscopeOffset.txt";
            KM = new KMotion_dotNet.KM_Controller();
            ReadSettings();
            ReadFiducials();

            ViewCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
        }
Пример #11
0
 /// <summary>
 /// Primary Construtor for IO object
 /// </summary>
 /// <param name="controller"></param>
 /// <param name="id">Bit Number</param>
 /// <param name="name">Call Name</param>
 /// <param name="iotype">Sets the IO direction</param>
 public KM_IO(KM_Controller controller, int id, string name, IO_TYPE iotype)
 {
     _Controller = controller;
     _ID = id;
     _Name = name;
     _IOType = iotype;
     UpdateIOType();
 }
Пример #12
0
 /// <summary>
 /// Associate KFLOP Axis Channel with Parameters
 /// </summary>
 public KM_Axis_TuningParams(KM_Controller controller, int id)
 {
     _Controller = controller;
     _ID = id;
 }
Пример #13
0
        public void initdevice(usbDevice _usb, AppSettings _settings)
        {
            settings = _settings;
            usb = _usb;
            Debug.WriteLine("Init Device");
            _Controller = new KMotion_dotNet.KM_Controller();
          //  AddHandlers();

            
               if (_Controller.BoardID > 0)
               {
                 
                  initdevicesettings();
                  backgroundWorkerSolderJob.DoWork += worker_DoWork;
                  backgroundWorkerSolderJob.RunWorkerCompleted += worker_RunWorkerCompleted;
                  backgroundWorkerSolderJob.WorkerSupportsCancellation = true;

                 

                 
               }
               else
               {
                   MessageBox.Show("Kflop not detected");
               }
        }
Пример #14
0
 /// <summary>
 /// Creates group of axes
 /// </summary>
 public KM_AxisGroup(KM_Controller controller, params KM_Axis[] axislist)
 {
     _Controller = controller;
     if (axislist != null)
     {
         for (int i = 0; i < axislist.Length; i++)
         {
             if (axislist[i] == null)
             {
                 _AxisList.Add(new KM_Axis(_Controller, -1, "not used"));
             }
             else
             {
                 _AxisList.Add(axislist[i]);
             }
         }
     }
 }
Пример #15
0
 /// <summary>
 /// Default constructor for the Axis Object
 /// </summary>
 /// <param name="controller"></param>
 /// <param name="id"></param>
 /// <param name="name"></param>
 public KM_Axis(KM_Controller controller, int id, string name)
 {
     _Controller = controller;
     _ID = id;
     _Name = name;
     _TuningParams = new KM_Axis_TuningParams(controller, id);
     _HomingParams = new KM_Axis_HomingParams();
     _HomingParams.DefaultThread = (id > 5) ? 1 : id;
     while (_HomingParams.DefaultThread < 1)
     {
         _HomingParams.DefaultThread++;
     }
 }
Пример #16
0
        public void initdevice()
        {
            Debug.WriteLine("Init Device");

            _Controller = new KMotion_dotNet.KM_Controller();


            _XAxis = new KMotion_dotNet.KM_Axis(_Controller, 0, "x");
            _YAxis = new KMotion_dotNet.KM_Axis(_Controller, 1, "y");
            _ZAxis = new KMotion_dotNet.KM_Axis(_Controller, 2, "z");
            _AAxis = new KMotion_dotNet.KM_Axis(_Controller, 3, "a");
            _BAxis = new KMotion_dotNet.KM_Axis(_Controller, 4, "b");
            _CAxis = new KMotion_dotNet.KM_Axis(_Controller, 5, "c");
            _Motion = new KMotion_dotNet.KM_CoordMotion(_Controller);

            AddHandlers();

            initdevicesettings();
        }
Пример #17
0
        private void InitDevice()
        {
            _Controller = new KM_Controller();

            _Controller.MessageReceived += new KMConsoleHandler(_Controller_MessageUpdated);
            _Controller.ErrorReceived += new KMErrorHandler(_Controller_ErrorReceived);
            _Controller.CoordMotion.CoordMotionArcFeed += new KM_CoordMotionArcFeedHandler(Interpreter_Interpreter_CoordMotionArcFeed);
            _Controller.CoordMotion.CoordMotionStraightFeed += new KM_CoordMotionStraightFeedHandler(Interpreter_Interpreter_CoordMotionStraightFeed);
            _Controller.CoordMotion.CoordMotionStraightTraverse += new KM_CoordMotionStraightTraverseHandler(Interpreter_Interpreter_CoordMotionStraightTraverse);
            _Controller.CoordMotion.Interpreter.InterpreterCompleted += new KM_Interpreter.KM_GCodeInterpreterCompleteHandler(Interpreter_InterpreterCompleted);
            _Controller.CoordMotion.Interpreter.InterpreterStatusUpdated += new KM_Interpreter.KM_GCodeInterpreterStatusHandler(Interpreter_InterpreterStatusUpdated);
            _Controller.CoordMotion.Interpreter.InterpreterUserCallbackRequested += new KM_Interpreter.KM_GCodeInterpreterUserCallbackHandler(Interpreter_InterpreterUserCallbackRequested);
            _Controller.CoordMotion.Interpreter.InterpreterUserMCodeCallbackRequested += new KM_Interpreter.KM_GCodeInterpreterUserMcodeCallbackHandler(Interpreter_InterpreterUserMCodeCallbackRequested);




            var datafile = Path.Combine(_SystemPaths["AppData"], "InterpreterData.xml");
            if (!File.Exists(datafile))
            {
                InterpreterData data = new InterpreterData();
                InterpreterData.SaveXML(datafile, data);
                InterpreterDataFile = data;
            }
            else
            {
                InterpreterDataFile = InterpreterData.LoadXML(datafile);
            }
        }
Пример #18
0
        /// <summary>
    /// Primary constructor for KM_CoordMotion object
        /// </summary>
    public KM_CoordMotion(KM_Controller controller)
        {
            try
            {
                _Controller = controller;
                KM_dotnet_Interop_CoordMotion_New(_Controller.InstanceHandle, ref _InstanceHandle);

                Abort();
                ClearAbort();
                SetStraightTraverseCallback();
                SetStraightFeedCallback();
                SetArcFeedCallback();
            }
            catch (DllNotFoundException e)
            {
                throw new DMException(this, e, String.Format("Dll Not Found Exception thrown :  Caller - [{0}] :: Member - [{1}]",
                    this.ToString(), "KM_CoordMotion"));
            }
            catch (EntryPointNotFoundException e)
            {
                throw new DMException(this, e, String.Format("Entry Point Not Found Exception thrown :  Caller - [{0}] :: Member - [{1}]",
                   this.ToString(), "KM_CoordMotion"));
            }
            catch (Exception e)
            {
                throw new DMException(this, e, String.Format("General Exception thrown :  Caller - [{0}] :: Member - [{1}]",
                  this.ToString(), "KM_CoordMotion"));
            }
        }