Пример #1
0
        public async Task <FsInfo> ReadFileList()
        {
            if (!CheckConnection())
            {
                return(null);
            }

            this.IsEnabled = false;
            this.parent.SetStatusWorking($"Reading file list ...", "Image_Refresh");
            this.parent.InitializeProgressBar(true);
            DettachSerialEvents();
            FsInfo result = new FsInfo();

            try
            {
                result = await Task.Run(() => { return(this.uploader.ReadFileList()); });
            }
            finally
            {
                this.IsEnabled = true;
                this.parent.RestoreStatusWorking();
                AttachSerialEvents();
            }

            return(result);
        }
Пример #2
0
        public string CpriGetFsInfo_RX(RunTimeError error, string cpriport, string carrierIndex)
        {
            string getdata       = "";
            FsInfo currentFsInfo = new FsInfo();
            FsInfo axcFsInfo     = new FsInfo();
            FsInfo customFsInfo  = new FsInfo();

            try
            {
                rCarrierConfig.CpriGetFsInfo_RX(cpriport, byte.Parse(carrierIndex), out currentFsInfo, out axcFsInfo, out customFsInfo);

                if (currentFsInfo != null && axcFsInfo != null && customFsInfo != null)
                {
                    string currentFsInfoValue = currentFsInfo.Addr.ToString() + "|" + currentFsInfo.Bf.ToString() + "|" + currentFsInfo.BfOffset.ToString() + "|" + currentFsInfo.Hf.ToString();
                    string axcFsInfoValue     = axcFsInfo.Addr.ToString() + "|" + axcFsInfo.Bf.ToString() + "|" + axcFsInfo.BfOffset.ToString() + "|" + axcFsInfo.Hf.ToString();
                    string customFsInfoValue  = customFsInfo.Addr.ToString() + "|" + customFsInfo.Bf.ToString() + "|" + customFsInfo.BfOffset.ToString() + "|" + customFsInfo.Hf.ToString();

                    getdata = currentFsInfoValue + "," + axcFsInfoValue + "," + customFsInfoValue;
                }
            }
            catch (Exception e)
            {
                WriteTraceText(error, "Rumaster Get Carrier Config  error : " + e.Message);
            }
            return(getdata);
        }
Пример #3
0
 public String getFileInfoJSON(String path)
 {
     FsInfo fi = new FsInfo();
     if (File.Exists(path)) {
         FileInfo info = new FileInfo(path);
         fi.name = info.Name;
         fi.path = info.FullName;
         fi.createTime = info.CreationTime.ToString();
         fi.extName = info.Extension;
     }
     return (new JavaScriptSerializer()).Serialize(fi);
 }
Пример #4
0
        public void SetCarrierConfig(RunTimeError error, string cpriport, string flowdirection, string carriernumber, string enabled, string carrierid, string technology, string frequency, string axccontainer, string gain, string fsinfo, string axcContainerGroupLength, string bfPeriod, string syncmode)
        {
            try
            {
                FsInfo   fsinfoData = new FsInfo();
                string[] fsinfostr  = fsinfo.Split();
                if (fsinfostr.Length >= 4)
                {
                    fsinfoData.Addr     = byte.Parse(fsinfostr[0]);
                    fsinfoData.Hf       = byte.Parse(fsinfostr[1]);
                    fsinfoData.Bf       = byte.Parse(fsinfostr[2]);
                    fsinfoData.BfOffset = byte.Parse(fsinfostr[3]);
                }

                Gain     gainData = new Gain();
                string[] gainstr  = gain.Split();
                if (fsinfostr.Length >= 3)
                {
                    gainData.GainEnable = boolDic[gainstr[0]];
                    gainData.GainDb     = double.Parse(gainstr[1]);
                    gainData.GainFact   = double.Parse(gainstr[2]);
                }

                CarrierData data = new CarrierData();
                data.axcContainerGroupLength = byte.Parse(axcContainerGroupLength);
                data.bfPeriod          = byte.Parse(bfPeriod);
                data.carrierId         = byte.Parse(carrierid);
                data.carrierNumber     = byte.Parse(carriernumber);
                data.enabled           = boolDic[enabled];
                data.sampleFrequency   = freqDic[frequency];
                data.technology        = technologyDic[technology];
                data.startAxcContainer = byte.Parse(axccontainer);
                data.syncMode          = syncModeDic[syncmode];
                data.fsInfo            = fsinfoData;
                data.gain = gainData;


                rCarrierConfig.SetCarrierConfig(cpriport, flowDirectionDic[flowdirection], data);
                //showCarrierData(data);
            }
            catch (Exception e)
            {
                WriteTraceText(error, "Rumaster Set Carrier Config  error : " + e.Message);
            }
        }
Пример #5
0
        private void RumasterSetCarrierConfig(string cpriport, string flowdirection, string carriernumber, string enabled, string carrierid, string technology, string frequency, string axccontainer, string gain, string fsinfo,string axcContainerGroupLength,string bfPeriod,string syncmode)
        {
            try
            {

                FsInfo fsinfoData = new FsInfo();
                string[] fsinfostr = fsinfo.Split(SPACER_FLAG_SEC);
                if (fsinfostr.Length >= 4)
                {
                    fsinfoData.Addr = byte.Parse(fsinfostr[0]);
                    fsinfoData.Hf = byte.Parse(fsinfostr[1]);
                    fsinfoData.Bf = byte.Parse(fsinfostr[2]);
                    fsinfoData.BfOffset = byte.Parse(fsinfostr[3]);
                }

                Gain  gainData = new Gain();
                string[] gainstr = gain.Split(SPACER_FLAG_SEC);
                if (fsinfostr.Length >= 3)
                {
                    gainData.GainEnable = boolDic[gainstr[0]];
                    gainData.GainDb = double.Parse(gainstr[1]);
                    gainData.GainFact = double.Parse(gainstr[2]);
                }

                CarrierData data = new CarrierData();
                data.axcContainerGroupLength = byte.Parse(axcContainerGroupLength);
                data.bfPeriod = byte.Parse(bfPeriod);
                data.carrierId = byte.Parse(carrierid);
                data.carrierNumber = byte.Parse(carriernumber);
                data.enabled = boolDic[enabled];
                data.sampleFrequency = freqDic[frequency];
                data.technology = technologyDic[technology];
                data.startAxcContainer = byte.Parse(axccontainer);
                data.syncMode = syncModeDic[syncmode];
                data.fsInfo = fsinfoData;
                data.gain = gainData;

                rCarrierConfig.SetCarrierConfig(cpriport, flowDirectionDic[flowdirection], data);
                showCarrierData(data);

            }
            catch (Exception e)
            {
                WriteTraceText("Rumaster Set Carrier Config failed!--" + e.Message);
            }
        }
Пример #6
0
        private string showCarrierData(CarrierData data)
        {
            //#cpriPort#flowDirection#axcContainerGroupLength#bfPeriod#carrierId#carrierNumber#enabled#fsInfo#gain#frequency##axcContainer#syncMode#technology
            string strdata = "";

            string carrierNumber = data.carrierNumber.ToString();

            strdata = strdata + "Number=" + carrierNumber;
            if (data.enabled == true)
            {
                strdata = strdata + "Enabled=" + "true";
            }
            else if (data.enabled == false)
            {
                strdata = strdata + "Enabled=" + "false";
            }
            string carrierId = data.carrierId.ToString();

            strdata = strdata + "Id=" + carrierId;
            string tech = data.technology.ToString();

            strdata = strdata + "Technology=" + tech;
            string Frequency = data.sampleFrequency.ToString();

            strdata = strdata + "SampleFrequency=" + Frequency;

            string startAxcContainer = data.startAxcContainer.ToString();

            strdata = strdata + "AxcContainer=" + startAxcContainer;

            Gain gaindata = data.gain;

            if (gaindata.GainEnable == true)
            {
                strdata = strdata + "GainEnable=" + "true";
            }
            else if (gaindata.GainEnable == false)
            {
                strdata = strdata + "GainEnable=" + "false";
            }

            string gaindb = gaindata.GainDb.ToString();

            strdata = strdata + "GainDb=" + gaindb;
            string gainfact = gaindata.GainFact.ToString();

            strdata = strdata + "GainFact=" + gainfact;


            FsInfo fsinfodata = data.fsInfo;
            string addr       = fsinfodata.Addr.ToString();

            strdata = strdata + "FsInfoAddress=" + addr;
            string hf = fsinfodata.Hf.ToString();

            strdata = strdata + "FsInfoHF=" + hf;
            string bf = fsinfodata.Bf.ToString();

            strdata = strdata + "FsInfoBF=" + bf;
            string bfoffset = fsinfodata.BfOffset.ToString();

            strdata = strdata + "FsInfoBfOffset=" + bfoffset;


            string axcContainerGroupLength = data.axcContainerGroupLength.ToString();

            strdata = strdata + "axcContainerGroupLength=" + axcContainerGroupLength;
            string bfPeriod = data.bfPeriod.ToString();

            strdata = strdata + "bfPeriod=" + bfPeriod;

            string syncmode = data.syncMode.ToString();

            strdata = strdata + "syncMode=" + syncmode;

            //WriteTraceText(strdata);
            return(strdata);
        }