Exemplo n.º 1
0
        private void parseSignal(ParseTypes.Network si, ParseTypes.BasicInfo basicInfo, ParseTypes.Operator op, ParseTypes.Status sta, ParseTypes.Traffic tra)
        {
            EnumNetworkType type = (EnumNetworkType)System.Enum.Parse(typeof(EnumNetworkType), basicInfo.workmode.Replace(" ", "_"));

            chLabel(label22, getTypeNet(int.Parse(sta.CurrentNetworkTypeEx)));

            int a = 0;

            int.TryParse(sta.SignalIcon, out a);
            signalStrength1.Strength = a;

            chLabel(label25, op.FullName);

            chLabel(label33, op.FullName);
            chLabel(label36, op.ShortName);

            chLabel(label39, calcM(tra.CurrentUploadRate) + "/sec");
            chLabel(label40, calcM(tra.CurrentDownloadRate) + "/sec");

            chLabel(toolStripStatusLabel2, getConnStatus(int.Parse(sta.ConnectionStatus)));

            chLabel(label3, si.cell_id.ToString());
            chLabel(label5, si.rsrq);
            chLabel(label6, si.rsrp);
            chLabel(label9, si.rssi);
            chLabel(label11, si.sinr);
            chLabel(label24, si.rscp);

            try
            {
                TimeSpan t = TimeSpan.FromSeconds(int.Parse(tra.CurrentConnectTime));

                string answer = string.Format("{0:D2}h {1:D2}m {2:D2}s",
                                              t.Hours,
                                              t.Minutes,
                                              t.Seconds,
                                              t.Milliseconds);

                chLabel(label45, answer);
            } catch { }

            chLabel(label41, calcM(tra.CurrentDownload));
            chLabel(label43, calcM(tra.CurrentUpload));

            chLabel(label18, basicInfo.DeviceName);
            chLabel(label19, basicInfo.Imei);
            chLabel(label20, basicInfo.SerialNumber);
            chLabel(label14, basicInfo.HardwareVersion);
            chLabel(label12, basicInfo.SoftwareVersion);

            chLabel(label28, sta.WanIPAddress);
            chLabel(label29, basicInfo.MacAddress1);
        }
Exemplo n.º 2
0
 void parseSignalInv(ParseTypes.Network str, ParseTypes.BasicInfo ne, ParseTypes.Operator op, ParseTypes.Status sta, ParseTypes.Traffic tra)
 {
     try
     {
         if (this.InvokeRequired)
         {
             this.Invoke(new Action <ParseTypes.Network, ParseTypes.BasicInfo, ParseTypes.Operator, ParseTypes.Status, ParseTypes.Traffic>(parseSignal), str, ne, op, sta, tra);
         }
         else
         {
             parseSignal(str, ne, op, sta, tra);
         }
     }
     catch (Exception) { }
 }