Esempio n. 1
0
 public Symbol.RFID3.TriggerInfo getTriggerInfo()
 {
     if (null == m_TriggerInfo)
     {
         m_TriggerInfo = new TriggerInfo();
     }
     //m_TriggerInfo.EnableTagEventReport = m_AppForm.autonomousMode_CB.Checked;
     return m_TriggerInfo;
 }
Esempio n. 2
0
 /// <summary>
 /// Get Trigger
 /// </summary>
 /// <returns></returns>
 public Symbol.RFID3.TriggerInfo GetTriggerInfo()
 {
     if (null == m_TriggerInfo)
     {
         m_TriggerInfo = new TriggerInfo();
     }
     m_TriggerInfo.EnableTagEventReport = false;
     return(m_TriggerInfo);
 }
 public Symbol.RFID3.TriggerInfo getTriggerInfo()
 {
     if (null == m_TriggerInfo)
     {
         m_TriggerInfo = new TriggerInfo();
         Reset();
         fetchTriggerParams();
     }
     else
     {
     }
     m_TriggerInfo.EnableTagEventReport = m_AppForm.autonomousMode_CB.Checked;
     return(m_TriggerInfo);
 }
        private void fetchTriggerParams()
        {
            if (null == m_TriggerInfo)
            {
                m_TriggerInfo = new TriggerInfo();
            }

            if (startTriggerType_CB.SelectedIndex == (int)START_TRIGGER_TYPE.START_TRIGGER_TYPE_IMMEDIATE)
            {
                m_TriggerInfo.StartTrigger.Type = START_TRIGGER_TYPE.START_TRIGGER_TYPE_IMMEDIATE;
            }
            else if (startTriggerType_CB.SelectedIndex == (int)START_TRIGGER_TYPE.START_TRIGGER_TYPE_PERIODIC)
            {
                m_TriggerInfo.StartTrigger.Type = START_TRIGGER_TYPE.START_TRIGGER_TYPE_PERIODIC;

                m_TriggerInfo.StartTrigger.Periodic.StartTime = startDate_PK.Value.ToUniversalTime();
                m_TriggerInfo.StartTrigger.Periodic.Period    = uint.Parse(startPeriod_TB.Text);
            }
            else if (startTriggerType_CB.SelectedIndex == (int)START_TRIGGER_TYPE.START_TRIGGER_TYPE_GPI)
            {
                m_TriggerInfo.StartTrigger.Type           = START_TRIGGER_TYPE.START_TRIGGER_TYPE_GPI;
                m_TriggerInfo.StartTrigger.GPI.PortNumber = startPort_CB.SelectedIndex + 1;
                if (lowToHigh_CB.Checked)
                {
                    m_TriggerInfo.StartTrigger.GPI.GPIEvent = false;
                }
                else
                {
                    m_TriggerInfo.StartTrigger.GPI.GPIEvent = true;
                }

                if (highToLow_CB.Checked)
                {
                    m_TriggerInfo.StartTrigger.GPI.GPIEvent = false;
                }
                else
                {
                    m_TriggerInfo.StartTrigger.GPI.GPIEvent = true;
                }
            }
            else if (startTriggerType_CB.SelectedIndex == (int)START_TRIGGER_TYPE.START_TRIGGER_TYPE_HANDHELD)
            {
                m_TriggerInfo.StartTrigger.Type = START_TRIGGER_TYPE.START_TRIGGER_TYPE_HANDHELD;

                if (startTriggerPressed_CB.Checked)
                {
                    m_TriggerInfo.StartTrigger.Handheld.HandheldEvent = HANDHELD_TRIGGER_EVENT_TYPE.HANDHELD_TRIGGER_PRESSED;
                }
                else
                {
                    m_TriggerInfo.StartTrigger.Handheld.HandheldEvent = HANDHELD_TRIGGER_EVENT_TYPE.HANDHELD_TRIGGER_RELEASED;
                }
            }

            if (stopTriggerType_CB.SelectedIndex == (int)STOP_TRIGGER_TYPE.STOP_TRIGGER_TYPE_IMMEDIATE)
            {
                m_TriggerInfo.StopTrigger.Type = STOP_TRIGGER_TYPE.STOP_TRIGGER_TYPE_IMMEDIATE;
            }
            else if (stopTriggerType_CB.SelectedIndex == (int)STOP_TRIGGER_TYPE.STOP_TRIGGER_TYPE_DURATION)
            {
                m_TriggerInfo.StopTrigger.Type     = STOP_TRIGGER_TYPE.STOP_TRIGGER_TYPE_DURATION;
                m_TriggerInfo.StopTrigger.Duration = uint.Parse(this.stopDuration_TB.Text);
            }
            else if (stopTriggerType_CB.SelectedIndex == (int)STOP_TRIGGER_TYPE.STOP_TRIGGER_TYPE_GPI_WITH_TIMEOUT)
            {
                m_TriggerInfo.StopTrigger.Type           = STOP_TRIGGER_TYPE.STOP_TRIGGER_TYPE_GPI_WITH_TIMEOUT;
                m_TriggerInfo.StopTrigger.GPI.PortNumber = stopGPIPort_CB.SelectedIndex + 1;
                m_TriggerInfo.StopTrigger.GPI.Timeout    = uint.Parse(stopTimeout_TB.Text);

                if (stopEventLH_CB.Checked)
                {
                    m_TriggerInfo.StopTrigger.GPI.GPIEvent = false;
                }
                else
                {
                    m_TriggerInfo.StopTrigger.GPI.GPIEvent = true;
                }
                if (stopEventHL_CB.Checked)
                {
                    m_TriggerInfo.StopTrigger.GPI.GPIEvent = false;
                }
                else
                {
                    m_TriggerInfo.StopTrigger.GPI.GPIEvent = true;
                }
            }
            else if (stopTriggerType_CB.SelectedIndex == (int)STOP_TRIGGER_TYPE.STOP_TRIGGER_TYPE_TAG_OBSERVATION_WITH_TIMEOUT)
            {
                m_TriggerInfo.StopTrigger.Type                   = STOP_TRIGGER_TYPE.STOP_TRIGGER_TYPE_TAG_OBSERVATION_WITH_TIMEOUT;
                m_TriggerInfo.StopTrigger.TagObservation.N       = ushort.Parse(stopTagObservation_TB.Text);
                m_TriggerInfo.StopTrigger.TagObservation.Timeout = uint.Parse(stopTriggerTagOb_TB.Text);
            }
            else if (stopTriggerType_CB.SelectedIndex == (int)STOP_TRIGGER_TYPE.STOP_TRIGGER_TYPE_N_ATTEMPTS_WITH_TIMEOUT)
            {
                m_TriggerInfo.StopTrigger.Type                = STOP_TRIGGER_TYPE.STOP_TRIGGER_TYPE_N_ATTEMPTS_WITH_TIMEOUT;
                m_TriggerInfo.StopTrigger.NumAttempts.N       = ushort.Parse(stopNumAttempt_TB.Text);
                m_TriggerInfo.StopTrigger.NumAttempts.Timeout = uint.Parse(stopTriggerNAttTimeOut_TB.Text);
            }
            else if (stopTriggerType_CB.SelectedIndex == (int)STOP_TRIGGER_TYPE.STOP_TRIGGER_TYPE_HANDHELD_WITH_TIMEOUT)
            {
                m_TriggerInfo.StopTrigger.Type             = STOP_TRIGGER_TYPE.STOP_TRIGGER_TYPE_HANDHELD_WITH_TIMEOUT;
                m_TriggerInfo.StopTrigger.Handheld.Timeout = uint.Parse(handHeldTriggerTimeout_TB.Text);

                if (stopTriggerPressed_CB.Checked)
                {
                    m_TriggerInfo.StopTrigger.Handheld.HandheldEvent = HANDHELD_TRIGGER_EVENT_TYPE.HANDHELD_TRIGGER_PRESSED;
                }
                else
                {
                    m_TriggerInfo.StopTrigger.Handheld.HandheldEvent = HANDHELD_TRIGGER_EVENT_TYPE.HANDHELD_TRIGGER_RELEASED;
                }
            }

            if (m_AppForm.m_ReaderAPI.ReaderCapabilities.IsTagEventReportingSupported)
            {
                m_TriggerInfo.TagEventReportInfo.ReportNewTagEvent = (TAG_EVENT_REPORT_TRIGGER)newTag_CB.SelectedIndex;
                m_TriggerInfo.TagEventReportInfo.ReportTagBackToVisibilityEvent                  = (TAG_EVENT_REPORT_TRIGGER)backTag_CB.SelectedIndex;
                m_TriggerInfo.TagEventReportInfo.ReportTagInvisibleEvent                         = (TAG_EVENT_REPORT_TRIGGER)invisibleTag_CB.SelectedIndex;
                m_TriggerInfo.TagEventReportInfo.NewTagEventModeratedTimeoutMilliseconds         = ushort.Parse(newTag_TB.Text);
                m_TriggerInfo.TagEventReportInfo.TagBackToVisibilityModeratedTimeoutMilliseconds = ushort.Parse(backTag_TB.Text);
                m_TriggerInfo.TagEventReportInfo.TagInvisibleEventModeratedTimeoutMilliseconds   = ushort.Parse(invisibleTag_TB.Text);
            }
            m_TriggerInfo.TagReportTrigger      = uint.Parse(tagReportTriggerTB.Text);
            m_TriggerInfo.ReportTriggers.Period = uint.Parse(PerodicReportTriggerTB.Text);
        }
Esempio n. 5
0
        private void triggerApplyButton_Click(object sender, EventArgs e)
        {
            try
            {
                if (m_AppForm.m_ReaderAPI.IsConnected)
                {
                    if (null == m_TriggerInfo)
                    {
                        m_TriggerInfo = new TriggerInfo();
                    }
                    m_AppForm.m_DurationTriggerTime = 0;

                    if (startTriggerType_CB.SelectedIndex == (int)START_TRIGGER_TYPE.START_TRIGGER_TYPE_IMMEDIATE)
                    {
                        m_TriggerInfo.StartTrigger.Type = START_TRIGGER_TYPE.START_TRIGGER_TYPE_IMMEDIATE;
                    }
                    else if (startTriggerType_CB.SelectedIndex == (int)START_TRIGGER_TYPE.START_TRIGGER_TYPE_PERIODIC)
                    {
                        m_TriggerInfo.StartTrigger.Type = START_TRIGGER_TYPE.START_TRIGGER_TYPE_PERIODIC;

                        m_TriggerInfo.StartTrigger.Periodic.StartTime = this.startDateTimePicker.Value.ToUniversalTime();
                        m_TriggerInfo.StartTrigger.Periodic.Period = uint.Parse(this.startperiod_TB.Text);
                    }
                    else if (startTriggerType_CB.SelectedIndex == (int)START_TRIGGER_TYPE.START_TRIGGER_TYPE_GPI)
                    {
                        m_TriggerInfo.StartTrigger.Type = START_TRIGGER_TYPE.START_TRIGGER_TYPE_GPI;
                        m_TriggerInfo.StartTrigger.GPI.PortNumber = startPort_CB.SelectedIndex + 1;

                        if (this.startLowHigh_CB.Checked || this.startLowHigh_CB.Checked)
                            m_TriggerInfo.StartTrigger.GPI.GPIEvent = true;
                        else
                            m_TriggerInfo.StartTrigger.GPI.GPIEvent = false;
                    }
                    else if (startTriggerType_CB.SelectedIndex == (int)START_TRIGGER_TYPE.START_TRIGGER_TYPE_HANDHELD)
                    {
                        m_TriggerInfo.StartTrigger.Type = START_TRIGGER_TYPE.START_TRIGGER_TYPE_HANDHELD;

                        if (startTriggerPressed_CB.Checked)
                            m_TriggerInfo.StartTrigger.Handheld.HandheldEvent = HANDHELD_TRIGGER_EVENT_TYPE.HANDHELD_TRIGGER_PRESSED;
                        else
                            m_TriggerInfo.StartTrigger.Handheld.HandheldEvent = HANDHELD_TRIGGER_EVENT_TYPE.HANDHELD_TRIGGER_RELEASED;

                    }

                    if (stopTriggerType_CB.SelectedIndex == (int)STOP_TRIGGER_TYPE.STOP_TRIGGER_TYPE_IMMEDIATE)
                    {
                        m_TriggerInfo.StopTrigger.Type = STOP_TRIGGER_TYPE.STOP_TRIGGER_TYPE_IMMEDIATE;
                    }
                    else if (stopTriggerType_CB.SelectedIndex == (int)STOP_TRIGGER_TYPE.STOP_TRIGGER_TYPE_DURATION)
                    {
                        m_TriggerInfo.StopTrigger.Type = STOP_TRIGGER_TYPE.STOP_TRIGGER_TYPE_DURATION;
                        m_TriggerInfo.StopTrigger.Duration = uint.Parse(this.stopDuration_TB.Text);
                        m_AppForm.m_DurationTriggerTime = m_TriggerInfo.StopTrigger.Duration;
                    }
                    else if (stopTriggerType_CB.SelectedIndex == (int)STOP_TRIGGER_TYPE.STOP_TRIGGER_TYPE_GPI_WITH_TIMEOUT)
                    {
                        m_TriggerInfo.StopTrigger.Type = STOP_TRIGGER_TYPE.STOP_TRIGGER_TYPE_GPI_WITH_TIMEOUT;
                        m_TriggerInfo.StopTrigger.GPI.PortNumber = stopPort_CB.SelectedIndex + 1;
                        m_TriggerInfo.StopTrigger.GPI.Timeout = uint.Parse(stopTimeout_TB.Text);

                        if (this.stopLowHigh_CB.Checked || this.stopLowHigh_CB.Checked)
                            m_TriggerInfo.StopTrigger.GPI.GPIEvent = true;
                        else
                            m_TriggerInfo.StopTrigger.GPI.GPIEvent = false;
                    }
                    else if (stopTriggerType_CB.SelectedIndex == (int)STOP_TRIGGER_TYPE.STOP_TRIGGER_TYPE_TAG_OBSERVATION_WITH_TIMEOUT)
                    {
                        m_TriggerInfo.StopTrigger.Type = STOP_TRIGGER_TYPE.STOP_TRIGGER_TYPE_TAG_OBSERVATION_WITH_TIMEOUT;
                        m_TriggerInfo.StopTrigger.TagObservation.N = ushort.Parse(stopTagObservation_TB.Text);
                        m_TriggerInfo.StopTrigger.TagObservation.Timeout = uint.Parse(this.stopTagObservTimeout_TB.Text);
                    }
                    else if (stopTriggerType_CB.SelectedIndex == (int)STOP_TRIGGER_TYPE.STOP_TRIGGER_TYPE_N_ATTEMPTS_WITH_TIMEOUT)
                    {
                        m_TriggerInfo.StopTrigger.Type = STOP_TRIGGER_TYPE.STOP_TRIGGER_TYPE_N_ATTEMPTS_WITH_TIMEOUT;
                        m_TriggerInfo.StopTrigger.NumAttempts.N = ushort.Parse(this.stopNAttempts_TB.Text);
                        m_TriggerInfo.StopTrigger.NumAttempts.Timeout = uint.Parse(this.stopNAttemptsTimeout_TB.Text);
                    }
                    else if (stopTriggerType_CB.SelectedIndex == (int)STOP_TRIGGER_TYPE.STOP_TRIGGER_TYPE_HANDHELD_WITH_TIMEOUT)
                    {
                        m_TriggerInfo.StopTrigger.Type = STOP_TRIGGER_TYPE.STOP_TRIGGER_TYPE_HANDHELD_WITH_TIMEOUT;

                        if (stopTriggerPressed_CB.Checked)
                            m_TriggerInfo.StopTrigger.Handheld.HandheldEvent = HANDHELD_TRIGGER_EVENT_TYPE.HANDHELD_TRIGGER_PRESSED;
                        else
                            m_TriggerInfo.StopTrigger.Handheld.HandheldEvent = HANDHELD_TRIGGER_EVENT_TYPE.HANDHELD_TRIGGER_RELEASED;

                        m_TriggerInfo.StopTrigger.Handheld.Timeout = uint.Parse(this.stopTriggerTimeout_TB.Text);

                    }
                    if (m_AppForm.m_ReaderAPI.ReaderCapabilities.IsTagEventReportingSupported)
                    {
                        m_TriggerInfo.TagEventReportInfo.ReportNewTagEvent = (TAG_EVENT_REPORT_TRIGGER)newTag_CB.SelectedIndex;
                        m_TriggerInfo.TagEventReportInfo.ReportTagBackToVisibilityEvent = (TAG_EVENT_REPORT_TRIGGER)backTag_CB.SelectedIndex;
                        m_TriggerInfo.TagEventReportInfo.ReportTagInvisibleEvent = (TAG_EVENT_REPORT_TRIGGER)invisibleTag_CB.SelectedIndex;
                        m_TriggerInfo.TagEventReportInfo.NewTagEventModeratedTimeoutMilliseconds = ushort.Parse(newTag_TB.Text);
                        m_TriggerInfo.TagEventReportInfo.TagBackToVisibilityModeratedTimeoutMilliseconds = ushort.Parse(backTag_TB.Text);
                        m_TriggerInfo.TagEventReportInfo.TagInvisibleEventModeratedTimeoutMilliseconds = ushort.Parse(invisibleTag_TB.Text);
                    }
                    m_TriggerInfo.TagReportTrigger = uint.Parse(tagReportTriggerTB.Text);
                    this.Close();
                }
                else
                {
                    this.m_AppForm.notifyUser("Please connect to Reader", "Trigger Info");
                }
            }
            catch (Exception ex)
            {
                this.m_AppForm.notifyUser(ex.Message, "Trigger Info");
            }
        }