﻿Option Strict Off
Option Explicit On 
Imports System.Globalization
Imports System.Text

Public Class ConditionDlg
	Inherits System.Windows.Forms.Form

#Region " Windows フォーム デザイナで生成されたコード "

	Public Sub New()
		MyBase.New()

		' この呼び出しは Windows フォーム デザイナで必要です。
		InitializeComponent()

		' InitializeComponent() 呼び出しの後に初期化を追加します。

	End Sub

	' Form は dispose をオーバーライドしてコンポーネント一覧を消去します。
	Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
		If disposing Then
			If Not (components Is Nothing) Then
				components.Dispose()
			End If
		End If
		MyBase.Dispose(disposing)
	End Sub

	' Windows フォーム デザイナで必要です。
	Private components As System.ComponentModel.IContainer

	' メモ : 以下のプロシージャは、Windows フォーム デザイナで必要です。
	' Windows フォーム デザイナを使って変更してください。  
	' コード エディタは使用しないでください。
	Public WithEvents Frame1 As System.Windows.Forms.GroupBox
	Public WithEvents cboClockTrg As System.Windows.Forms.ComboBox
	Public WithEvents cboStopTrg As System.Windows.Forms.ComboBox
	Public WithEvents txtStopNum As System.Windows.Forms.TextBox
	Public WithEvents txtCompStop As System.Windows.Forms.TextBox
	Public WithEvents txtInternalClock As System.Windows.Forms.TextBox
	Public WithEvents txtCompStart As System.Windows.Forms.TextBox
	Public WithEvents cboStartTrg As System.Windows.Forms.ComboBox
	Public WithEvents Label10 As System.Windows.Forms.Label
	Public WithEvents Label9 As System.Windows.Forms.Label
	Public WithEvents Label8 As System.Windows.Forms.Label
	Public WithEvents Label7 As System.Windows.Forms.Label
	Public WithEvents Label6 As System.Windows.Forms.Label
	Public WithEvents Label5 As System.Windows.Forms.Label
	Public WithEvents Label4 As System.Windows.Forms.Label
	Public WithEvents Label3 As System.Windows.Forms.Label
	Public WithEvents Label2 As System.Windows.Forms.Label
	Public WithEvents Label1 As System.Windows.Forms.Label
	Public WithEvents Frame2 As System.Windows.Forms.GroupBox
	Public WithEvents rdoStartCntWithSamp As System.Windows.Forms.RadioButton
	Public WithEvents rdoStartCntNotWithSamp As System.Windows.Forms.RadioButton
	Public WithEvents Frame3 As System.Windows.Forms.GroupBox
	Public WithEvents rdoStopCntWithSamp As System.Windows.Forms.RadioButton
	Public WithEvents rdoStopCntNotWithSamp As System.Windows.Forms.RadioButton
	Public WithEvents btnCancel As System.Windows.Forms.Button
	Public WithEvents btnOK As System.Windows.Forms.Button
	Public WithEvents Frame4 As System.Windows.Forms.GroupBox
	Public WithEvents txtNumEvent As System.Windows.Forms.TextBox
	Public WithEvents Label11 As System.Windows.Forms.Label
	<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
		Me.Frame1 = New System.Windows.Forms.GroupBox()
		Me.cboClockTrg = New System.Windows.Forms.ComboBox()
		Me.cboStopTrg = New System.Windows.Forms.ComboBox()
		Me.txtStopNum = New System.Windows.Forms.TextBox()
		Me.txtCompStop = New System.Windows.Forms.TextBox()
		Me.txtInternalClock = New System.Windows.Forms.TextBox()
		Me.txtCompStart = New System.Windows.Forms.TextBox()
		Me.cboStartTrg = New System.Windows.Forms.ComboBox()
		Me.Label10 = New System.Windows.Forms.Label()
		Me.Label9 = New System.Windows.Forms.Label()
		Me.Label8 = New System.Windows.Forms.Label()
		Me.Label7 = New System.Windows.Forms.Label()
		Me.Label6 = New System.Windows.Forms.Label()
		Me.Label5 = New System.Windows.Forms.Label()
		Me.Label4 = New System.Windows.Forms.Label()
		Me.Label3 = New System.Windows.Forms.Label()
		Me.Label2 = New System.Windows.Forms.Label()
		Me.Label1 = New System.Windows.Forms.Label()
		Me.Frame2 = New System.Windows.Forms.GroupBox()
		Me.rdoStartCntWithSamp = New System.Windows.Forms.RadioButton()
		Me.rdoStartCntNotWithSamp = New System.Windows.Forms.RadioButton()
		Me.Frame3 = New System.Windows.Forms.GroupBox()
		Me.rdoStopCntWithSamp = New System.Windows.Forms.RadioButton()
		Me.rdoStopCntNotWithSamp = New System.Windows.Forms.RadioButton()
		Me.btnCancel = New System.Windows.Forms.Button()
		Me.btnOK = New System.Windows.Forms.Button()
		Me.Frame4 = New System.Windows.Forms.GroupBox()
		Me.txtNumEvent = New System.Windows.Forms.TextBox()
		Me.Label11 = New System.Windows.Forms.Label()
		Me.Frame1.SuspendLayout()
		Me.Frame2.SuspendLayout()
		Me.Frame3.SuspendLayout()
		Me.Frame4.SuspendLayout()
		Me.SuspendLayout()
		'
		'Frame1
		'
		Me.Frame1.BackColor = System.Drawing.SystemColors.Control
		Me.Frame1.Controls.AddRange(New System.Windows.Forms.Control() {Me.cboClockTrg, Me.cboStopTrg, Me.txtStopNum, Me.txtCompStop, Me.txtInternalClock, Me.txtCompStart, Me.cboStartTrg, Me.Label10, Me.Label9, Me.Label8, Me.Label7, Me.Label6, Me.Label5, Me.Label4, Me.Label3, Me.Label2, Me.Label1})
		Me.Frame1.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Frame1.Location = New System.Drawing.Point(9, 8)
		Me.Frame1.Name = "Frame1"
		Me.Frame1.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Frame1.Size = New System.Drawing.Size(457, 121)
		Me.Frame1.TabIndex = 31
		Me.Frame1.TabStop = False
		Me.Frame1.Text = "サンプリング条件"
		'
		'cboClockTrg
		'
		Me.cboClockTrg.BackColor = System.Drawing.SystemColors.Window
		Me.cboClockTrg.Cursor = System.Windows.Forms.Cursors.Default
		Me.cboClockTrg.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
		Me.cboClockTrg.ForeColor = System.Drawing.SystemColors.WindowText
		Me.cboClockTrg.Location = New System.Drawing.Point(83, 45)
		Me.cboClockTrg.Name = "cboClockTrg"
		Me.cboClockTrg.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.cboClockTrg.Size = New System.Drawing.Size(180, 20)
		Me.cboClockTrg.TabIndex = 11
		'
		'cboStopTrg
		'
		Me.cboStopTrg.BackColor = System.Drawing.SystemColors.Window
		Me.cboStopTrg.Cursor = System.Windows.Forms.Cursors.Default
		Me.cboStopTrg.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
		Me.cboStopTrg.ForeColor = System.Drawing.SystemColors.WindowText
		Me.cboStopTrg.Location = New System.Drawing.Point(83, 70)
		Me.cboStopTrg.Name = "cboStopTrg"
		Me.cboStopTrg.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.cboStopTrg.Size = New System.Drawing.Size(180, 20)
		Me.cboStopTrg.TabIndex = 12
		'
		'txtStopNum
		'
		Me.txtStopNum.AcceptsReturn = True
		Me.txtStopNum.AutoSize = False
		Me.txtStopNum.BackColor = System.Drawing.SystemColors.Window
		Me.txtStopNum.Cursor = System.Windows.Forms.Cursors.IBeam
		Me.txtStopNum.ForeColor = System.Drawing.SystemColors.WindowText
		Me.txtStopNum.Location = New System.Drawing.Point(352, 96)
		Me.txtStopNum.MaxLength = 0
		Me.txtStopNum.Name = "txtStopNum"
		Me.txtStopNum.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.txtStopNum.Size = New System.Drawing.Size(65, 18)
		Me.txtStopNum.TabIndex = 28
		Me.txtStopNum.Text = ""
		'
		'txtCompStop
		'
		Me.txtCompStop.AcceptsReturn = True
		Me.txtCompStop.AutoSize = False
		Me.txtCompStop.BackColor = System.Drawing.SystemColors.Window
		Me.txtCompStop.Cursor = System.Windows.Forms.Cursors.IBeam
		Me.txtCompStop.ForeColor = System.Drawing.SystemColors.WindowText
		Me.txtCompStop.Location = New System.Drawing.Point(352, 71)
		Me.txtCompStop.MaxLength = 0
		Me.txtCompStop.Name = "txtCompStop"
		Me.txtCompStop.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.txtCompStop.Size = New System.Drawing.Size(65, 18)
		Me.txtCompStop.TabIndex = 27
		Me.txtCompStop.Text = ""
		'
		'txtInternalClock
		'
		Me.txtInternalClock.AcceptsReturn = True
		Me.txtInternalClock.AutoSize = False
		Me.txtInternalClock.BackColor = System.Drawing.SystemColors.Window
		Me.txtInternalClock.Cursor = System.Windows.Forms.Cursors.IBeam
		Me.txtInternalClock.ForeColor = System.Drawing.SystemColors.WindowText
		Me.txtInternalClock.Location = New System.Drawing.Point(352, 46)
		Me.txtInternalClock.MaxLength = 0
		Me.txtInternalClock.Name = "txtInternalClock"
		Me.txtInternalClock.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.txtInternalClock.Size = New System.Drawing.Size(65, 18)
		Me.txtInternalClock.TabIndex = 26
		Me.txtInternalClock.Text = ""
		'
		'txtCompStart
		'
		Me.txtCompStart.AcceptsReturn = True
		Me.txtCompStart.AutoSize = False
		Me.txtCompStart.BackColor = System.Drawing.SystemColors.Window
		Me.txtCompStart.Cursor = System.Windows.Forms.Cursors.IBeam
		Me.txtCompStart.ForeColor = System.Drawing.SystemColors.WindowText
		Me.txtCompStart.Location = New System.Drawing.Point(352, 21)
		Me.txtCompStart.MaxLength = 0
		Me.txtCompStart.Name = "txtCompStart"
		Me.txtCompStart.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.txtCompStart.Size = New System.Drawing.Size(65, 18)
		Me.txtCompStart.TabIndex = 25
		Me.txtCompStart.Text = ""
		'
		'cboStartTrg
		'
		Me.cboStartTrg.BackColor = System.Drawing.SystemColors.Window
		Me.cboStartTrg.Cursor = System.Windows.Forms.Cursors.Default
		Me.cboStartTrg.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
		Me.cboStartTrg.ForeColor = System.Drawing.SystemColors.WindowText
		Me.cboStartTrg.Location = New System.Drawing.Point(83, 20)
		Me.cboStartTrg.Name = "cboStartTrg"
		Me.cboStartTrg.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.cboStartTrg.Size = New System.Drawing.Size(180, 20)
		Me.cboStartTrg.TabIndex = 10
		'
		'Label10
		'
		Me.Label10.AutoSize = True
		Me.Label10.BackColor = System.Drawing.SystemColors.Control
		Me.Label10.Cursor = System.Windows.Forms.Cursors.Default
		Me.Label10.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Label10.Location = New System.Drawing.Point(424, 74)
		Me.Label10.Name = "Label10"
		Me.Label10.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Label10.Size = New System.Drawing.Size(24, 12)
		Me.Label10.TabIndex = 15
		Me.Label10.Text = "Hex"
		'
		'Label9
		'
		Me.Label9.AutoSize = True
		Me.Label9.BackColor = System.Drawing.SystemColors.Control
		Me.Label9.Cursor = System.Windows.Forms.Cursors.Default
		Me.Label9.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Label9.Location = New System.Drawing.Point(424, 49)
		Me.Label9.Name = "Label9"
		Me.Label9.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Label9.Size = New System.Drawing.Size(16, 12)
		Me.Label9.TabIndex = 14
		Me.Label9.Text = "ns"
		'
		'Label8
		'
		Me.Label8.AutoSize = True
		Me.Label8.BackColor = System.Drawing.SystemColors.Control
		Me.Label8.Cursor = System.Windows.Forms.Cursors.Default
		Me.Label8.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Label8.Location = New System.Drawing.Point(424, 24)
		Me.Label8.Name = "Label8"
		Me.Label8.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Label8.Size = New System.Drawing.Size(24, 12)
		Me.Label8.TabIndex = 13
		Me.Label8.Text = "Hex"
		'
		'Label7
		'
		Me.Label7.AutoSize = True
		Me.Label7.BackColor = System.Drawing.SystemColors.Control
		Me.Label7.Cursor = System.Windows.Forms.Cursors.Default
		Me.Label7.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Label7.Location = New System.Drawing.Point(280, 99)
		Me.Label7.Name = "Label7"
		Me.Label7.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Label7.Size = New System.Drawing.Size(60, 12)
		Me.Label7.TabIndex = 9
		Me.Label7.Text = "停止個数："
		'
		'Label6
		'
		Me.Label6.AutoSize = True
		Me.Label6.BackColor = System.Drawing.SystemColors.Control
		Me.Label6.Cursor = System.Windows.Forms.Cursors.Default
		Me.Label6.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Label6.Location = New System.Drawing.Point(280, 74)
		Me.Label6.Name = "Label6"
		Me.Label6.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Label6.Size = New System.Drawing.Size(48, 12)
		Me.Label6.TabIndex = 8
		Me.Label6.Text = "比較値："
		'
		'Label5
		'
		Me.Label5.AutoSize = True
		Me.Label5.BackColor = System.Drawing.SystemColors.Control
		Me.Label5.Cursor = System.Windows.Forms.Cursors.Default
		Me.Label5.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Label5.Location = New System.Drawing.Point(280, 49)
		Me.Label5.Name = "Label5"
		Me.Label5.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Label5.Size = New System.Drawing.Size(69, 12)
		Me.Label5.TabIndex = 7
		Me.Label5.Text = "内部クロック："
		'
		'Label4
		'
		Me.Label4.AutoSize = True
		Me.Label4.BackColor = System.Drawing.SystemColors.Control
		Me.Label4.Cursor = System.Windows.Forms.Cursors.Default
		Me.Label4.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Label4.Location = New System.Drawing.Point(280, 24)
		Me.Label4.Name = "Label4"
		Me.Label4.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Label4.Size = New System.Drawing.Size(48, 12)
		Me.Label4.TabIndex = 6
		Me.Label4.Text = "比較値："
		'
		'Label3
		'
		Me.Label3.AutoSize = True
		Me.Label3.BackColor = System.Drawing.SystemColors.Control
		Me.Label3.Cursor = System.Windows.Forms.Cursors.Default
		Me.Label3.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Label3.Location = New System.Drawing.Point(10, 74)
		Me.Label3.Name = "Label3"
		Me.Label3.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Label3.Size = New System.Drawing.Size(70, 12)
		Me.Label3.TabIndex = 5
		Me.Label3.Text = "ストップ条件："
		'
		'Label2
		'
		Me.Label2.AutoSize = True
		Me.Label2.BackColor = System.Drawing.SystemColors.Control
		Me.Label2.Cursor = System.Windows.Forms.Cursors.Default
		Me.Label2.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Label2.Location = New System.Drawing.Point(10, 49)
		Me.Label2.Name = "Label2"
		Me.Label2.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Label2.Size = New System.Drawing.Size(69, 12)
		Me.Label2.TabIndex = 4
		Me.Label2.Text = "クロック条件："
		'
		'Label1
		'
		Me.Label1.AutoSize = True
		Me.Label1.BackColor = System.Drawing.SystemColors.Control
		Me.Label1.Cursor = System.Windows.Forms.Cursors.Default
		Me.Label1.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Label1.Location = New System.Drawing.Point(10, 24)
		Me.Label1.Name = "Label1"
		Me.Label1.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Label1.Size = New System.Drawing.Size(72, 12)
		Me.Label1.TabIndex = 3
		Me.Label1.Text = "スタート条件："
		'
		'Frame2
		'
		Me.Frame2.BackColor = System.Drawing.SystemColors.Control
		Me.Frame2.Controls.AddRange(New System.Windows.Forms.Control() {Me.rdoStartCntWithSamp, Me.rdoStartCntNotWithSamp})
		Me.Frame2.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Frame2.Location = New System.Drawing.Point(9, 136)
		Me.Frame2.Name = "Frame2"
		Me.Frame2.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Frame2.Size = New System.Drawing.Size(457, 73)
		Me.Frame2.TabIndex = 32
		Me.Frame2.TabStop = False
		Me.Frame2.Text = "カウンタスタートモード"
		'
		'rdoStartCntWithSamp
		'
		Me.rdoStartCntWithSamp.BackColor = System.Drawing.SystemColors.Control
		Me.rdoStartCntWithSamp.Cursor = System.Windows.Forms.Cursors.Default
		Me.rdoStartCntWithSamp.ForeColor = System.Drawing.SystemColors.ControlText
		Me.rdoStartCntWithSamp.Location = New System.Drawing.Point(8, 40)
		Me.rdoStartCntWithSamp.Name = "rdoStartCntWithSamp"
		Me.rdoStartCntWithSamp.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.rdoStartCntWithSamp.Size = New System.Drawing.Size(281, 25)
		Me.rdoStartCntWithSamp.TabIndex = 18
		Me.rdoStartCntWithSamp.TabStop = True
		Me.rdoStartCntWithSamp.Text = "サンプリングと同時にカウンタスタート"
		'
		'rdoStartCntNotWithSamp
		'
		Me.rdoStartCntNotWithSamp.BackColor = System.Drawing.SystemColors.Control
		Me.rdoStartCntNotWithSamp.Cursor = System.Windows.Forms.Cursors.Default
		Me.rdoStartCntNotWithSamp.ForeColor = System.Drawing.SystemColors.ControlText
		Me.rdoStartCntNotWithSamp.Location = New System.Drawing.Point(8, 16)
		Me.rdoStartCntNotWithSamp.Name = "rdoStartCntNotWithSamp"
		Me.rdoStartCntNotWithSamp.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.rdoStartCntNotWithSamp.Size = New System.Drawing.Size(281, 25)
		Me.rdoStartCntNotWithSamp.TabIndex = 17
		Me.rdoStartCntNotWithSamp.TabStop = True
		Me.rdoStartCntNotWithSamp.Text = "サンプリングとは無関係にカウンタスタート"
		'
		'Frame3
		'
		Me.Frame3.BackColor = System.Drawing.SystemColors.Control
		Me.Frame3.Controls.AddRange(New System.Windows.Forms.Control() {Me.rdoStopCntWithSamp, Me.rdoStopCntNotWithSamp})
		Me.Frame3.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Frame3.Location = New System.Drawing.Point(9, 216)
		Me.Frame3.Name = "Frame3"
		Me.Frame3.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Frame3.Size = New System.Drawing.Size(457, 73)
		Me.Frame3.TabIndex = 33
		Me.Frame3.TabStop = False
		Me.Frame3.Text = "カウンタストップ モード"
		'
		'rdoStopCntWithSamp
		'
		Me.rdoStopCntWithSamp.BackColor = System.Drawing.SystemColors.Control
		Me.rdoStopCntWithSamp.Cursor = System.Windows.Forms.Cursors.Default
		Me.rdoStopCntWithSamp.ForeColor = System.Drawing.SystemColors.ControlText
		Me.rdoStopCntWithSamp.Location = New System.Drawing.Point(8, 40)
		Me.rdoStopCntWithSamp.Name = "rdoStopCntWithSamp"
		Me.rdoStopCntWithSamp.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.rdoStopCntWithSamp.Size = New System.Drawing.Size(281, 25)
		Me.rdoStopCntWithSamp.TabIndex = 21
		Me.rdoStopCntWithSamp.TabStop = True
		Me.rdoStopCntWithSamp.Text = "サンプリングと同時にカウンタストップ"
		'
		'rdoStopCntNotWithSamp
		'
		Me.rdoStopCntNotWithSamp.BackColor = System.Drawing.SystemColors.Control
		Me.rdoStopCntNotWithSamp.Cursor = System.Windows.Forms.Cursors.Default
		Me.rdoStopCntNotWithSamp.ForeColor = System.Drawing.SystemColors.ControlText
		Me.rdoStopCntNotWithSamp.Location = New System.Drawing.Point(8, 16)
		Me.rdoStopCntNotWithSamp.Name = "rdoStopCntNotWithSamp"
		Me.rdoStopCntNotWithSamp.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.rdoStopCntNotWithSamp.Size = New System.Drawing.Size(281, 25)
		Me.rdoStopCntNotWithSamp.TabIndex = 20
		Me.rdoStopCntNotWithSamp.TabStop = True
		Me.rdoStopCntNotWithSamp.Text = "サンプリングとは無関係にカウンタストップ"
		'
		'btnCancel
		'
		Me.btnCancel.BackColor = System.Drawing.SystemColors.Control
		Me.btnCancel.Cursor = System.Windows.Forms.Cursors.Default
		Me.btnCancel.ForeColor = System.Drawing.SystemColors.ControlText
		Me.btnCancel.Location = New System.Drawing.Point(385, 360)
		Me.btnCancel.Name = "btnCancel"
		Me.btnCancel.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.btnCancel.Size = New System.Drawing.Size(81, 23)
		Me.btnCancel.TabIndex = 30
		Me.btnCancel.Text = "ｷｬﾝｾﾙ"
		'
		'btnOK
		'
		Me.btnOK.BackColor = System.Drawing.SystemColors.Control
		Me.btnOK.Cursor = System.Windows.Forms.Cursors.Default
		Me.btnOK.ForeColor = System.Drawing.SystemColors.ControlText
		Me.btnOK.Location = New System.Drawing.Point(289, 360)
		Me.btnOK.Name = "btnOK"
		Me.btnOK.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.btnOK.Size = New System.Drawing.Size(81, 23)
		Me.btnOK.TabIndex = 29
		Me.btnOK.Text = "OK"
		'
		'Frame4
		'
		Me.Frame4.BackColor = System.Drawing.SystemColors.Control
		Me.Frame4.Controls.AddRange(New System.Windows.Forms.Control() {Me.txtNumEvent, Me.Label11})
		Me.Frame4.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Frame4.Location = New System.Drawing.Point(9, 296)
		Me.Frame4.Name = "Frame4"
		Me.Frame4.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Frame4.Size = New System.Drawing.Size(457, 56)
		Me.Frame4.TabIndex = 34
		Me.Frame4.TabStop = False
		Me.Frame4.Text = "転送個数イベント通知"
		'
		'txtNumEvent
		'
		Me.txtNumEvent.AcceptsReturn = True
		Me.txtNumEvent.AutoSize = False
		Me.txtNumEvent.BackColor = System.Drawing.SystemColors.Window
		Me.txtNumEvent.Cursor = System.Windows.Forms.Cursors.IBeam
		Me.txtNumEvent.ForeColor = System.Drawing.SystemColors.WindowText
		Me.txtNumEvent.Location = New System.Drawing.Point(8, 24)
		Me.txtNumEvent.MaxLength = 0
		Me.txtNumEvent.Name = "txtNumEvent"
		Me.txtNumEvent.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.txtNumEvent.Size = New System.Drawing.Size(105, 18)
		Me.txtNumEvent.TabIndex = 23
		Me.txtNumEvent.Text = ""
		'
		'Label11
		'
		Me.Label11.AutoSize = True
		Me.Label11.BackColor = System.Drawing.SystemColors.Control
		Me.Label11.Cursor = System.Windows.Forms.Cursors.Default
		Me.Label11.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Label11.Location = New System.Drawing.Point(120, 27)
		Me.Label11.Name = "Label11"
		Me.Label11.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Label11.Size = New System.Drawing.Size(80, 12)
		Me.Label11.TabIndex = 24
		Me.Label11.Text = "データ毎に通知"
		'
		'ConditionDlg
		'
		Me.AutoScaleBaseSize = New System.Drawing.Size(5, 12)
		Me.ClientSize = New System.Drawing.Size(474, 390)
		Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.Frame1, Me.Frame2, Me.Frame3, Me.btnCancel, Me.btnOK, Me.Frame4})
		Me.MaximizeBox = False
		Me.MinimizeBox = False
		Me.Name = "ConditionDlg"
		Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
		Me.Text = "サンプリング条件設定"
		Me.Frame1.ResumeLayout(False)
		Me.Frame2.ResumeLayout(False)
		Me.Frame3.ResumeLayout(False)
		Me.Frame4.ResumeLayout(False)
		Me.ResumeLayout(False)

	End Sub

#End Region

	Dim 			StartComp As Integer
	Dim 			StopComp As Integer

	Dim				InternalClock As Integer
	Dim				StopNumber As Integer
	Public Shared	NumberOfData As Integer
	Dim 			StartCountMode As Short
	Dim 			StopCountMode As Short

	'===================================================
	'	ダイアログ初期化
	'===================================================
	Private Sub ConditionDlg_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

		'--------------------------------
		' 表示初期化
		'--------------------------------
		cboStartTrg.Items.Clear()
		cboStartTrg.Items.Insert(0, "ソフトウェアスタート")
		cboStartTrg.Items.Insert(1, "外部信号立ち上がり")
		cboStartTrg.Items.Insert(2, "外部信号立ち下がり")
		cboStartTrg.Items.Insert(3, "カウント一致CH0 比較レジスタ0")
		cboStartTrg.Items.Insert(4, "カウント一致CH1 比較レジスタ0")
		cboStartTrg.Items.Insert(5, "カウント一致CH2 比較レジスタ0")
		cboStartTrg.Items.Insert(6, "カウント一致CH3 比較レジスタ0")
		cboStartTrg.Items.Insert(7, "カウント一致CH0 比較レジスタ1")
		cboStartTrg.Items.Insert(8, "カウント一致CH1 比較レジスタ1")
		cboStartTrg.Items.Insert(9, "カウント一致CH2 比較レジスタ1")
		cboStartTrg.Items.Insert(10, "カウント一致CH3 比較レジスタ1")

		cboClockTrg.Items.Clear()
		cboClockTrg.Items.Insert(0, "内部クロック")
		cboClockTrg.Items.Insert(1, "外部クロック")

		cboStopTrg.Items.Clear()
		cboStopTrg.Items.Insert(0, "ソフトウェアストップ")
		cboStopTrg.Items.Insert(1, "外部信号立ち上がり")
		cboStopTrg.Items.Insert(2, "外部信号立ち下がり")
		cboStopTrg.Items.Insert(3, "指定個数転送完了")
		cboStopTrg.Items.Insert(4, "カウント一致CH0 比較レジスタ0")
		cboStopTrg.Items.Insert(5, "カウント一致CH1 比較レジスタ0")
		cboStopTrg.Items.Insert(6, "カウント一致CH2 比較レジスタ0")
		cboStopTrg.Items.Insert(7, "カウント一致CH3 比較レジスタ0")
		cboStopTrg.Items.Insert(8, "カウント一致CH0 比較レジスタ1")
		cboStopTrg.Items.Insert(9, "カウント一致CH1 比較レジスタ1")
		cboStopTrg.Items.Insert(10, "カウント一致CH2 比較レジスタ1")
		cboStopTrg.Items.Insert(11, "カウント一致CH3 比較レジスタ1")


		cboStartTrg.Text = "ソフトウェアスタート"
		cboClockTrg.Text = "内部クロック"
		cboStopTrg.Text = "ソフトウェアストップ"

		If StartCountMode = CNTS_START_CNT_NOT_WITH_SAMP Then
			rdoStartCntNotWithSamp.Checked = True
			rdoStartCntWithSamp.Checked = False
		Else
			rdoStartCntNotWithSamp.Checked = False
			rdoStartCntWithSamp.Checked = True
		End If
		If StopCountMode = CNTS_STOP_CNT_NOT_WITH_SAMP Then
			rdoStopCntNotWithSamp.Checked = True
			rdoStopCntWithSamp.Checked = False
		Else
			rdoStopCntNotWithSamp.Checked = False
			rdoStopCntWithSamp.Checked = True
		End If

		txtCompStart.Text = 100
		txtInternalClock.Text = 100000
		txtStopNum.Text = 1000
		txtNumEvent.Text = 500
		txtCompStop.Text = 200

		cboStartTrg_SelectedIndexChanged(cboStartTrg, New System.EventArgs())
		cboClockTrg_SelectedIndexChanged(cboClockTrg, New System.EventArgs())
		cboStopTrg_SelectedIndexChanged(cboStopTrg, New System.EventArgs())

	End Sub

	'===================================================
	'	スタート条件設定変更
	'===================================================
	Private Sub cboStartTrg_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboStartTrg.SelectedIndexChanged

		Dim szBuf As New String("", 100)

		szBuf = cboStartTrg.Text
		If szBuf.StartsWith("カウント一致") Then
			txtCompStart.Enabled = True
		Else
			txtCompStart.Enabled = False
		End If

	End Sub

	'===================================================
	'	クロック条件設定変更
	'===================================================
	Private Sub cboClockTrg_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboClockTrg.SelectedIndexChanged

		Dim szBuf As New String("", 100)

		'--------------------------------
		' 内部クロック値の有効/無効を切り替え
		'--------------------------------
		szBuf = cboClockTrg.Text
		If String.Compare(szBuf, "内部クロック") = 0 Then
			txtInternalClock.Enabled = True
		Else
			txtInternalClock.Enabled = False
		End If

	End Sub

	'===================================================
	'	ストップ条件設定変更
	'===================================================
	Private Sub cboStopTrg_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboStopTrg.SelectedIndexChanged

		Dim szBuf As New String("", 100)

		szBuf = cboStopTrg.Text
		If szBuf.StartsWith("カウント一致") Then
			txtCompStop.Enabled = True
		Else
			txtCompStop.Enabled = False
		End If
		If String.Compare(szBuf, "指定個数転送完了") = 0 Then
			txtStopNum.Enabled = True
		Else
			txtStopNum.Enabled = False
		End If

	End Sub

	'===================================================
	'	OKボタン処理
	'===================================================
	Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click

        Dim error_string As New StringBuilder("", 256)
		Dim szTmp As New String("", 100)
		Dim StartTrg As Short
		Dim ClockTrg As Short
		Dim StopTrg As Short
		Dim ret As Integer
		Dim strMsg As String
		Dim CompChNo As Short
		Dim CompRegNo As Short

		'--------------------------------
		' 表示データを取得
		'--------------------------------
		If rdoStartCntNotWithSamp.Checked = True Then
			StartCountMode = CNTS_START_CNT_NOT_WITH_SAMP
		Else
			StartCountMode = CNTS_START_CNT_WITH_SAMP
		End If
		If rdoStopCntNotWithSamp.Checked = True Then
			StopCountMode = CNTS_STOP_CNT_NOT_WITH_SAMP
		Else
			StopCountMode = CNTS_STOP_CNT_WITH_SAMP
		End If

		szTmp = txtCompStart.Text
		Try
			StartComp = Integer.Parse(szTmp, NumberStyles.HexNumber)
		Catch ex As Exception
			StartComp = &H100
		End Try

		szTmp = txtCompStop.Text
		Try
			StopComp = Integer.Parse(szTmp, NumberStyles.HexNumber)
		Catch ex As Exception
			StopComp = &H200
		End Try

		' 内部クロック値を符号ありで設定するため、一度16進文字例変換を経由
		szTmp = Str(Convert.ToInt32(Hex(Val(txtInternalClock.Text)), 16))
		Try
			InternalClock = Integer.Parse(szTmp)
		Catch ex As Exception
			InternalClock = 100000
		End Try

		' 停止個数を符号ありで設定するため、一度16進文字例変換を経由
		szTmp = Str(Convert.ToInt32(Hex(Val(txtStopNum.Text)), 16))
		Try
			StopNumber = Integer.Parse(szTmp)
		Catch ex As Exception
			StopNumber = 1000
		End Try

		' 通知を行うサンプリング回数を符号ありで設定するため、一度16進文字例変換を経由
		szTmp = Str(Convert.ToInt32(Hex(Val(txtNumEvent.Text)), 16))
		Try
			NumberOfData = Integer.Parse(szTmp)
		Catch ex As Exception
			NumberOfData = 500
		End Try

		'--------------------------------
		' 設定値を数値に変換
		'--------------------------------
		StartTrg = 0
		Select Case cboStartTrg.SelectedIndex
			Case 0
				StartTrg = CNTS_START_SOFT
			Case 1
				StartTrg = CNTS_START_EXT_RISE
			Case 2
				StartTrg = CNTS_START_EXT_FALL
			Case 3
				StartTrg = CNTS_START_CNTMATCH_CH0_REG0
			Case 4
				StartTrg = CNTS_START_CNTMATCH_CH1_REG0
			Case 5
				StartTrg = CNTS_START_CNTMATCH_CH2_REG0
			Case 6
				StartTrg = CNTS_START_CNTMATCH_CH3_REG0
			Case 7
				StartTrg = CNTS_START_CNTMATCH_CH0_REG1
			Case 8
				StartTrg = CNTS_START_CNTMATCH_CH1_REG1
			Case 9
				StartTrg = CNTS_START_CNTMATCH_CH2_REG1
			Case 10
				StartTrg = CNTS_START_CNTMATCH_CH3_REG1
		End Select

		ClockTrg = 0
		Select Case cboClockTrg.SelectedIndex
			Case 0
				ClockTrg = CNTS_CLOCK_CLOCK
			Case 1
				ClockTrg = CNTS_CLOCK_EXT_TRG
		End Select

		StopTrg = 0
		Select Case cboStopTrg.SelectedIndex
			Case 0
				StopTrg = CNTS_STOP_SOFT
			Case 1
				StopTrg = CNTS_STOP_EXT_RISE
			Case 2
				StopTrg = CNTS_STOP_EXT_FALL
			Case 3
				StopTrg = CNTS_STOP_NUM
			Case 4
				StopTrg = CNTS_STOP_CNTMATCH_CH0_REG0
			Case 5
				StopTrg = CNTS_STOP_CNTMATCH_CH1_REG0
			Case 6
				StopTrg = CNTS_STOP_CNTMATCH_CH2_REG0
			Case 7
				StopTrg = CNTS_STOP_CNTMATCH_CH3_REG0
			Case 8
				StopTrg = CNTS_STOP_CNTMATCH_CH0_REG1
			Case 9
				StopTrg = CNTS_STOP_CNTMATCH_CH1_REG1
			Case 10
				StopTrg = CNTS_STOP_CNTMATCH_CH2_REG1
			Case 11
				StopTrg = CNTS_STOP_CNTMATCH_CH3_REG1
		End Select

		'--------------------------------
		' サンプリング条件を設定
		'--------------------------------
		' スタンドアローン
		ret = CntSetStandAlone(Id)
		If ret <> CNT_ERR_SUCCESS Then
			CntGetErrorString(ret, error_string)
			strMsg = String.Format("CntSetStandAlone ret = {0:d}: {1}", ret, error_string)
			MessageBox.Show(strMsg, Application.ProductName, MessageBoxButtons.OK)
			Exit Sub
		End If
		' スタート条件設定
		ret = CntSetSamplingStartTrigger(Id, StartTrg, StartCountMode, CHANNEL_NUM)
		If ret <> CNT_ERR_SUCCESS Then
			CntGetErrorString(ret, error_string)
			strMsg = String.Format("CntSetSamplingStartTrigger ret = {0:d}: {1}", ret, error_string)
			MessageBox.Show(strMsg, Application.ProductName, MessageBoxButtons.OK)
			Exit Sub
		End If
		Select Case StartTrg
			Case CNTS_START_CNTMATCH_CH0_REG0
				CompChNo = 0
				CompRegNo = 0
			Case CNTS_START_CNTMATCH_CH1_REG0
				CompChNo = 1
				CompRegNo = 0
			Case CNTS_START_CNTMATCH_CH2_REG0
				CompChNo = 2
				CompRegNo = 0
			Case CNTS_START_CNTMATCH_CH3_REG0
				CompChNo = 3
				CompRegNo = 0
			Case CNTS_START_CNTMATCH_CH4_REG0
				CompChNo = 4
				CompRegNo = 0
			Case CNTS_START_CNTMATCH_CH5_REG0
				CompChNo = 5
				CompRegNo = 0
			Case CNTS_START_CNTMATCH_CH6_REG0
				CompChNo = 6
				CompRegNo = 0
			Case CNTS_START_CNTMATCH_CH7_REG0
				CompChNo = 7
				CompRegNo = 0
			Case CNTS_START_CNTMATCH_CH0_REG1
				CompChNo = 0
				CompRegNo = 1
			Case CNTS_START_CNTMATCH_CH1_REG1
				CompChNo = 1
				CompRegNo = 1
			Case CNTS_START_CNTMATCH_CH2_REG1
				CompChNo = 2
				CompRegNo = 1
			Case CNTS_START_CNTMATCH_CH3_REG1
				CompChNo = 3
				CompRegNo = 1
			Case CNTS_START_CNTMATCH_CH4_REG1
				CompChNo = 4
				CompRegNo = 1
			Case CNTS_START_CNTMATCH_CH5_REG1
				CompChNo = 5
				CompRegNo = 1
			Case CNTS_START_CNTMATCH_CH6_REG1
				CompChNo = 6
				CompRegNo = 1
			Case CNTS_START_CNTMATCH_CH7_REG1
				CompChNo = 7
				CompRegNo = 1
			Case Else
				CompChNo = &HFFF
				CompRegNo = &HFFF
		End Select
		If CompChNo <> &HFFF And CompRegNo <> &HFFF Then
			ret = CntNotifyCountUp(Id, CompChNo, CompRegNo, StartComp, 0)
			If ret <> 0 Then
				CntGetErrorString(ret, error_string)
				strMsg = String.Format("CntNotifyCountUp ret = {0:d}: {1}", ret, error_string)
				MessageBox.Show(strMsg, Application.ProductName, MessageBoxButtons.OK)
			End If
		End If
		' クロック条件設定
		ret = CntSetSamplingClockTrigger(Id, ClockTrg)
		If ret <> CNT_ERR_SUCCESS Then
			CntGetErrorString(ret, error_string)
			strMsg = String.Format("CntSetSamplingClockTrigger ret = {0:d}: {1}", ret, error_string)
			MessageBox.Show(strMsg, Application.ProductName, MessageBoxButtons.OK)
			Exit Sub
		End If
		' 内部クロック値設定
		If ClockTrg = CNTS_CLOCK_CLOCK Then
			ret = CntSetSamplingInternalClock(Id, InternalClock, CNTS_TIM_UNIT_NS)
			If ret <> CNT_ERR_SUCCESS Then
				CntGetErrorString(ret, error_string)
				strMsg = String.Format("CntSetSamplingInternalClock ret = {0:d}: {1}", ret, error_string)
				MessageBox.Show(strMsg, Application.ProductName, MessageBoxButtons.OK)
				Exit Sub
			End If
		End If

		' ストップ条件設定
		ret = CntSetSamplingStopTrigger(Id, StopTrg, StopCountMode, CHANNEL_NUM)
		If ret <> CNT_ERR_SUCCESS Then
			CntGetErrorString(ret, error_string)
			strMsg = String.Format("CntSetSamplingStopTrigger ret = {0:d}: {1}", ret, error_string)
			MessageBox.Show(strMsg, Application.ProductName, MessageBoxButtons.OK)
			Exit Sub
		End If
		Select Case StopTrg
			Case CNTS_STOP_CNTMATCH_CH0_REG0
				CompChNo = 0
				CompRegNo = 0
			Case CNTS_STOP_CNTMATCH_CH1_REG0
				CompChNo = 1
				CompRegNo = 0
			Case CNTS_STOP_CNTMATCH_CH2_REG0
				CompChNo = 2
				CompRegNo = 0
			Case CNTS_STOP_CNTMATCH_CH3_REG0
				CompChNo = 3
				CompRegNo = 0
			Case CNTS_STOP_CNTMATCH_CH4_REG0
				CompChNo = 4
				CompRegNo = 0
			Case CNTS_STOP_CNTMATCH_CH5_REG0
				CompChNo = 5
				CompRegNo = 0
			Case CNTS_STOP_CNTMATCH_CH6_REG0
				CompChNo = 6
				CompRegNo = 0
			Case CNTS_STOP_CNTMATCH_CH7_REG0
				CompChNo = 7
				CompRegNo = 0
			Case CNTS_STOP_CNTMATCH_CH0_REG1
				CompChNo = 0
				CompRegNo = 1
			Case CNTS_STOP_CNTMATCH_CH1_REG1
				CompChNo = 1
				CompRegNo = 1
			Case CNTS_STOP_CNTMATCH_CH2_REG1
				CompChNo = 2
				CompRegNo = 1
			Case CNTS_STOP_CNTMATCH_CH3_REG1
				CompChNo = 3
				CompRegNo = 1
			Case CNTS_STOP_CNTMATCH_CH4_REG1
				CompChNo = 4
				CompRegNo = 1
			Case CNTS_STOP_CNTMATCH_CH5_REG1
				CompChNo = 5
				CompRegNo = 1
			Case CNTS_STOP_CNTMATCH_CH6_REG1
				CompChNo = 6
				CompRegNo = 1
			Case CNTS_STOP_CNTMATCH_CH7_REG1
				CompChNo = 7
				CompRegNo = 1
			Case Else
				CompChNo = &HFFF
				CompRegNo = &HFFF
		End Select
		If CompChNo <> &HFFF And CompRegNo <> &HFFF Then
			ret = CntNotifyCountUp(Id, CompChNo, CompRegNo, StopComp, 0)
			If ret <> 0 Then
				CntGetErrorString(ret, error_string)
				strMsg = String.Format("CntNotifyCountUp ret = {0:d}: {1}", ret, error_string)
				MessageBox.Show(strMsg, Application.ProductName, MessageBoxButtons.OK)
			End If
		End If
		' 停止個数設定
		If StopTrg = CNTS_STOP_NUM Then
			ret = CntSetSamplingStopNumber(Id, StopNumber)
			If ret <> CNT_ERR_SUCCESS Then
				CntGetErrorString(ret, error_string)
				strMsg = String.Format("CntSetSamplingInternalClock ret = {0:d}: {1}", ret, error_string)
				MessageBox.Show(strMsg, Application.ProductName, MessageBoxButtons.OK)
				Exit Sub
			End If
		End If
		Me.Hide()

	End Sub

	'---------------------------------------------
	' キャンセル処理
	'---------------------------------------------
	Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click

		Me.Hide()

	End Sub

	Private Sub ConditionDlg_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing

		e.Cancel = True
		Me.Hide()

	End Sub
End Class
