Example #1
0
        private string ReadProgramNameHandle(ref ushort flib, string para)
        {
            string message = null;

            var res = new ReadProgramNameResultItemModel();

            var ret = new ProgramNameHelper().ReadProgramName(flib, ref res);

            if (ret.Item1 == -16)
            {
                var ret_conn = ConnectHelper.BuildConnect(ref flib, m_ip, m_port, m_timeout);

                if (ret_conn == 0)
                {
                    ret = new ProgramNameHelper().ReadProgramName(flib, ref res);
                }
            }

            if (ret.Item1 != 0)
            {
                message = ret.Item2;
            }
            //GetResultEvent?.Invoke(new BaseCNCResultModel<ReadProgramNameResultModel>() { Value = new List<ReadProgramNameResultModel>() {  Id = para });

            return(message);
        }
Example #2
0
        public Tuple <short, string> ReadProgramName(ushort flib, ref ReadProgramNameResultItemModel data)
        {
            StringBuilder str = new StringBuilder();
            var           ret = Focas1.cnc_pdf_rdmain(flib, str);

            if (ret == 0)
            {
                string[] sArray = str.ToString().Split('/');
                data.Name = sArray[sArray.Count() - 1];

                data.FullName = str.ToString();

                return(new Tuple <short, string>(0, null));
            }
            else
            {
                return(new Tuple <short, string>(ret, $"读取主程序名称错误,返回:{ret}"));
            }
        }
Example #3
0
 public ProgramNameHandler()
 {
     temp = new ReadProgramNameResultItemModel();
 }