Ejemplo n.º 1
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="portName">端口名</param>
 /// <param name="baudRate">波特率</param>
 public JSerialPort(string Name, PortParameter _PortParameter)
 {
     if (Name != null)
     {
         _PortParameter.tag_name = Name;
     }
     tag_PortParameter = _PortParameter;
 }
Ejemplo n.º 2
0
        public static Config Load()
        {
            Config _Config = Load(GetSetPath("set.config")) as Config;

            if (_Config == null)
            {
                _Config = new Config();
            }
            if (_Config.tag_safeStationModule == null)
            {
                _Config.tag_safeStationModule                  = new StationModule();
                _Config.tag_safeStationModule.tag_type         = 1;
                _Config.tag_safeStationModule.strStationName   = "轴手动防呆配置工位";
                _Config.tag_safeStationModule.intUsePointCount = 1;
                _Config.tag_safeStationModule.arrPoint.Add(new PointAggregate(_Config.tag_safeStationModule.strStationName, "p1"));
            }
            if (_Config.axisArray == null)
            {
                _Config.axisArray = new List <AxisConfig>();
            }
            if (_Config.tag_PrivateSave == null)
            {
                _Config.tag_PrivateSave = new PrivateSave();
            }
            if (_Config.tag_IPConfigList == null)
            {
                _Config.tag_IPConfigList = new List <IPConfig>();
                for (int j = 0; j < 2; j++)
                {
                    IPConfig pp = new IPConfig();
                    _Config.tag_IPConfigList.Add(pp);
                }
            }
            if (_Config.arrWorkStation == null)
            {
                _Config.arrWorkStation = new List <StationModule>(StationManage.intStationCount);
                for (int i = 0; i < StationManage.intStationCount; i++)
                {
                    _Config.arrWorkStation[i] = new StationModule();
                }
            }
            if (_Config.tag_PortParameterList == null)
            {
                _Config.tag_PortParameterList = new List <PortParameter>();
                for (int j = 0; j < 4; j++)
                {
                    PortParameter pp = new PortParameter();
                    _Config.tag_PortParameterList.Add(pp);
                }
                LogOutControl.OutLog("请配置端口", 0);
            }
            return(_Config);
        }
Ejemplo n.º 3
0
		public _SerialPortControl(PortParameter _PortParameter)
		{
			tag_PortParameter = _PortParameter;
			InitializeComponent();
		}