Пример #1
0
 void Start()
 {
     GameManager.Instance.StartRound    += () => lockedByGame = false;
     GameManager.Instance.OnResetRound  += StopVibrating;
     GameManager.Instance.OnResetRound  += ResetRound;
     GameManager.Instance.OnChangeScene += StopVibrating;
     transform.Find("DronePos_To_RT").gameObject.layer = LayerMask.NameToLayer("Drone");
     ControlModule.HandleCollisions(this);
 }
        public Test发射机测试基础(PowerMeterBase powermeter, SignalGeneratorBase signal, ControlModule control, WaveformGeneratorBase wave)
        {
            _SignalGener       = signal;
            _PowerMeter        = powermeter;
            _ControlModule     = control;
            _WaveFormGenerator = wave;
            int count = 0;

            foreach (频率工作范围 item in Enum.GetValues(typeof(频率工作范围)))
            {
                LX频率校准映射.Add(item, count++);
            }
        }
Пример #3
0
        public Test发射机_电压电流_BITE检测(PowerSupplyBase psw, PowerSupplyBase ppt, ControlModule control)
        {
            _PowerSupply_PSW = psw;
            _PowerSupply_PPT = ppt;
            _ControlModule   = control;

            _PPT_Thread  = new Thread(PPT_Work);
            _PSW_Thread  = new Thread(PSW_Work);
            _BITE_Thread = new Thread(BITE_Work);

            _PSW_Thread.IsBackground  = true;
            _PPT_Thread.IsBackground  = true;
            _BITE_Thread.IsBackground = true;
        }
        public ParentForm()
        {
            InitializeComponent();

            SumModule     = sumModule;
            ResultModule  = resultModule;
            ControlModule = controlModule;

            ControlModule.GlobalForm = this;

            SumModule.OnClickCallback += (result) =>
            {
                ResultModule.Result = result;
                return(result);
            };
        }
Пример #5
0
        private void txtOutput_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            FrmConnectionFinder form = new FrmConnectionFinder(ControlModule.ModuleType.Sensor, this.Connection);

            form.ShowDialog(this);

            if (form.DialogResult == DialogResult.OK)
            {
                this.Connection = form.SelectedConnection;
                this.Decoder    = form.SelectedDecoder;

                Project.ControlModuleConnectionManager.Assign(this.Connection.ID,
                                                              this.ConnectionIndex,
                                                              this.Block.ID);

                ShowSelectedOutput();
            }
        }
        public void Init()
        {
            #region fetchblocks
            GridTerminalSystemUtils GTS = new GridTerminalSystemUtils(Me, GridTerminalSystem);
            control    = GTS.GetBlockWithNameOnGrid(controllerName) as IMyShipController;
            mergeBlock = GTS.GetBlockWithNameOnGrid(mergeBlockName) as IMyShipMergeBlock;

            var antennas = new List <IMyRadioAntenna>();
            GTS.GetBlocksOfTypeOnGrid(antennas);
            #endregion

            #region initModules
            if (antennas.Count > 0)
            {
                commsHandler = new CommsHandler(this, antennas.First());
            }
            else
            {
                commsHandler = new CommsHandler(this, null);
            }

            var commands = new Commands(this, commsHandler);
            commands.RegisterCommands();

            EntityTracking_Module.refExpSettings refExp = EntityTracking_Module.refExpSettings.Sensor | EntityTracking_Module.refExpSettings.Turret;
            targetTracker = new EntityTracking_Module(GTS, control, null, refExp);
            targetTracker.onEntityDetected += OnTargetFound;

            controlModule = new ControlModule(GTS, control);
            proNav        = new ProNav(controlModule, 30);

            missionScheduler = new Scheduler();

            payload = new Payload(GTS, backupDetonationEngageDist);
            #endregion

            mode = CurrentMode.Idle;

            initialized             = true;
            Runtime.UpdateFrequency = UpdateFrequency.Update1;
        }
Пример #7
0
 // Use this for initialization
 void Start()
 {
     reloadTime = 1.5f;
     isReloading = false;
     baseFireCooldown = 1.0f;
     cm = GameObject.Find("GameController").GetComponent<ControlModule>();
 }
 public Test测试前后开机与关机(PowerMeterBase powermeter, SignalGeneratorBase signal, ControlModule control, WaveformGeneratorBase wave, PowerSupplyBase power_ppt, PowerSupplyBase power_psw) : base(powermeter, signal, control, wave)
 {
     _PowerSupply_PSW = power_psw;
     _PowerSupply_PPT = power_ppt;
 }
Пример #9
0
 // Use this for initialization
 void Start()
 {
     rb = GetComponent<Rigidbody2D>();
     cm = GameObject.Find("GameController").GetComponent<ControlModule>();
 }
Пример #10
0
 public Test发射机_脉内信杂比(PowerMeterBase powermeter, SignalGeneratorBase signal, SpectrumAnalyzerBase spe, ControlModule control, WaveformGeneratorBase wave) : base(powermeter, signal, control, wave)
 {
     _Spec = spe;
 }
Пример #11
0
        public virtual double GetValue(double x, double y, double z)
        {
            if (ControlModule == null || SourceModule1 == null || SourceModule2 == null)
            {
                throw new NullReferenceException("Control and source modules must be provided.");
            }

            double controlValue = ControlModule.GetValue(x, y, z);
            double alpha;

            if (EdgeFalloff > 0.0)
            {
                if (controlValue < (LowerBound - EdgeFalloff))
                {
                    // The output value from the control module is below the selector
                    // threshold; return the output value from the first source module.
                    return(SourceModule1.GetValue(x, y, z));
                }
                else if (controlValue < (LowerBound + EdgeFalloff))
                {
                    // The output value from the control module is near the lower end of the
                    // selector threshold and within the smooth curve. Interpolate between
                    // the output values from the first and second source modules.
                    double lowerCurve = (LowerBound - EdgeFalloff);
                    double upperCurve = (LowerBound + EdgeFalloff);
                    alpha = SCurve3((controlValue - lowerCurve) / (upperCurve - lowerCurve));
                    return(LinearInterpolate(SourceModule1.GetValue(x, y, z),
                                             SourceModule2.GetValue(x, y, z), alpha));
                }
                else if (controlValue < (UpperBound - EdgeFalloff))
                {
                    // The output value from the control module is within the selector
                    // threshold; return the output value from the second source module.
                    return(SourceModule2.GetValue(x, y, z));
                }
                else if (controlValue < (UpperBound + EdgeFalloff))
                {
                    // The output value from the control module is near the upper end of the
                    // selector threshold and within the smooth curve. Interpolate between
                    // the output values from the first and second source modules.
                    double lowerCurve = (UpperBound - EdgeFalloff);
                    double upperCurve = (UpperBound + EdgeFalloff);
                    alpha = SCurve3(
                        (controlValue - lowerCurve) / (upperCurve - lowerCurve));
                    return(LinearInterpolate(SourceModule2.GetValue(x, y, z),
                                             SourceModule1.GetValue(x, y, z),
                                             alpha));
                }
                else
                {
                    // Output value from the control module is above the selector threshold;
                    // return the output value from the first source module.
                    return(SourceModule1.GetValue(x, y, z));
                }
            }
            else
            {
                if (controlValue < LowerBound || controlValue > UpperBound)
                {
                    return(SourceModule1.GetValue(x, y, z));
                }
                else
                {
                    return(SourceModule2.GetValue(x, y, z));
                }
            }
        }
Пример #12
0
        public override double GetValue(double x, double y, double z)
        {
            //   var result = base.GetValue(x, y, z);


            double del = Div * 150.0f;
            double xx  = (x * del);
            double yy  = (z * del);
            var    col = Bitmap.GetPixel((int)xx, (int)(yy));

            float height = col.R / 255.0f;

            if (col.A == 0)
            {
                return(0);
            }
            if (height > 0.7f)
            {
            }
            height -= 0.5f;
            height *= 2.0f;

            double controlValue = ControlModule.GetValue(x, y, z);
            double alpha;

            controlValue = height + (controlValue * 1.2f * Randomness);

            if (EdgeFalloff > 0.0)
            {
                if (controlValue < (LowerBound - EdgeFalloff))
                {
                    // The output value from the control module is below the selector
                    // threshold; return the output value from the first source module.
                    return(SourceModule1.GetValue(x, y, z));
                }
                else if (controlValue < (LowerBound + EdgeFalloff))
                {
                    // The output value from the control module is near the lower end of the
                    // selector threshold and within the smooth curve. Interpolate between
                    // the output values from the first and second source modules.
                    double lowerCurve = (LowerBound - EdgeFalloff);
                    double upperCurve = (LowerBound + EdgeFalloff);
                    alpha = SCurve3((controlValue - lowerCurve) / (upperCurve - lowerCurve));
                    return(LinearInterpolate(SourceModule1.GetValue(x, y, z),
                                             SourceModule2.GetValue(x, y, z), alpha));
                }
                else if (controlValue < (UpperBound - EdgeFalloff))
                {
                    // The output value from the control module is within the selector
                    // threshold; return the output value from the second source module.
                    return(SourceModule2.GetValue(x, y, z));
                }
                else if (controlValue < (UpperBound + EdgeFalloff))
                {
                    // The output value from the control module is near the upper end of the
                    // selector threshold and within the smooth curve. Interpolate between
                    // the output values from the first and second source modules.
                    double lowerCurve = (UpperBound - EdgeFalloff);
                    double upperCurve = (UpperBound + EdgeFalloff);
                    alpha = SCurve3(
                        (controlValue - lowerCurve) / (upperCurve - lowerCurve));
                    return(LinearInterpolate(SourceModule2.GetValue(x, y, z),
                                             SourceModule1.GetValue(x, y, z),
                                             alpha));
                }
                else
                {
                    // Output value from the control module is above the selector threshold;
                    // return the output value from the first source module.
                    return(SourceModule1.GetValue(x, y, z));
                }
            }
            else
            {
                if (controlValue < LowerBound || controlValue > UpperBound)
                {
                    return(SourceModule1.GetValue(x, y, z));
                }
                else
                {
                    return(SourceModule2.GetValue(x, y, z));
                }
            }
        }
Пример #13
0
 public ProNav(ControlModule controller, double navGain = 3)
 {
     NavGain         = navGain;
     this.controller = controller;
 }
Пример #14
0
        public override UnityEngine.Color GetColour(double x, double y)
        {
            double controlValue = ControlModule.GetValue(x, y);
            float  alpha;

            double lowerBound  = LowerBound.GetValue(x, y);
            double upperBound  = UpperBound.GetValue(x, y);
            double edgeFalloff = EdgeFalloff.GetValue(x, y);

            if (edgeFalloff > 0.0)
            {
                if (controlValue < (lowerBound - edgeFalloff))
                {
                    // The output value from the control module is below the selector
                    // threshold; return the output value from the first source module.
                    return(SourceModule1.GetColour(x, y));
                }
                else if (controlValue < (lowerBound + edgeFalloff))
                {
                    // The output value from the control module is near the lower end of the
                    // selector threshold and within the smooth curve. Interpolate between
                    // the output values from the first and second source modules.
                    double lowerCurve = (lowerBound - edgeFalloff);
                    double upperCurve = (lowerBound + edgeFalloff);
                    alpha = (float)Loonim.Math.SCurve3((controlValue - lowerCurve) / (upperCurve - lowerCurve));
                    return(Loonim.Math.LinearInterpolate(SourceModule1.GetColour(x, y),
                                                         SourceModule2.GetColour(x, y), alpha));
                }
                else if (controlValue < (upperBound - edgeFalloff))
                {
                    // The output value from the control module is within the selector
                    // threshold; return the output value from the second source module.
                    return(SourceModule2.GetColour(x, y));
                }
                else if (controlValue < (upperBound + edgeFalloff))
                {
                    // The output value from the control module is near the upper end of the
                    // selector threshold and within the smooth curve. Interpolate between
                    // the output values from the first and second source modules.
                    double lowerCurve = (upperBound - edgeFalloff);
                    double upperCurve = (upperBound + edgeFalloff);
                    alpha = (float)Loonim.Math.SCurve3(
                        (controlValue - lowerCurve) / (upperCurve - lowerCurve));
                    return(Loonim.Math.LinearInterpolate(SourceModule2.GetColour(x, y),
                                                         SourceModule1.GetColour(x, y),
                                                         alpha));
                }
                else
                {
                    // Output value from the control module is above the selector threshold;
                    // return the output value from the first source module.
                    return(SourceModule1.GetColour(x, y));
                }
            }
            else
            {
                if (controlValue < lowerBound || controlValue > upperBound)
                {
                    return(SourceModule1.GetColour(x, y));
                }
                else
                {
                    return(SourceModule2.GetColour(x, y));
                }
            }
        }
 public Test发射机_脉冲前后沿(PowerMeterBase powermeter, SignalGeneratorBase signal, ControlModule control, WaveformGeneratorBase wave) : base(powermeter, signal, control, wave)
 {
 }
Пример #16
0
 // Use this for initialization
 void Start()
 {
     cm = GameObject.Find("GameController").GetComponent<ControlModule>();
 }
Пример #17
0
 private void Initialize()
 {
     this.Block      = null;
     this.Connection = null;
     this.Decoder    = null;
 }