示例#1
0
 public static bool GetInformation(CNCMachine machine, CNCInformation cncInfo)
 {
     if (machine == null)
     {
         return(false);
     }
     return(GetInformation(GetCNCStation(machine.MachineIP.ToString()), cncInfo));
 }
示例#2
0
        public static bool GetInformation(SyntecRemoteCNC cnc, CNCInformation cncInfo)
        {
            if (cnc == null)
            {
                return(false);
            }
            short  axes    = 0;
            short  maxAxes = 0;
            string cncType = "";
            string series  = "";
            string str3    = "";

            string[] axisName = null;
            try
            {
                short num3 = cnc.READ_information(out axes, out cncType, out maxAxes, out series, out str3, out axisName);
                if (num3 == 0)
                {
                    try
                    {
                        cncInfo.HostIP   = cnc.Host;
                        cncInfo.Axes     = axes;
                        cncInfo.CncType  = cncType;
                        cncInfo.MaxAxes  = maxAxes;
                        cncInfo.Series   = series;
                        cncInfo.Nc_Ver   = str3;
                        cncInfo.AxisName = axisName.ToList <string>();
                        return(true);
                    }
                    catch (Exception)
                    {
                        return(false);
                    }
                }
                cncInfo.ErrMsg = cnc.Host + ":" + num3.ToString();
                return(false);
            }
            catch (Exception)
            {
                return(false);
            }
        }