diff --git a/src/Models/Jammer/SmokeJammer.cs b/src/Models/Jammer/SmokeJammer.cs index 89d013d..a4989bc 100644 --- a/src/Models/Jammer/SmokeJammer.cs +++ b/src/Models/Jammer/SmokeJammer.cs @@ -184,6 +184,7 @@ namespace ActiveProtect.Models LaunchAngle = config.LaunchAngle; Type = config.Type; Count = config.Count; + SmokePosition = position; // 初始化性能参数 ExplosionHeight = config.ExplosionHeight; diff --git a/src/Models/Jammer/TerminalMillimeterWaveJammer.cs b/src/Models/Jammer/TerminalMillimeterWaveJammer.cs index c6b5013..c17cfbc 100644 --- a/src/Models/Jammer/TerminalMillimeterWaveJammer.cs +++ b/src/Models/Jammer/TerminalMillimeterWaveJammer.cs @@ -17,6 +17,15 @@ namespace ActiveProtect.Models public class TerminalMillimeterWaveJammer : JammerBase { #region 干扰参数 + + /// + /// 获取干扰器所属的末敏弹ID + /// + /// + /// 干扰器所属的末敏弹ID + /// + public string MissileId { get; private set; } + /// /// 获取干扰波长范围 /// @@ -83,13 +92,6 @@ namespace ActiveProtect.Models #endregion #region 仿真状态 - /// - /// 获取干扰类型 - /// - /// - /// 当前使用的干扰方式 - /// - public JammingType Type { get; private set; } /// /// 获取干扰开始时间 @@ -123,23 +125,21 @@ namespace ActiveProtect.Models /// 干扰器的初始位置 /// 干扰器的初始朝向 /// 仿真管理器实例 - /// 所属坦克的ID + /// 所属末敏弹的ID /// 干扰器配置参数 public TerminalMillimeterWaveJammer(string id, Vector3D position, Orientation orientation, - ISimulationManager manager, string tankId, TerminalMillimeterWaveJammerConfig config) - : base(id, position, orientation, manager, tankId, config.MaxJammingPower, + ISimulationManager manager, string missileId, TerminalMillimeterWaveJammerConfig config) + : base(id, position, orientation, manager, missileId, config.MaxJammingPower, config.InitialJammingPower, config.PowerIncreaseRate, config.MaxJammingCooldown) { // 初始化干扰参数 + MissileId = missileId; WavelengthRange = config.WavelengthRange; AngleRange = config.AngleRange; ResponseTime = config.ResponseTime; EffectiveRange = config.EffectiveRange; JammingProbability = config.JammingProbability; DetectionRange = config.DetectionRange; - PulseFrequency = config.PulseFrequency; - PulseWidth = config.PulseWidth; - Type = config.Type; // 初始化状态参数 ResetJammingStatus(); @@ -164,7 +164,7 @@ namespace ActiveProtect.Models /// 威胁探测事件参数 private void OnThreatDetected(TerminalThreatDetectionEvent evt) { - if (evt?.TargetId == TankId) + if (evt?.TargetId == MissileId) { CurrentTargetDistance = evt.Distance; if (CurrentTargetDistance <= DetectionRange) @@ -225,26 +225,6 @@ namespace ActiveProtect.Models // 根据距离计算实际干扰功率 double distanceRatio = Math.Min(1, EffectiveRange / CurrentTargetDistance); CurrentJammingPower = MaxJammingPower * distanceRatio * JammingProbability; - - // 根据干扰类型调整功率 - switch (Type) - { - case JammingType.NoiseJamming: - // 噪声干扰,功率均匀分布 - break; - case JammingType.DeceptionJamming: - // 欺骗干扰,功率集中 - CurrentJammingPower *= 1.5; - break; - case JammingType.ChaffJamming: - // 箔条干扰,功率分散 - CurrentJammingPower *= 0.8; - break; - case JammingType.CombinedJamming: - // 组合干扰,根据情况调整 - CurrentJammingPower *= 1.2; - break; - } } /// @@ -258,13 +238,9 @@ namespace ActiveProtect.Models { SenderId = Id, Timestamp = SimulationManager.CurrentTime, - TargetId = TankId, + TargetId = MissileId, JammingPower = CurrentJammingPower, - JammingType = Type, - Distance = CurrentTargetDistance, - Duration = JammingDuration, - PulseFrequency = PulseFrequency, - PulseWidth = PulseWidth + Frequency = PulseFrequency }); } } @@ -276,7 +252,6 @@ namespace ActiveProtect.Models public override string GetJammingStatus() { return $"末敏弹毫米波干扰器 {Id}:\n" + - $" 干扰类型: {Type}\n" + $" 状态: {(IsJamming ? "干扰中" : "待机中")}\n" + $" 当前功率: {CurrentJammingPower:F2}/{MaxJammingPower:F2}\n" + $" 目标距离: {CurrentTargetDistance:F1}\n" + @@ -284,30 +259,4 @@ namespace ActiveProtect.Models $" 干扰概率: {JammingProbability:P2}"; } } - - /// - /// 干扰类型枚举 - /// - public enum JammingType - { - /// - /// 噪声干扰,产生宽带噪声信号 - /// - NoiseJamming, - - /// - /// 欺骗干扰,产生虚假目标信号 - /// - DeceptionJamming, - - /// - /// 箔条干扰,释放金属箔条形成干扰云 - /// - ChaffJamming, - - /// - /// 组合干扰,同时使用多种干扰方式 - /// - CombinedJamming - } } \ No newline at end of file diff --git a/src/Simulation/SimulationConfig.cs b/src/Simulation/SimulationConfig.cs index 1d6e45a..a48c1e4 100644 --- a/src/Simulation/SimulationConfig.cs +++ b/src/Simulation/SimulationConfig.cs @@ -1052,13 +1052,7 @@ namespace ActiveProtect.Simulation /// public double PulseWidth { get; set; } - /// - /// 干扰类型 - /// - /// - /// 使用的干扰方式(噪声、欺骗、箔条、组合) - /// - public JammingType Type { get; set; } + #endregion #region 干扰功率参数 @@ -1117,7 +1111,6 @@ namespace ActiveProtect.Simulation DetectionRange = 2000.0; // 2000米 PulseFrequency = 1000.0; // 1000Hz PulseWidth = 1e-6; // 1微秒 - Type = JammingType.CombinedJamming; MaxJammingPower = 1000.0; // 1000瓦 InitialJammingPower = 400.0; // 400瓦 diff --git a/src/Simulation/SimulationEvents.cs b/src/Simulation/SimulationEvents.cs index 4393242..a114359 100644 --- a/src/Simulation/SimulationEvents.cs +++ b/src/Simulation/SimulationEvents.cs @@ -1,5 +1,6 @@ using ActiveProtect.Utility; using ActiveProtect.Models; +using System.Net.Mime; namespace ActiveProtect.Simulation { @@ -435,6 +436,54 @@ namespace ActiveProtect.Simulation /// public float Density { get; set; } + /// + /// 烟幕厚度(米) + /// + public float Thickness { get; set; } + + } + + /// + /// 末敏弹毫米波干扰事件 + /// + public class TerminalMillimeterWaveJammingEvent : SimulationEvent + { + /// + /// 目标ID + /// + public string? TargetId { get; set; } + + /// + /// 干扰功率(瓦特) + /// + public double JammingPower { get; set; } + + /// + /// 干扰频率(GHz) + /// + public double Frequency { get; set; } + + /// + /// 距离(米) + /// + public double Distance { get; set; } + + } + + /// + /// 末敏弹威胁探测事件 + /// + public class TerminalThreatDetectionEvent : SimulationEvent + { + /// + /// 目标ID + /// + public string? TargetId { get; set; } + + /// + /// 目标距离(米) + /// + public double Distance { get; set; } } }