• 大小: 615KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-05-14
  • 语言: C#
  • 标签: 转台  C#  

资源简介

用C#编写的转台控制程序,可实现多个轴的循环运动

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MathWorks.MATLAB.NET.Arrays;
using System.Threading;
using System.IO;
using NetCtrl;
namespace Axis5
{
    public partial class MainForm : Form
    {
        public MainForm()
        {
            InitializeComponent();
            listBox1.Items.Add(“未连接“);
        }

        public int ChangeFileName(string srcRelativePath string desRelativePath)
        {
            try
            {
                if (File.Exists(srcRelativePath))
                {
                    File.Move(srcRelativePath desRelativePath);
                    return 1;
                }
                else
                    return 0;
            }
            catch
            {
                return 0;
            }
        }

        private void MainForm_FormClosing(object sender FormClosingEventArgs e)//窗体关闭时的加载的事件
        {
            timer1.Enabled = false;
            if (th != null)
                if (th.IsAlive)
                {
                    th.Abort();
                    th = null;
                }
            try
            {
                axMintController1.DoStop(0);//停止俯仰转台
                axMintController1.DoStop(1);//停止方位转台
                axMintController1.DoStop(2);//停止上平动组件运动
                axMintController1.DoStop(3);//停止下平动组件运动
                axMintController1.DoStop(4);//停止升降台运动
            }
            catch (Exception aa)
            {
            }
            Application.Exit();
        }

        #region 与MATLAB交互通信部分
        public float[] mess;///用于存放返回给matlab的值
        int FinishFlag = 1;
        public int Test()  //
        {
            {
                if (FinishFlag == 1)
                {
                    return 1;
                }
                else
                {
                    return -1;
                }
            }
        }
        public void ClearZero()
        {
            if (EndThreadFlag == true)//如果发送指令线程已结束就不再异步调用以下;
            {
                Delegate task = new Delegate(InvokeMethord);
                IAsyncResult testRecult = task.BeginInvoke(null null);
            }
        }
        float HRSpeed = -1 PRSpeed = -1 XRSpped = -1 YRSpeed = -1 ZRSPeed = -1;
        List MinSpeed = new List();
        public float ReturnSpeed()
        {
            float[] m = new float[5];
            if (HHP != null && HHP != “不运行“)
            {
                HRSpeed = Math.Abs(fAzimuthStep / fAzimuthSpeed);
            }
            if (PPP != null && PPP != “不运行“)
                PRSpeed = Math.Abs(fElevationStep / fElevationSpeed);
            if (XXP != null && XXP != “不运行“)
                XRSpped = Math.Abs(fXStep / fXSpeed);
            if (YYP != null && YYP != “不运行“)
    

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2014-12-02 16:49  Axis5Ctrl\
     目录           0  2014-12-01 23:47  Axis5Ctrl\Axis5\
     文件        3463  2014-12-02 17:16  Axis5Ctrl\Axis5Ctrl.sln
     文件       65536  2014-12-03 15:29  Axis5Ctrl\Axis5Ctrl.suo
     文件        5337  2014-12-01 23:48  Axis5Ctrl\Axis5\Axis5.csproj
     目录           0  2014-12-01 23:23  Axis5Ctrl\Axis5\bin\
     目录           0  2014-12-03 15:48  Axis5Ctrl\Axis5\bin\Debug\
     文件           0  2014-12-03 15:45  Axis5Ctrl\Axis5\bin\Debug\12.csv
     文件      264192  2014-12-01 23:34  Axis5Ctrl\Axis5\bin\Debug\AxInterop.MintControls5563Lib.dll
     文件       53248  2014-12-03 15:47  Axis5Ctrl\Axis5\bin\Debug\Axis5.exe
     文件       83456  2014-12-03 15:47  Axis5Ctrl\Axis5\bin\Debug\Axis5.pdb
     文件       11600  2014-12-03 15:48  Axis5Ctrl\Axis5\bin\Debug\Axis5.vshost.exe
     文件         490  2010-03-17 22:39  Axis5Ctrl\Axis5\bin\Debug\Axis5.vshost.exe.manifest
     文件      269824  2014-12-01 23:24  Axis5Ctrl\Axis5\bin\Debug\Interop.MintControls5563Lib.dll
     文件      114688  2011-12-29 13:46  Axis5Ctrl\Axis5\bin\Debug\MWArray.dll
     目录           0  2014-12-01 23:23  Axis5Ctrl\Axis5\bin\Release\
     文件       57292  2014-12-03 16:37  Axis5Ctrl\Axis5\MainForm.cs
     文件       72538  2014-12-03 15:47  Axis5Ctrl\Axis5\MainForm.Designer.cs
     文件        6889  2014-12-03 15:47  Axis5Ctrl\Axis5\MainForm.resx
     目录           0  2014-12-01 23:22  Axis5Ctrl\Axis5\obj\
     目录           0  2014-12-01 23:22  Axis5Ctrl\Axis5\obj\x86\
     目录           0  2014-12-03 15:47  Axis5Ctrl\Axis5\obj\x86\Debug\
     文件      264192  2014-12-01 23:34  Axis5Ctrl\Axis5\obj\x86\Debug\AxInterop.MintControls5563Lib.dll
     文件        1160  2014-12-03 16:29  Axis5Ctrl\Axis5\obj\x86\Debug\Axis5.csproj.FileListAbsolute.txt
     文件         786  2014-12-01 23:45  Axis5Ctrl\Axis5\obj\x86\Debug\Axis5.csproj.ResolveComReference.cache
     文件       53248  2014-12-03 15:47  Axis5Ctrl\Axis5\obj\x86\Debug\Axis5.exe
     文件         584  2014-12-03 15:47  Axis5Ctrl\Axis5\obj\x86\Debug\Axis5.MainForm.resources
     文件       83456  2014-12-03 15:47  Axis5Ctrl\Axis5\obj\x86\Debug\Axis5.pdb
     文件         180  2014-12-01 23:48  Axis5Ctrl\Axis5\obj\x86\Debug\Axis5.Properties.Resources.resources
     文件       12644  2014-12-01 23:34  Axis5Ctrl\Axis5\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
     文件        6667  2014-12-03 16:31  Axis5Ctrl\Axis5\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
............此处省略35个文件信息

评论

共有 条评论