Example #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WFS210.Trigger"/> class.
 /// </summary>
 /// <param name="level">Trigger level.</param>
 /// <param name="slope">Trigger slope.</param>
 /// <param name="mode">Trigger mode.</param>
 /// <param name="channel">Triggering channel.</param>
 public Trigger(int level, TriggerSlope slope, TriggerMode mode, int channel = 0)
 {
     Slope   = slope;
     Level   = level;
     Mode    = mode;
     Channel = channel;
 }
        public Message()
        {
            this._headNumber = 1;
            this._messageNumber = 1;
            this._messageTitle = DateTime.Now.Ticks.ToString().Substring(0, 8);

            this._generalParametersPresent = true;
            this._messageTestPresent = true;
            this._numberOfCounters = 0;
            this._numberOfPostdates = 0;
            this._presentTimeCodes = false;
            this._numberOfBarcodes = 0;

            this._messageDirection = MessageDirection.Normal;
            this._horizontalDirection = HorizontalDirection.Normal;
            this._verticalDirection = VerticalDirection.Normal;
            this._tachoMode = TachoMode.No;
            this._manualTrigger = ManualTrigger.Yes;
            this._triggerMode = TriggerMode.Object;
            this._unitForMargins = UnitForMargins.Millimeters;
            this._dinMode = DINMode.No;

            this._mulitTopValue = 0;
            this._objectTopFilter = 1;
            this._tachoDivision = 1;
            this._forwardMargin = 3;
            this._returnMargin = 3;
            this._interval = 3;
            this._printingSpeed = 100;
            this._algorithmNumber = 0;

            this.Lines = new List<Line>();
        }
Example #3
0
        public AlertTrigger(
            string deviceName,
            double thresholdValueInBytes,
            TriggerMode mode,
            MeasurementUnit eventUnit)
        {
            if (String.IsNullOrWhiteSpace(deviceName))
            {
                throw new ArgumentNullException($"Specify {nameof(deviceName)}");
            }
            if (thresholdValueInBytes <= 0)
            {
                throw new ArgumentException($"{nameof(thresholdValueInBytes)} should be greater than zero");
            }

            DeviceName = deviceName.EndsWith(":\\")
                ? deviceName
                : $"{deviceName}:\\";
            ThresholdValueInBytes = thresholdValueInBytes;
            Mode = mode;
            if (mode == TriggerMode.Accuracy)
            {
                var temp = new DiskSize(thresholdValueInBytes, eventUnit);
                ThresholdValueInBytes = temp.ConvertTo(MeasurementUnit.Byte).Size;
            }
            EventUnit = eventUnit;
        }
        public Message()
        {
            this._headNumber    = 1;
            this._messageNumber = 1;
            this._messageTitle  = DateTime.Now.Ticks.ToString().Substring(0, 8);

            this._generalParametersPresent = true;
            this._messageTestPresent       = true;
            this._numberOfCounters         = 0;
            this._numberOfPostdates        = 0;
            this._presentTimeCodes         = false;
            this._numberOfBarcodes         = 0;

            this._messageDirection    = MessageDirection.Normal;
            this._horizontalDirection = HorizontalDirection.Normal;
            this._verticalDirection   = VerticalDirection.Normal;
            this._tachoMode           = TachoMode.No;
            this._manualTrigger       = ManualTrigger.Yes;
            this._triggerMode         = TriggerMode.Object;
            this._unitForMargins      = UnitForMargins.Millimeters;
            this._dinMode             = DINMode.No;

            this._mulitTopValue   = 0;
            this._objectTopFilter = 1;
            this._tachoDivision   = 1;
            this._forwardMargin   = 3;
            this._returnMargin    = 3;
            this._interval        = 3;
            this._printingSpeed   = 100;
            this._algorithmNumber = 0;

            this.Lines = new List <Line>();
        }
Example #5
0
 public void Initialize(string eventName, string referencedBehavior, TriggerMode mode, bool once)
 {
     this.m_event = AgentMeta.ParseMethod(eventName, ref this.m_eventName);
     this.m_referencedBehaviorPath = referencedBehavior;
     this.m_triggerMode            = mode;
     this.m_bTriggeredOnce         = once;
 }
Example #6
0
 public void AddModifier(TriggerMode mode, IModifier modifier)
 {
     if (modifier != null)
     {
         this.modifiers[mode].Add(modifier.Name, modifier);
     }
 }
Example #7
0
 protected override void load(int version, string agentType, List <property_t> properties)
 {
     base.load(version, agentType, properties);
     foreach (property_t _t in properties)
     {
         if (_t.name == "EventName")
         {
             this.m_event = behaviac.Action.LoadMethod(_t.value);
         }
         else if (_t.name == "ReferenceFilename")
         {
             this.m_referencedBehaviorPath = _t.value;
         }
         else if (_t.name == "TriggeredOnce")
         {
             if (_t.value == "true")
             {
                 this.m_bTriggeredOnce = true;
             }
         }
         else if (_t.name == "TriggerMode")
         {
             if (_t.value == "Transfer")
             {
                 this.m_triggerMode = TriggerMode.TM_Transfer;
             }
             else if (_t.value == "Return")
             {
                 this.m_triggerMode = TriggerMode.TM_Return;
             }
         }
     }
 }
Example #8
0
 public EventPage()
 {
     this.Name          = "Untitled Page";
     this.Graphic       = new EventGraphic();
     this.TriggerMode   = TriggerMode.Action;
     this.AutoMoveRoute = new AutoMoveRoute();
     this.Settings      = new EventSettings();
 }
 private void _btsetcurrent(string relativePath, TriggerMode triggerMode, bool bByEvent)
 {
     if (!string.IsNullOrEmpty(relativePath))
     {
         if (!Workspace.Load(relativePath))
         {
             string text = base.GetType().get_FullName();
             text += "::";
             text += base.name;
         }
         else
         {
             Workspace.RecordBTAgentMapping(relativePath, this);
             if (this.m_currentBT != null)
             {
                 if (triggerMode == TriggerMode.TM_Return)
                 {
                     Agent.BehaviorTreeStackItem_t item = new Agent.BehaviorTreeStackItem_t(this.m_currentBT, triggerMode, bByEvent);
                     this.BTStack.Add(item);
                 }
                 else if (triggerMode == TriggerMode.TM_Transfer)
                 {
                     this.m_currentBT.abort(this);
                     this.m_currentBT.reset(this);
                 }
             }
             BehaviorTreeTask behaviorTreeTask = null;
             for (int i = 0; i < this.BehaviorTreeTasks.Count; i++)
             {
                 BehaviorTreeTask behaviorTreeTask2 = this.BehaviorTreeTasks[i];
                 if (behaviorTreeTask2.GetName() == relativePath)
                 {
                     behaviorTreeTask = behaviorTreeTask2;
                     break;
                 }
             }
             bool flag = false;
             if (behaviorTreeTask != null && this.BTStack.Count > 0)
             {
                 for (int j = 0; j < this.BTStack.Count; j++)
                 {
                     Agent.BehaviorTreeStackItem_t behaviorTreeStackItem_t = this.BTStack[j];
                     if (behaviorTreeStackItem_t.bt.GetName() == relativePath)
                     {
                         flag = true;
                         break;
                     }
                 }
             }
             if (behaviorTreeTask == null || flag)
             {
                 behaviorTreeTask = Workspace.CreateBehaviorTreeTask(relativePath);
                 this.BehaviorTreeTasks.Add(behaviorTreeTask);
             }
             this.m_currentBT = behaviorTreeTask;
         }
     }
 }
Example #10
0
        public Sweep() : base()
        {
            start       = -1;
            stop        = 1;
            time        = 10;
            triggerMode = TriggerMode.Manual;

            init();
        }
Example #11
0
        public Sweep(SystemPanel _owner, BinaryReader src) : base(_owner, src)
        {
            start       = src.ReadDouble();
            stop        = src.ReadDouble();
            time        = src.ReadDouble();
            triggerMode = (TriggerMode)src.ReadInt32();

            init();
        }
Example #12
0
 private void _btsetcurrent(string relativePath, TriggerMode triggerMode, bool bByEvent)
 {
     if (!string.IsNullOrEmpty(relativePath))
     {
         if (!Workspace.Load(relativePath))
         {
             string str = base.GetType().FullName + "::" + base.name;
         }
         else
         {
             Workspace.RecordBTAgentMapping(relativePath, this);
             if (this.m_currentBT != null)
             {
                 if (triggerMode == TriggerMode.TM_Return)
                 {
                     BehaviorTreeStackItem_t _t = new BehaviorTreeStackItem_t(this.m_currentBT, triggerMode, bByEvent);
                     this.BTStack.Add(_t);
                 }
                 else if (triggerMode == TriggerMode.TM_Transfer)
                 {
                     this.m_currentBT.abort(this);
                     this.m_currentBT.reset(this);
                 }
             }
             BehaviorTreeTask item = null;
             for (int i = 0; i < this.BehaviorTreeTasks.Count; i++)
             {
                 BehaviorTreeTask task2 = this.BehaviorTreeTasks[i];
                 if (task2.GetName() == relativePath)
                 {
                     item = task2;
                     break;
                 }
             }
             bool flag3 = false;
             if ((item != null) && (this.BTStack.Count > 0))
             {
                 for (int j = 0; j < this.BTStack.Count; j++)
                 {
                     BehaviorTreeStackItem_t _t2 = this.BTStack[j];
                     if (_t2.bt.GetName() == relativePath)
                     {
                         flag3 = true;
                         break;
                     }
                 }
             }
             if ((item == null) || flag3)
             {
                 item = Workspace.CreateBehaviorTreeTask(relativePath);
                 this.BehaviorTreeTasks.Add(item);
             }
             this.m_currentBT = item;
         }
     }
 }
Example #13
0
        /// <summary>
        /// 使用频谱仪当前的状态文件
        /// </summary>
        /// <returns></returns>

        /*
         * public override bool SpectrumAnalyzerUseCurrentState(bool isNFMode, out SpecTrumAnalyzerSetting SASetting)
         * {
         *  SASetting = new SpecTrumAnalyzerSetting();
         *  SASetting.NFStateFilePathAndName = @"D:\User_My_Documents\UserTemp.state";
         *  this.SaveState(SASetting.NFStateFilePathAndName);
         *  SpectrumAnalyzerConfigurationRead(isNFMode,  SASetting);
         *
         *
         *
         *
         *
         *  return true;
         * }
         *
         *
         * /// <summary>
         * /// 使用频谱仪指定的状态文件
         * /// </summary>
         * /// <returns></returns>
         * public override bool SpectrumAnalyzerUseSelectedState(bool isNFMode, string stateFilepPathAndName, SpecTrumAnalyzerSetting SASetting)
         * {
         *  this.LoadStateFromPath(stateFilepPathAndName);
         *  SASetting.NFStateFilePathAndName = stateFilepPathAndName;
         *  SpectrumAnalyzerConfigurationRead(isNFMode,  SASetting);
         *  return true;
         * }
         *
         */



        //杨飞添加驱动 2016.01.07

        #region  频谱仪触发模式

        /// <summary>
        /// 设置频谱仪触发模式
        /// </summary>
        /// <param name="value">状态模式</param>
        private void SetTriggerMode(TriggerMode value)
        {
            string str;

            switch (value)
            {
            case SpectrumAnalyzer.TriggerMode.Immediate:
            {
                str = "IMMediate";
                break;
            }

            case SpectrumAnalyzer.TriggerMode.Extern:
            {
                str = "EXTernal";
                break;
            }

            case SpectrumAnalyzer.TriggerMode.Ext1:
            {
                str = "EXTernal";
                break;
            }

            case SpectrumAnalyzer.TriggerMode.Ext2:
            {
                str = "EXTernal2";
                break;
            }

            case SpectrumAnalyzer.TriggerMode.RFBurst:
            {
                str = "RFBurst";
                break;
            }

            case SpectrumAnalyzer.TriggerMode.Video:
            {
                str = "VIDeo";
                break;
            }

            case SpectrumAnalyzer.TriggerMode.Line:
            {
                str = "LINE";
                break;
            }

            default:
            {
                goto case SpectrumAnalyzer.TriggerMode.Immediate;
            }
            }
            this.Send(string.Format(":TRIG:SOUR {0}", new object[] { str }));
            this.WaitOpc();
        }
 public void CITIROC_SetTriggerMode(TriggerMode TM)
 {
     if (ConnectedAsic == t_AsicModels.PETIROC)
     {
         ;
     }
     if (ConnectedAsic == t_AsicModels.CITIROC)
     {
         CitirocClass.SelectTriggerMode(TM);
     }
 }
Example #15
0
        private void ShowComletion(TextArea textArea, string triggerChar, TriggerMode triggerMode)
        {
            if (triggerChar == ".")
            {
                DotComletion(textArea, triggerMode);
            }
            else if (triggerChar == "{")
            {
                completionWindow = GetCompletionWindow(textArea);
                IList <ICompletionData> data = completionWindow.CompletionList.CompletionData;
                GetDataFromQuickerVars(data);


                if (data.Count() > 0)
                {
                    completionWindow.Show();
                }
                completionWindow.Closed += delegate
                {
                    completionWindow = null;
                };
            }
            else if (char.IsLetterOrDigit(triggerChar[0]))
            {
                if (completionWindow == null)
                {
                    if (triggerMode != TriggerMode.Active && char.IsLetterOrDigit(textArea.GetAheadText(2)[0]))
                    {
                        return;
                    }
                    LetterCompletion(textArea, triggerMode);
                }
            }
            else if (PairChars.Any(x => x[0] == triggerChar || x[1] == triggerChar))
            {
                if (PairChars.Any(x => x[1] == triggerChar) && this.IsClosingBrackets)
                {
                    if (textArea.GetBehindText(1) == triggerChar)
                    {
                        //textArea.RemoveBehindText(1);
                        textArea.Document.UndoStack.Undo();
                        textArea.Caret.Offset++;
                        this.IsClosingBrackets = false;
                    }
                }
                else if (PairChars.Any(x => x[0] == triggerChar))
                {
                    //textArea.Selection.ReplaceSelectionWithText("\"");
                    textArea.Document.Insert(textArea.Caret.Offset, PairChars.First(x => x[0] == triggerChar)[1]);
                    textArea.Caret.Offset -= 1;
                    this.IsClosingBrackets = true;
                }
            }
        }
Example #16
0
            public bool IsSelectTriggerType(TriggerMode type)
            {
                int index  = 1 << (int)type;
                int result = (int)m_TriggerMode;

                if ((result & index) == index)
                {
                    return(true);
                }
                return(false);
            }
Example #17
0
 public TriggerValue(TriggerValue t) : this()
 {
     mode          = t.mode;
     source        = t.source;
     channel       = t.channel;
     Digital       = new Dictionary <DigitalChannel, DigitalTriggerValue>(t.Digital);
     edge          = t.edge;
     level         = t.level;
     pulseWidthMax = t.pulseWidthMax;
     pulseWidthMin = t.pulseWidthMin;
 }
Example #18
0
 /// <summary>Constructor</summary>
 public ActionSettings(Mode action)
 {
     m_Action                 = action;
     m_Target                 = null;
     m_BoostAmount            = 0;
     m_StartTime              = 0;
     m_Mode                   = TimeMode.FromStart;
     m_BeforeEvent            = new TriggerEvent();
     m_AfterEvent             = new TriggerEvent();
     m_TriggerMode            = (TriggerMode)(1 << (int)TriggerMode.Collider);
     m_TriggerInputAxisName   = "";
     m_TriggerInputButtonName = "";
 }
Example #19
0
        public void switchTo(Agent pAgent)
        {
            if (!string.IsNullOrEmpty(this.m_referencedBehaviorPath))
            {
                if (pAgent != null)
                {
                    TriggerMode tm = this.GetTriggerMode();

                    pAgent.bteventtree(pAgent, this.m_referencedBehaviorPath, tm);
                    pAgent.btexec();
                }
            }
        }
Example #20
0
        private void UpdateTriggerPolarity(TriggerMode triggerMode)
        {
            bool isPolarityLow = triggerMode.polarity == 0;

            if (isPolarityLow == true)
            {
                m_lowPolarityButton.Checked = true;
            }
            else
            {
                m_highPolarityButton.Checked = true;
            }
        }
Example #21
0
        private void UpdateTriggerPolarity(TriggerMode triggerMode)
        {
            bool isPolarityLow = triggerMode.parameter == 0;

            if (m_lowPolarityButton.Checked == true && isPolarityLow == false)
            {
                m_highPolarityButton.Checked = true;
            }
            else if (m_highPolarityButton.Checked == true && isPolarityLow == true)
            {
                m_lowPolarityButton.Checked = true;
            }
        }
Example #22
0
            protected override EBTStatus update(Agent pAgent, EBTStatus childStatus)
            {
                EBTStatus status = EBTStatus.BT_SUCCESS;
                Event     node   = base.GetNode() as Event;

                if (!string.IsNullOrEmpty(node.m_referencedBehaviorPath) && (pAgent != null))
                {
                    TriggerMode triggerMode = this.GetTriggerMode();
                    pAgent.bteventtree(node.m_referencedBehaviorPath, triggerMode);
                    pAgent.btexec();
                }
                return(status);
            }
        public async Task NotifyAsync(
            TriggerMode mode,
            DriveInfo driveInfo,
            MeasurementUnit unit,
            double thresholdValueInBytes,
            string machineName,
            CancellationToken token)
        {
            if (!IsEnabled)
            {
                return;
            }

            var diskSize = new DiskSize(driveInfo.AvailableFreeSpace);

            diskSize = diskSize.ConvertTo(unit);
            var messageBody = mode == TriggerMode.Accuracy
                ? $"Available - <b>{diskSize}</b>, limit - <b>{new DiskSize(thresholdValueInBytes).ConvertTo(unit)}</b>"
                : $"Available - <b>{Math.Round((double)driveInfo.AvailableFreeSpace/driveInfo.TotalSize*100, 2)}%</b>, limit - <b>{thresholdValueInBytes*100}%</b>";
            var message = "<p><b>Warning</b> </p>" +
                          $"<p>Not enough free space for drive <b>{driveInfo.Name}</b>. </p>" +
                          $"<p>{messageBody}</p>" +
                          $"<p>Machine name - <b>{machineName}</b></p>";

            foreach (var emailAddress in _emails)
            {
                var email = Email
                            .From(_config.Email)
                            .To(emailAddress)
                            .Subject($"Alert triggered on machine {machineName}")
                            .Body(message, true);

                var response = await email.SendAsync(token);

                if (!response.Successful)
                {
                    foreach (var responseErrorMessage in response.ErrorMessages)
                    {
                        _logger.LogWarning($"Error on sending email to {emailAddress}. " +
                                           $"Error message: {responseErrorMessage}");
                    }
                }
                else
                {
                    _logger.LogInformation($"Email successfully sent to {emailAddress}");
                }
            }
        }
Example #24
0
        public bool CamConnection(uint[] serialList)
        {
            NumCameras = serialList.Length;
            ManagedBusManager busMgr = new ManagedBusManager();

            mCameras = new ManagedGigECamera[NumCameras];

            for (uint i = 0; i < NumCameras; i++)
            {
                if (serialList[i] == 0)
                {
                    continue;
                }

                mCameras[i] = new ManagedGigECamera();

                try
                {
                    ManagedPGRGuid guid = busMgr.GetCameraFromSerialNumber(serialList[i]);

                    // Connect to a camera
                    mCameras[i].Connect(guid);

                    // Turn trigger mode off
                    TriggerMode trigMode = new TriggerMode();
                    trigMode.onOff = false;
                    mCameras[i].SetTriggerMode(trigMode);

                    // Turn Timestamp on
                    EmbeddedImageInfo imageInfo = new EmbeddedImageInfo();
                    imageInfo.timestamp.onOff = true;
                    mCameras[i].SetEmbeddedImageInfo(imageInfo);

                    //IsConnected[i] = true;

                    GV.IsCameraConnected = true;
                }
                catch (Exception ex)
                {
                    //IsConnected[i] = false;

                    GV.IsCameraConnected = false;
                    return(false);
                }
            }
            return(true);
        }
        public async Task WaitForTrigger(TriggerMode mode)
        {
            var newTcs = new TaskCompletionSource <TriggerData>();

            var currentTcs = Interlocked.CompareExchange(ref _waitForTriggerTcs, newTcs, null);

            if (currentTcs != null)
            {
                await currentTcs.Task.ConfigureAwait(false);
            }
            else
            {
                using (
                    this.Provider.DataSource.Subscribe(
                        data =>
                {
                    if (data.TriggerMode == mode)
                    {
                        newTcs.SetResult(data);
                    }
                    else
                    {
                        newTcs.SetException(new InvalidOperationException(string.Format("Received TriggerMode ('{0}') was not the one expected ('{1}')", data.TriggerMode, mode)));
                    }
                }))
                {
                    switch (mode)
                    {
                    case TriggerMode.Start:
                        await this.Provider.SetStartTriggerState(true).ConfigureAwait(false);

                        break;

                    case TriggerMode.Stop:
                        await this.Provider.SetStopTriggerState(true).ConfigureAwait(false);

                        break;

                    default:
                        throw new NotSupportedException(string.Format("TriggerMode '{0}' is not supported.", mode));
                    }

                    await newTcs.Task.ContinueWith(t => _waitForTriggerTcs = null).ConfigureAwait(false);
                }
            }
        }
Example #26
0
        public void switchTo(Agent pAgent, Dictionary <uint, IInstantiatedVariable> eventParams)
        {
            if (!string.IsNullOrEmpty(this.m_referencedBehaviorPath))
            {
                if (!System.Object.ReferenceEquals(pAgent, null))
                {
                    TriggerMode tm = this.GetTriggerMode();

                    pAgent.bteventtree(pAgent, this.m_referencedBehaviorPath, tm);

                    Debug.Check(pAgent.CurrentBT != null);
                    pAgent.CurrentBT.AddVariables(eventParams);

                    pAgent.btexec();
                }
            }
        }
Example #27
0
            protected override EBTStatus update(Agent pAgent, EBTStatus childStatus)
            {
                EBTStatus result     = EBTStatus.BT_SUCCESS;
                Event     pEventNode = this.GetNode() as Event;

                if (!string.IsNullOrEmpty(pEventNode.m_referencedBehaviorPath))
                {
                    if (pAgent != null)
                    {
                        TriggerMode tm = this.GetTriggerMode();

                        pAgent.bteventtree(pEventNode.m_referencedBehaviorPath, tm);
                        pAgent.btexec();
                    }
                }

                return(result);
            }
Example #28
0
    public override void Handle(GameSession session, PacketReader packet)
    {
        TriggerMode mode = (TriggerMode)packet.ReadByte();

        switch (mode)
        {
        case TriggerMode.SkipCutscene:
            HandleSkipCutscene(session);
            break;

        case TriggerMode.UpdateWidget:
            HandleUpdateWidget(session, packet);
            break;

        default:
            LogUnknownMode(mode);
            break;
        }
    }
Example #29
0
        public bool SetContinue(TriggerMode mode)
        {
            byte ProgNo = 0x10;

            ProgNo += GetActiveProgram();

            if (ProgNo == 0xFF)
            {
                return(false);
            }

            //p62 Trigger mode
            //  0: Continuous trigger,
            //  1: External trigger,
            //  2: Encoder trigger
            return(SetSetting(0x00, 0x01, ProgNo, null, new byte[1] {
                Convert.ToByte(mode)
            }));
        }
        public Task NotifyAsync(
            TriggerMode mode,
            DriveInfo driveInfo,
            MeasurementUnit unit,
            double thresholdValueInBytes,
            string machineName,
            CancellationToken token)
        {
            var tasks = _channels.Select(x =>
                                         x.NotifyAsync(
                                             mode,
                                             driveInfo,
                                             unit,
                                             thresholdValueInBytes,
                                             machineName,
                                             token));

            return(Task.WhenAll(tasks));
        }
        protected override void load(int version, string agentType, List<property_t> properties)
        {
            base.load(version, agentType, properties);

            foreach (property_t p in properties)
            {
                if (p.name == "EventName")
                {
                    //method
                    this.m_event = Action.LoadMethod(p.value);
                }
                else if (p.name == "ReferenceFilename")
                {
                    this.m_referencedBehaviorPath = p.value;
                }
                else if (p.name == "TriggeredOnce")
                {
                    if (p.value == "true")
                    {
                        this.m_bTriggeredOnce = true;
                    }
                }
                else if (p.name == "TriggerMode")
                {
                    if (p.value == "Transfer")
                    {
                        this.m_triggerMode = TriggerMode.TM_Transfer;
                    }
                    else if (p.value == "Return")
                    {
                        this.m_triggerMode = TriggerMode.TM_Return;
                    }
                    else
                    {
                        Debug.Check(false, string.Format("unrecognised trigger mode {0}", p.value));
                    }
                }
                else
                {
                    //Debug.Check(0, "unrecognised property %s", p.name);
                }
            }
        }
Example #32
0
        private void UpdateActiveTriggerSource(TriggerMode triggerMode)
        {
            uint pinToDisable = triggerMode.source;

            if (pinToDisable < k_numOfPins)
            {
                switch (pinToDisable)
                {
                case 0:
                    m_triggerSource_0_Button.Checked = true;
                    break;

                case 1:
                    m_triggerSource_1_Button.Checked = true;
                    break;

                case 2:
                    m_triggerSource_2_Button.Checked = true;
                    break;

                case 3:
                    m_triggerSource_3_Button.Checked = true;
                    break;
                }
            }
            else
            {
                m_triggerSource_None_Button.Checked = true;
            }

            for (uint i = 0; i < k_numOfPins; i++)
            {
                if (i == pinToDisable)
                {
                    m_strobeControls[i].Enabled = false;
                }
                else
                {
                    m_strobeControls[i].Enabled = true;
                }
            }
        }
Example #33
0
 public static extern bool SCA_SetTriggerMode(TriggerMode mode);
Example #34
0
        private async Task ShowCompletion(TriggerMode triggerMode)
        {
            if (CompletionProvider == null)
            {
                return;
            }

            int offset;
            GetCompletionDocument(out offset);
            var completionChar = triggerMode == TriggerMode.Text ? Document.GetCharAt(offset - 1) : (char?)null;
            var results = await CompletionProvider.GetCompletionData(offset, completionChar,
                        triggerMode == TriggerMode.SignatureHelp).ConfigureAwait(true);
            if (results.OverloadProvider != null)
            {
                results.OverloadProvider.Refresh();

                if (_insightWindow != null && _insightWindow.IsVisible)
                {
                    _insightWindow.Provider = results.OverloadProvider;
                }
                else
                {
                    _insightWindow = new OverloadInsightWindow(TextArea)
                    {
                        Provider = results.OverloadProvider,
                        Background = CompletionBackground,
                        Style = TryFindResource(typeof(InsightWindow)) as Style
                    };
                    _insightWindow.Show();
                    _insightWindow.Closed += (o, args) => _insightWindow = null;
                }
                return;
            }

            if (_completionWindow == null && results.CompletionData?.Any() == true)
            {
                _insightWindow?.Close();

                // Open code completion after the user has pressed dot:
                _completionWindow = new CompletionWindow(TextArea)
                {
                    MinWidth = 200,
                    Background = CompletionBackground,
                    CloseWhenCaretAtBeginning = triggerMode == TriggerMode.Completion
                };
                if (completionChar != null && char.IsLetterOrDigit(completionChar.Value))
                {
                    _completionWindow.StartOffset -= 1;
                }

                var data = _completionWindow.CompletionList.CompletionData;
                ICompletionDataEx selected = null;
                foreach (var completion in results.CompletionData) //.OrderBy(item => item.SortText))
                {
                    if (completion.IsSelected)
                    {
                        selected = completion;
                    }
                    data.Add(completion);
                }
                if (selected != null)
                {
                    _completionWindow.CompletionList.SelectedItem = selected;
                }
                _completionWindow.Show();
                _completionWindow.Closed += (o, args) => { _completionWindow = null; };
            }
        }
Example #35
0
 public void AddModifier(TriggerMode mode, IModifier modifier)
 {
     if (modifier != null)
     {
         this.modifiers[mode].Add(modifier.Name, modifier);
     }
 }
Example #36
0
        private void ProcessTriggerOption(byte data)
        {
            if ((data & 1) != 0) _channelTriggerType = TriggerType.Normal;
            else if ((data & 2) != 0) _channelTriggerType = TriggerType.Single;
            else if ((data & 4) != 0) _channelTriggerType = TriggerType.Auto;
            else _channelTriggerType = TriggerType.Free;

            if ((data & 128) != 0)
            {      // edge
                _channelTriggerMode = (data & 8) != 0 ? TriggerMode.FallingEdge : TriggerMode.RisingEdge;
            }
            else if ((data & 32) != 0)
            { // slope
                _channelTriggerMode = (data & 8) != 0 ? TriggerMode.NegativeSlope : TriggerMode.PositiveSlope;
            }
            else if ((data & 64) != 0) _channelTriggerMode = TriggerMode.Window;
            else _channelTriggerMode = TriggerMode.DualEdge;

            _protocolIsCircular = ((data & 16) != 0);

            OnPropertyChanged("ChannelTriggerType");
            OnPropertyChanged("ChannelTriggerMode");
            OnPropertyChanged("IsProtocolCircular");
        }
 public Event()
 {
     m_bTriggeredOnce = false;
     m_triggerMode = TriggerMode.TM_Transfer;
 }
Example #38
0
		public void Initialize(string eventName, string referencedBehavior, TriggerMode mode, bool once)
		{
			this.m_event = AgentMeta.ParseMethod(eventName, ref this.m_eventName);
			this.m_referencedBehaviorPath = referencedBehavior;
			this.m_triggerMode = mode;
			this.m_bTriggeredOnce = once;
		}