public AntConfig GetAntConfig(Transceiver trans) { AntConfig config = (this.m_AntConfigDesc == null) ? new AntConfig() : this.m_AntConfigDesc.GetModel(); config.Parent = trans; AntConfigDesc.ConvertCoordinate(config, this.m_GeoInfo); return config; }
public static IACell CreateCell(IACell cell) { Transceiver trans = new Transceiver(); Site site = new Site(); site.X = 100; site.Y = 100; site.Equipment = new BtsEquipment(); site.Equipment.NoiseFigure = 2; trans.Name = "Trans1"; trans.Parent = site; trans.Cells.Add(cell); cell.Parent = trans; cell.MaxPower = 39; AntConfig antConfig = new AntConfig(); cell.Parent.AntConfiguration.Add(antConfig); cell.Parent.AntConfiguration[0].IsMainAnt = true; cell.Parent.AntConfiguration[0].DlTotalLoss = 2; antConfig.OutdoorAntenna = new AntennaEntity(); cell.ID = 1; PropModelConfig propModelConfig = new PropModelConfig(); propModelConfig.CalcRadius = 4000; propModelConfig.CalcResolution = 50; trans.Cells[0].PropModels.Add(propModelConfig); return cell; }
public static UMTSSimCell CreatUMTSSimCell(double x,double y) { IACell cell = new UMTSCell(); Transceiver trans = new Transceiver(); Site site = new Site(); List<UMTSSimUser> serverdUserList = new List<UMTSSimUser>(); serverdUserList.Add(MockUser.CreatUMTSPSUser()); site.X = x; site.Y = y; site.Equipment = new BtsEquipment(); site.Equipment.NoiseFigure = 3; cell.Parent = trans; trans.Parent = site; UMTSSimCell simCell = new UMTSSimCell(cell); simCell.NECell.PilotPower = 33f; simCell.NECell.FreqBand.BandWidth = 3f; simCell.DlFrequency = 2100f; simCell.UlFrequency = 2000f; simCell.GSMInterfCells = InitialGSMInterfCell(); simCell.TDInterfCells = InitialTDInterfCell(); simCell.ServerdHSUPAUser = serverdUserList; simCell.ULCENum = 15; simCell.TotalNoiserThreshold = 10; return simCell; }
private void OnTriggerEnter(Collider other) { //if wall,cut through? rebound? //if entity if (other.gameObject != m_Master && other.gameObject.GetComponent <Entity>() != null) { if (!m_Set.Contains(other.gameObject.GetInstanceID())) { m_Set.Add(other.gameObject.GetInstanceID()); //before damage //damage Transceiver.SendSignal(new DSignal(m_Master, other.gameObject, "Damage", m_Damage)); //after damage if (m_Weapon != null) { m_Weapon.Hit(other.gameObject.GetComponent <Entity>()); } if (m_Parts != null) { m_Parts.Hit(other.gameObject.GetComponent <Entity>()); } if (m_Set.Count >= m_MaxTargetNum) { Safe_Destroy(); } } } }
/// <summary> /// Log an error when receiving an exception related to a media line and transceiver pairing. /// </summary> /// <param name="ex">The exception to log.</param> /// <param name="mediaLine">The media line associated with the exception.</param> /// <param name="transceiver">The transceiver associated with the exception.</param> private void LogErrorOnMediaLineException(Exception ex, MediaLine mediaLine, Transceiver transceiver) { // Dispatch to main thread to access Unity objects to get their names InvokeOnAppThread(() => { string msg; if (ex is InvalidTransceiverMediaKindException) { msg = $"Peer connection \"{name}\" received {transceiver.MediaKind} transceiver #{transceiver.MlineIndex} \"{transceiver.Name}\", but local peer expected some {mediaLine.MediaKind} transceiver instead."; if (mediaLine.Source != null) { msg += $" Sender \"{(mediaLine.Source as MonoBehaviour).name}\" will be ignored."; } if (mediaLine.Receiver != null) { msg += $" Receiver \"{(mediaLine.Receiver as MonoBehaviour).name}\" will be ignored."; } } else { // Generic exception, log its message msg = ex.Message; } Debug.LogError(msg); }); }
private void FindCoverPoints(ValueMatrixShort onepolygonvalues, Transceiver cell, List<GeoXYPoint> points, LTECellCalcInfo onecellinfo) { if (onecellinfo.Tanceiver == cell) { this.FindCellAllCalcPoints(onepolygonvalues, cell, points, onecellinfo); } }
public void Init() { matrix = new TrueFalseMatrix(10, 10, 0.0, 10.0, 1, true); cell = new MockCell(); termianl = new Terminal(); //termianl.Gain = 3f; CsService = new UnionCsService(); CsService.BodyLoss = 5f; PsService = new UnionPsService(); PsService.BodyLoss = 5f; AntConfig1 = new AntConfig(); AntConfig1.IsMainAnt = true; AntConfig1.DlTotalLoss = 6f; AntConfig1.IsUserInput = false; AntConfig1.Feeder = new FeederEquipment(); tran = new Transceiver(); site = new Site(); site.Equipment = new BtsEquipment(); site.Equipment.NoiseFigure = 4f; site.X = 1; site.Y = 1; tran.Parent = site; tran.addAntConfig(AntConfig1); cell.Parent = tran; LinkLossAssist.Init(); }
/// <summary> /// Pair the given transceiver with the current media line. /// </summary> /// <param name="tr">The transceiver to pair with.</param> /// <exception cref="InvalidTransceiverMediaKindException"> /// The transceiver associated in the offer with the same media line index as the current media line /// has a different media kind than the media line. This is generally a result of the two peers having /// mismatching media line configurations. /// </exception> internal void PairTransceiverOnFirstOffer(Transceiver tr) { Debug.Assert(tr != null); Debug.Assert((Transceiver == null) || (Transceiver == tr)); // Check consistency before assigning if (tr.MediaKind != MediaKind) { throw new InvalidTransceiverMediaKindException(); } Transceiver = tr; // Keep the transceiver direction in sync with Sender and Receiver. UpdateTransceiverDesiredDirection(); // Always do this even after first offer, because the sender and receiver // components can be assigned to the media line later, and therefore will // need to be updated on the next offer even if that is not the first one. CreateSenderIfNeeded(); bool wantsRecv = (Receiver != null); if (wantsRecv) { (_receiver as IMediaReceiverInternal).AttachToTransceiver(Transceiver); } }
public void initial() { m_user1 = MockTDSimUser.CreatTDSimUser_CSDL(); m_user2 = MockTDSimUser.CreatTDSimUser_CSUL(); m_user3 = MockTDSimUser.CreatTDSimUser_PSDL(); m_user4 = MockTDSimUser.CreatTDSimUser_PSUL(); m_user5 = MockTDSimUser.CreatTDSimUser_PSDL(); m_UnAccessedUsers = new List<TDSimUser>(); m_Cell1 = MockTDSimCell.CreatTDSimCell(); m_Cell1.CarrType = CarrierTypeOfTD.R4; m_Cells=new List<TDSimCell>(); m_Cells.Add(m_Cell1); m_Tran = new TDSimTran(m_Cells); initialUser(m_user1, m_Cell1, m_Tran); initialUser(m_user2, m_Cell1, m_Tran); initialUser(m_user3, m_Cell1, m_Tran); initialUser(m_user4, m_Cell1, m_Tran); m_Carrier1 = new TDSCDMACarrier(); m_Transceiver = new Transceiver(); m_R4_CellAssign = new R4_CellAssign(); }
public void MyTestInitialize() { m_Name = "DLDCHRSCP"; m_Group = MockGroupAndCell.MockTDPredicGroup(); m_Cell = MockGroupAndCell.CreateTDCell(); m_transList = new List<Transceiver>(); m_Transceiver = new Transceiver(); m_tfMatrix = new TrueFalseMatrix(4, 4, 0.0, 200, 50, true); m_index = 0; LinkLossAssist.Init(); m_Case = new DLDCHSINRCase(); m_projectMgr = ServiceHelper.Lookup<IProjectManager>(ProjectSingleton.CurrentProject.AppContext); GenerateMatrix(); m_BestServerIDMatrix[m_index] = (short)(m_Cell.ID); m_Case.Name = m_Name; m_CellList = new List<IACell>(); m_Context = new Context(); m_CellList.Add(m_Cell); //GenerateCellList(); m_Transceiver.Cells = m_CellList; m_transList.Add(m_Transceiver); AddToContext(); }
private double CalculateNoiseFigureOfBts(Transceiver cell) { double linearValue = 0.0; double num2 = 0.0; double num3 = 0.0; double num4 = 0.0; foreach (AntConfig config in cell.AntConfiguration) { double num7; double num8; TmaEquipment tma = config.Tma; double num5 = UnitTrans.dBto((double)config.UlTotalLoss); float txPowerRatio = config.TxPowerRatio; if (tma != null) { num7 = UnitTrans.dBto((double)tma.NoiseFigure); num8 = UnitTrans.dBto((double)tma.UlGain); } else { num7 = 1.0; num8 = 1.0; } double num9 = num7 * num5; num2 = num8 / num5; num3 += ((txPowerRatio + ((num9 - 1.0) / ((double)txPowerRatio))) * txPowerRatio) * num2; num4 += txPowerRatio * num2; } Site site = cell.Parent as Site; linearValue = num3 / num4; linearValue += (UnitTrans.dBto((double)site.Equipment.NoiseFigure) - 1.0) / num4; return UnitTrans.todB(linearValue); }
public bool init(string sessionId, int sessionMode, string connectString, int monitoringPort) { try { Random rnd; StatusMessage = ""; // Add by J.S. // Admin의 Client간의 구별을 위하여 rnd = new Random(); sessionId = sessionId + "_" + HostInfo.addr + "_" + rnd.Next(9999).ToString("0000"); if (null == mioiProcess) { mioiProcess = new Transceiver(sessionId, monitoringPort); } if (null == mioiSession) { mioiSession = Transceiver.createSession(sessionId, sessionMode); mioiSession.connect(connectString); mioiSession.addMessageConsumer(this); mioiSession.setAutoRecovery(true); } return(true); } catch (Exception e) { StatusMessage = e.Message; return(false); } }
private async Task DownloadProjectPackage() { var packageRequest = new ProjectPackagePullRequest { ProjectPackageId = ProjectPackageId, ProjectPackageVersion = ProjectPackageVersion, }; ProjectPackagePullResponse packageResponse; try { packageResponse = await Transceiver.Send(packageRequest) .GetResponseAsync <ProjectPackagePullResponse>(); } catch (Exception error) { throw new ApplicationException($"Failed to download package '{ProjectPackageId}.{ProjectPackageVersion}'! {error.Message}"); } try { Metadata = await ProjectPackageTools.UnpackAsync(packageResponse.Filename, BinDirectory); AssemblyFilename = Path.Combine(BinDirectory, Metadata.AssemblyFilename); } finally { try { File.Delete(packageResponse.Filename); } catch (Exception error) { Log.Warn("Failed to remove temporary package file!", error); } } }
public static List<IACell> CreateCellList(List<IACell> cellList, double[] x, double[] y) { for (int i = 0; i < cellList.Count; i++) { Transceiver trans = new Transceiver(); Site site = new Site(); site.X = x[i]; site.Y = y[i]; site.Equipment = new BtsEquipment(); site.Equipment.NoiseFigure = 2; trans.Name = "Trans" + i.ToString(); trans.Parent = site; trans.Cells.Add(cellList[i]); cellList[i].Parent = trans; cellList[i].MaxPower = 39; AntConfig antConfig = new AntConfig(); cellList[i].Parent.AntConfiguration.Add(antConfig); cellList[i].Parent.AntConfiguration[0].IsMainAnt = true; cellList[i].Parent.AntConfiguration[0].DlTotalLoss = i+1; antConfig.OutdoorAntenna = new AntennaEntity(); cellList[i].ID = (short)i; PropModelConfig propModelConfig = new PropModelConfig(); propModelConfig.CalcRadius = 4000; propModelConfig.CalcResolution = 50; trans.Cells[0].PropModels.Add(propModelConfig); } return cellList; }
private GeoXYPoint CreatPoint(Transceiver tranceiver) { GeoXYPoint pointCell = new GeoXYPoint(); pointCell.X = tranceiver.X; pointCell.Y = tranceiver.Y; return pointCell; }
public void Init() { m_ModelList = GSMPointAnalysisMock.MockModelList(); RxPowerAndLinkLossModel modelimage = new RxPowerAndLinkLossModel(); modelimage.RxPower = -90; Site site = GSMMock.MockSite(); Transceiver transceiver = new Transceiver(); transceiver.Parent = site; modelimage.Cell = new GSMTRX(); modelimage.Cell.Parent = transceiver; modelimage.Cell.ID = 2; modelimage.DownLinkLoss = 112; modelimage.UpLinkLoss = 112; m_ModelList.Add(modelimage); m_Point = GSMPointAnalysisMock.MockGeoXYPoint(); m_TargetPara = new TargetPara(); m_TargetPara.TargetCIR = 9; m_TargetPara.TargetRxPower = -110; m_TargetPara.TargetThroughput = 12; m_Terminal = new Terminal(); GSMTerminal gsmTerminal = new GSMTerminal(); gsmTerminal.NetType = NetWorkType.GSM; m_Terminal.NetTerminalList.Add(gsmTerminal); m_Service = new UnionCsService(); m_Service.CommonType = CommonServiceType.CSService; //modify by lyt 6.23 GSMService gsmservice = new GSMService(); ((UnionCsService)m_Service).CSServiceDic.Add(NetWorkType.GSM, gsmservice); m_ULDetail = (GSMULDetail)(cellCalc.CalculateUpLinkDetail(m_ModelList, point, m_Service, m_Terminal, m_mobility)); //m_ULDetail = new GSMULDetail(m_ModelList, m_TargetPara, m_Service, m_Terminal); }
virtual protected void Fire() { Inventory _inv = gameObject.GetComponent <Inventory>(); if (_inv != null) { if (_inv.m_ItemForPick != null) { Transceiver.SendSignal(new DSignal(gameObject, gameObject, "Pickup")); } if (!Globe.netMode) { Item _weapon = _inv.GetWeapon(); if (_weapon == null) { return; } if (_weapon.m_WeaponType == WeaponType.WEAPON_MELEE) { m_Animator.SetBool("melee", true); } else { m_Animator.SetBool("range", true); } } m_Animator.SetBool("range", true); } else { m_Animator.SetBool("melee", true); } }
public FrequencyResponseTest( Transceiver transceiver, double startFrequency = 995E6, double stopFrequency = 1.005E9, int steps = 60, double sgPowerLevel = -10, double saReferenceLevel = 0, double bandwidth = 1E6, //10E3, double dwellTime = 1E-3, double deskew = 0, string triggerLine = "PXI_Trig0", double timeout = 10) { this.transceiver = transceiver; this.startFrequency = startFrequency; this.stopFrequency = stopFrequency; this.steps = steps; this.sgPowerLevel = sgPowerLevel; this.saReferenceLevel = saReferenceLevel; this.bandwidth = bandwidth; this.dwellTime = dwellTime; this.deskew = deskew; this.triggerLine = triggerLine; this.timeout = new PrecisionTimeSpan(timeout); transceiver.Initialize(); // initializing the hardware ahead of time can dramatically speed up execution of the caller }
public TranceiverCalcInfo(Transceiver tranceiver, Point startPoint, Point endPoint, IACell maxRSCell) { m_StartPoint = startPoint; m_EndPoint = endPoint; m_Tranceiver = tranceiver; m_Cell = maxRSCell; }
public override void process(ClientMessage message, Transceiver connection) { if(message.type == "newUser") { this.RequestKey(message.Get("username")); } }
public async Task Initialization(string user) { try { var config = new PeerConnectionConfiguration { IceServers = new List <IceServer> { new IceServer { Urls = { "stun:stun.l.google.com:19302" } } } }; await Connection.InitializeAsync(config); microphoneSource = await DeviceAudioTrackSource.CreateAsync(); var audioTrackConfig = new LocalAudioTrackInitConfig { trackName = "microphone_track" }; localAudioTrack = LocalAudioTrack.CreateFromSource(microphoneSource, audioTrackConfig); audioTransceiver = Connection.AddTransceiver(MediaKind.Audio); audioTransceiver.LocalAudioTrack = localAudioTrack; audioTransceiver.DesiredDirection = Transceiver.Direction.SendReceive; Console.WriteLine("Peer connection initialized."); } catch (Exception e) { await Log.WriteAsync(e.Message); Console.WriteLine(e); throw; } }
public Transceiver GetIAcell() { Transceiver transceiver = new Transceiver(); LTECell item = new LTECell(); transceiver.Cells.Add(item); transceiver.Name = this.Name; transceiver.ID = this.CellID; transceiver.Cells[0].PropModels = this.PropModels; transceiver.AntConfiguration = this.AntConfiguration; if (transceiver.Parent == null) { transceiver.Parent = new Site(); } transceiver.Parent.Name = this.SiteName; transceiver.Parent.ID = this.SiteID; ((Site) transceiver.getParent()).Altitude = this.SiteAltitude; transceiver.DeltaX = this.X; transceiver.DeltaY = this.Y; if (transceiver.Cells.Count == 0) { IACell cell2 = new LTECell(); transceiver.Cells.Add(cell2); transceiver.Cells[0].FreqBand = new FrequencyBand(); } transceiver.Cells[0].FreqBand = new FrequencyBand(); transceiver.Cells[0].FreqBand.DLFrequency = this.DLFrequency; return transceiver; }
//构造TDCarrier public static IACell CreatTDCarrier() { IACell cell = new TDSCDMACarrier(); Transceiver trans = new Transceiver(); Site site = new Site(); site.X = 100; site.Y = 100; site.Equipment = new BtsEquipment(); site.Equipment.NoiseFigure = 2; trans.Name = "Trans1"; trans.Parent = site; trans.Cells.Add(cell); cell.Name = "TDCell1"; cell.Parent = trans; cell.FreqBand = new FrequencyBand(); cell.FreqBand.DLFrequency = 2010f; cell.FreqBand.ULFrequency = 2010f; AntConfig antConfig = new AntConfig(); antConfig.OutdoorAntenna = new Huawei.UNet.Antenna.Entity.AntennaEntity(); cell.Parent.AntConfiguration.Add(antConfig); cell.Parent.AntConfiguration[0].IsMainAnt = true; cell.Parent.AntConfiguration[0].DlTotalLoss = 3; cell.Parent.AntConfiguration[0].OutdoorAntenna.Gain = 18; cell.ID = 2; PropModelConfig propModelConfig = new PropModelConfig(); propModelConfig.CalcRadius = 4000; propModelConfig.CalcResolution = 50; trans.Cells[0].PropModels.Add(propModelConfig); return cell; }
protected override void Add(Transceiver tranceiver) { if (!base.m_GroupKeys.ContainsKey(string.Empty)) { base.m_GroupKeys.Add(string.Empty, new List<short>()); } base.m_GroupKeys[string.Empty].Add(tranceiver.ID); }
private int GetShifting(Transceiver tranceiver) { if (tranceiver.TxNumber == 1) { return (tranceiver.ID % 6); } return (tranceiver.ID % 3); }
// Use this for initialization void Start() { m_Animator = gameObject.GetComponent <Animator>(); Transceiver _trans = gameObject.GetComponent <Transceiver>(); _trans.AddResolver("Joystick", OnJoystick); _trans.AddResolver("FireButton", OnFireButton); }
public User(string username, string alias, Transceiver connection) { this._connection = connection; this._username = username; this._alias = alias; this._user_status = Status.online; this._last_action = new DateTime(); }
private void FindOneCellOneCoverRegionPoints(ValueMatrixShortCollection bestservervalues, List<LTECalcCellsInfoCollection> infos, Transceiver cell, List<GeoXYPoint> points, int infoIndex) { LTECalcCellsInfoCollection infos2 = infos[infoIndex]; ValueMatrixShort onepolygonvalues = bestservervalues.Values[infoIndex]; foreach (LTECellCalcInfo info in infos2.TranceiverInfos) { this.FindCoverPoints(onepolygonvalues, cell, points, info); } }
public SingleGreenScalar(ScalarPlan plan, Transceiver transceiver, int length) { Transceiver = transceiver; I1 = plan.CalculateI1 ? new Complex[length] : new Complex[0]; I2 = plan.CalculateI2 ? new Complex[length] : new Complex[0]; I3 = plan.CalculateI3 ? new Complex[length] : new Complex[0]; I4 = plan.CalculateI4 ? new Complex[length] : new Complex[0]; I5 = plan.CalculateI5 ? new Complex[length] : new Complex[0]; }
private void FindOneCellCoverPoints(List<List<GeoXYPoint>> cellsPoints, ValueMatrixShortCollection bestservervalues, List<LTECalcCellsInfoCollection> infos, Transceiver cell) { List<GeoXYPoint> points = new List<GeoXYPoint>(); for (int i = 0; i < infos.Count; i++) { this.FindOneCellOneCoverRegionPoints(bestservervalues, infos, cell, points, i); } cellsPoints.Add(points); }
private void OnTriggerEnter(Collider other) { if (other.gameObject != m_Master && other.gameObject.GetComponent <Entity>() != null) { Destroy(gameObject); //damage Transceiver.SendSignal(new DSignal(m_Master, other.gameObject, "Damage", m_Damage)); } }
//private GetCalcRetangleForCell m_RecTool = null; /// <summary> /// 得到Cell的最大计算半径 /// </summary> /// <param name="cell">Cell</param> /// <returns>最大计算半径</returns> private float GetMaxCalcRadius(Transceiver tranceiver) { float radius = 0; foreach (PropModelConfig pmcfg in tranceiver.Cells[0].PropModels) { CompareRadius(ref radius, pmcfg); } return radius; }
private TranceiverCalcInfo ConstructCalcInfo(IACell cell, float resolution, GeoXYPoint pointLeftTop, GeoXYPoint pointRightBottom, GeoXYPoint pointCell, Transceiver tranceiver) { float radius = GetMaxCalcRadius(tranceiver); Point startP; Point endP; CalcStartEndPoint(resolution, pointLeftTop, pointRightBottom, pointCell, radius, out startP, out endP); TranceiverCalcInfo calcInfo = new TranceiverCalcInfo(tranceiver, startP, endP, cell); return calcInfo; }
/// <summary> /// Callback invoked when a transceiver is added to the peer connection, either from /// applying a remote offer/answer, or from manually adding it. In the latter case, the /// transceiver has already a view model in the pending collection. In the former case, /// create a view model for it and add it to the negotiated collection. /// </summary> /// <param name="transceiver">The newly added transceiver.</param> private void OnTransceiverAdded(Transceiver transceiver) { Logger.Log($"Added transceiver '{transceiver.Name}' (mid=#{transceiver.MlineIndex})."); ThreadHelper.RunOnMainThread(() => { var trvm = new TransceiverViewModel(transceiver); Transceivers.Add(trvm); }); }
private void PackageClient_OnPushApplicationPackage(string filename, RemoteTaskCompletionSource taskHandle) { var packageRequest = new ApplicationPackagePushRequest { Filename = filename, }; Transceiver.Send(packageRequest) .GetResponseAsync() .ContinueWith(taskHandle.FromTask); }
public GameObject CreateObject(string sName, Vector3 pos, Quaternion rotation) { if (s_Dic.ContainsKey(sName)) { GameObject _obj = GameObject.Instantiate(s_Dic[sName], pos, rotation); Transceiver.SendSignal(new DSignal(null, s_Dic[sName], "Duplicate", _obj)); return(_obj); } return(null); }
public void AddTransceiver_InvalidName() { var settings = new TransceiverInitSettings(); settings.Name = "invalid name"; Transceiver tr = null; Assert.Throws <ArgumentException>(() => { tr = pc1_.AddTransceiver(MediaKind, settings); }); Assert.IsNull(tr); }
private void AddSecondAntenna(Transceiver tranceiver, Transceiver oriTranceiver) { for (int i = 0; i < oriTranceiver.AntConfiguration.Count; i++) { AntConfig config = oriTranceiver.AntConfiguration[i]; if (!config.IsMainAnt) { tranceiver.AntConfiguration.Insert(i, oriTranceiver.AntConfiguration[i]); } } }
private AntConfig GetSectorConfig(Transceiver tranceiver) { foreach (AntConfig config in tranceiver.AntConfiguration) { if (config.IsMainAnt) { return config; } } return null; }
public TransceiverViewModel(Transceiver transceiver) { Transceiver = transceiver; IsAssociated = (transceiver.MlineIndex >= 0); DesiredDirection = transceiver.DesiredDirection; transceiver.Associated += OnAssociated; transceiver.DirectionChanged += OnDirectionChanged; // Sender defaults to the NULL track _sender = TransceiverCollectionViewModel.NullSenderTrack; }
private void PackageClient_OnPushProjectPackage(string filename, RemoteTaskCompletionSource taskHandle) { var packageRequest = new ProjectPackagePushRequest { ServerSessionId = ServerSessionId, Filename = filename, }; Transceiver.Send(packageRequest) .GetResponseAsync() .ContinueWith(taskHandle.FromTask); }
private string CellAntParamToString(Transceiver curTranceiver) { StringBuilder builder = new StringBuilder(); builder.Append(curTranceiver.X.ToString()); builder.Append(curTranceiver.Y.ToString()); foreach (AntConfig config in curTranceiver.AntConfiguration) { builder.Append(this.AntParamToStirng(config)); } return builder.ToString(); }
protected override string GetValue(Transceiver tranceivers) { List<ExtDefKeyValue> extDefines = tranceivers.ExtDefines; foreach (ExtDefKeyValue value2 in extDefines) { if (value2.Name == this.m_Name) { return value2.Value; } } return string.Empty; }
public async Task ReleaseAsync() { if (IsReleased) { return; } IsReleased = true; TimeReleased = DateTime.UtcNow; OnReleased(); using (var tokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(8))) { Transceiver.Stop(tokenSource.Token); } if (Domain != null) { try { await Domain.Unload(true); } catch (Exception error) { Log.Error($"An error occurred while unloading the session domain [{SessionId}]!", error); } try { Domain.Dispose(); } catch (Exception error) { Log.Error($"An error occurred while disposing the session domain [{SessionId}]!", error); } Domain = null; } try { FileUtils.DestoryDirectory(WorkDirectory); } catch (AggregateException errors) { errors.Flatten().Handle(e => { if (e is IOException) { //Log.Warn(ioError.Message); return(true); } Log.Warn($"An error occurred while cleaning the work directory! {e.Message}"); return(true); }); } catch (Exception error) { Log.Warn($"An error occurred while cleaning the work directory! {error.Message}"); } }
public static T CreateClient <T>(Transceiver transceiver) where T : class, ISpecificProtocol { var generator = new ProxyGenerator(); var specificRequestor = new SpecificRequestor(transceiver); var client = generator.CreateClassProxy <T>(specificRequestor); specificRequestor.specificProtocol = client; specificRequestor.Local = client.Protocol; return(client); }
public void term() { mioiSession.removeMessageConsumer(this); mioiSession.destroy(); mioiProcess.term(); mioiProcess = null; mioiSession = null; dispatchers = null; status_message = null; h101stub_instance = null; }
private string GetMainTilt(Transceiver tranceiver) { List<AntConfig> antConfiguration = tranceiver.AntConfiguration; foreach (AntConfig config in antConfiguration) { if (config.IsMainAnt) { return config.Tilt.ToString(); } } return "-1"; }
private void PackageClient_OnPushApplicationPackage(string filename, RemoteTaskCompletionSource <object> taskHandle) { Task.Run(async() => { var packageRequest = new ApplicationPackagePushRequest { Filename = filename, }; await Transceiver.Send(packageRequest) .GetResponseAsync(); return((object)null); }).ContinueWith(taskHandle.FromTask); }
private List<Transceiver> CreatTranceiverList() { List<Transceiver> trancList = new List<Transceiver>(); int count = 3; for (int i = 0; i < count;i++) { Transceiver temp = new Transceiver(); IACell cell = new GSMTRX(); temp.addCarrier(cell); trancList.Add(temp); } return trancList; }
protected override void Modify(Transceiver modifyTranceiver) { foreach (string str in base.m_GroupKeys.Keys) { base.m_GroupKeys[str].Remove(modifyTranceiver.ID); } string key = (modifyTranceiver.Parent as Site).Altitude.ToString(); if (!base.m_GroupKeys.ContainsKey(key)) { base.m_GroupKeys.Add(key, new List<short>()); } base.m_GroupKeys[key].Add(modifyTranceiver.ID); }
protected override void Modify(Transceiver modifyTranceiver) { foreach (string str in base.m_GroupKeys.Keys) { base.m_GroupKeys[str].Remove(modifyTranceiver.ID); } string mainTilt = this.GetMainTilt(modifyTranceiver); if (!base.m_GroupKeys.ContainsKey(mainTilt)) { base.m_GroupKeys.Add(mainTilt, new List<short>()); } base.m_GroupKeys[mainTilt].Add(modifyTranceiver.ID); }
private void PackageClient_OnPullApplicationPackage(string id, string version, RemoteTaskCompletionSource <string> taskHandle) { Task.Run(async() => { var packageRequest = new ApplicationPackagePullRequest { PackageId = id, PackageVersion = version, }; var response = await Transceiver.Send(packageRequest) .GetResponseAsync <ApplicationPackagePullResponse>(); return(response.Filename); }).ContinueWith(taskHandle.FromTask); }
public PowerServoTest( Transceiver transceiver, string waveformName, ComplexWaveform <ComplexDouble> waveform, double centerFrequency = 1E9, double powerLevel = -10 ) { this.transceiver = transceiver; this.waveformName = waveformName; this.waveform = waveform; this.centerFrequency = centerFrequency; this.powerLevel = powerLevel; }
public NoiseFloorTest( Transceiver transceiver, string band, string waveformName, ComplexWaveform <ComplexDouble> waveform, double txStartFrequency = 1920E6, double txStopFrequency = 1980E6, double rxStartFrequency = 2110E6, double rxStopFrequency = 2170E6, double frequencyStep = 1E6, int numberOfRuns = 1, string referenceTriggerLine = "PXI_Trig0", double sgPowerLevel = -10, double saReferenceLevel = 10, double vbw = 10000, bool preSoakSweep = false, double soakFrequency = 1955E6, double soakTime = 0, double dwellTime = 1E-3, double idleTime = 300E-6, double referenceTriggerDelay = 15E-6, double timeout = 10) { this.transceiver = transceiver; this.band = band; this.waveformName = waveformName; this.waveform = waveform; this.txStartFrequency = txStartFrequency; this.txStopFrequency = txStopFrequency; this.rxStartFrequency = rxStartFrequency; this.rxStopFrequency = rxStopFrequency; this.frequencyStep = frequencyStep; this.numberOfRuns = numberOfRuns; this.referenceTriggerLine = referenceTriggerLine; this.sgPowerLevel = sgPowerLevel; this.saReferenceLevel = saReferenceLevel; this.vbw = vbw; this.preSoakSweep = preSoakSweep; this.soakFrequency = soakFrequency; this.soakTime = soakTime; this.dwellTime = dwellTime; this.idleTime = idleTime; this.referenceTriggerDelay = referenceTriggerDelay; this.timeout = new PrecisionTimeSpan(timeout); ThreadPool.QueueUserWorkItem(o => LVFilters.Initialize()); // this is launched asynchronously and will never be waited on transceiver.Initialize(); }
private void connect(String sessionName) { try { ioiSession = Transceiver.createSession(sessionName, sessionMode); ioiSession.addSessionEventListener(this); ioiSession.setAutoRecovery(true); ioiSession.setDefaultTTL(30000); ioiSession.connect(connectString); } catch (SessionException ex) { throw new TrxException(ex.ToString(), ex); } }
private void Peer_VideoTrackRemoved(Transceiver transceiver, RemoteVideoTrack track) { Debug.Assert(track.Transceiver == null); // already removed // Note: if the transceiver was created by SetRemoteDescription() internally, but the user // did not add any MediaLine in the component, then the transceiver is ignored. // SetRemoteDescriptionAsync() already triggered a warning in this case, so be silent here. MediaLine mediaLine = _mediaLines.Find((MediaLine ml) => ml.Transceiver == transceiver); if (mediaLine != null) { Debug.Assert(mediaLine != null); Debug.Assert(mediaLine.MediaKind == MediaKind.Video); mediaLine.OnUnpaired(track); } }
//Constructor public VST_NI5646R(string[] vst_address) { testSite = vst_address.Length; VST = new Transceiver[testSite]; NoiseConfig = new S_NoiseConfig[testSite]; NF_VSTDriver.SignalType = new s_SignalType[Enum.GetNames(typeof(NoiseFloorWaveformMode)).Length]; // Initialize hardware - Transceiver for (int i = 0; i < vst_address.Length; i++) { VST[i] = new Transceiver(vst_address[i]); VST[i].Initialize(); } }
/// <summary> /// Pair the given transceiver with the current media line. /// </summary> /// <param name="tr">The transceiver to pair with.</param> /// <exception cref="InvalidTransceiverMediaKindException"> /// The transceiver associated in the offer with the same media line index as the current media line /// has a different media kind than the media line. This is generally a result of the two peers having /// mismatching media line configurations. /// </exception> internal void PairTransceiverOnFirstOffer(Transceiver tr) { Debug.Assert(tr != null); Debug.Assert((Transceiver == null) || (Transceiver == tr)); // Check consistency before assigning if (tr.MediaKind != MediaKind) { throw new InvalidTransceiverMediaKindException(); } Transceiver = tr; // Initialize the transceiver direction in sync with Sender and Receiver. UpdateTransceiverDesiredDirection(); }
/// <summary> /// Callback on remote audio track removed. /// </summary> /// <param name="track">The audio track removed.</param> private void OnRemoteAudioTrackRemoved(Transceiver transceiver, RemoteAudioTrack track) { Logger.Log($"Removed remote audio track {track.Name} from transceiver {transceiver.Name}."); var atvm = AudioTracks.Single(vm => vm.TrackImpl == track); AudioTracks.Remove(atvm); //IAudioTrack newPlaybackAudioTrack = null; //if (LocalAudioTracks.Count > 0) //{ // newPlaybackAudioTrack = LocalAudioTracks[0].Track; //} //SwitchMediaPlayerSource(newPlaybackAudioTrack, _playbackVideoTrack); }
public SingleGreenScalar CombineSeparatedScalars(Transceiver transceiver, InnerResult[] separatedResults) { int length = _sortedIndecies.Count; var result = new SingleGreenScalar(_plan, transceiver, length); for (int k = 0; k < length; k++) { var sampleIndex = _sortedIndecies.Values[k].SampleIndex; var valueIndex = _sortedIndecies.Values[k].RhoIndex; CopyScalarResultValues(valueIndex, k, separatedResults[sampleIndex], result); } return(result); }