Example #1
0
 private void ShowMeasureform(MAIDevice AIDevice)
 {
     if (AIDevice.IsAudioDevice)
     {
         AudioCardWindow.Show(AIDevice);
     }
     else
     {
         CardWindow.Show(AIDevice);
     }
 }
 public FormOutput_PWM_FM(CardWindow AIParentWindow)
 {
     InitializeComponent();
     m_ParentWindow = AIParentWindow;
     m_ParentWindow.checkBoxUpdate.Checked = false;
     flpChannels.Controls.Clear();
     for (int i = 0; i < m_ParentWindow.MAIDevice.PWMChannels.Count; i++) {
         UCOutputSettingsPWMChannel cv = new UCOutputSettingsPWMChannel();
         cv.SetNameAndChannel("Channel " + i.ToString(), m_ParentWindow.MAIDevice.PWMChannels[i]);
         flpChannels.Controls.Add(cv);
     }
 }
 public FormOutput_PWM_FM(CardWindow AIParentWindow)
 {
     InitializeComponent();
     m_ParentWindow = AIParentWindow;
     m_ParentWindow.checkBoxUpdate.Checked = false;
     flpChannels.Controls.Clear();
     for (int i = 0; i < m_ParentWindow.MAIDevice.PWMChannels.Count; i++)
     {
         UCOutputSettingsPWMChannel cv = new UCOutputSettingsPWMChannel();
         cv.SetNameAndChannel("Channel " + i.ToString(), m_ParentWindow.MAIDevice.PWMChannels[i]);
         flpChannels.Controls.Add(cv);
     }
 }
 public FormMeasureCT(CardWindow AIParentWindow)
 {
     InitializeComponent();
     m_ParentWindow = AIParentWindow;
     m_ParentWindow.checkBoxUpdate.Checked = false;
     tbFreqCT.Text = m_ParentWindow.nudSRCT.Value.ToString();
     tbFreqAD.Text = m_ParentWindow.nudSRDA.Value.ToString();
     flpChannels.Controls.Clear();
     foreach (CTChannel c in m_ParentWindow.flpCT.Controls) {
         UCConterValue cv = new UCConterValue();
         cv.SetMChannel(c, this);
         flpChannels.Controls.Add(cv);
     }
     ReconfigureChannels();
     ConfigEnabled = true;
 }
Example #5
0
 public FormMeasureCT(CardWindow AIParentWindow)
 {
     InitializeComponent();
     m_ParentWindow = AIParentWindow;
     m_ParentWindow.checkBoxUpdate.Checked = false;
     tbFreqCT.Text = m_ParentWindow.nudSRCT.Value.ToString();
     tbFreqAD.Text = m_ParentWindow.nudSRDA.Value.ToString();
     flpChannels.Controls.Clear();
     foreach (CTChannel c in m_ParentWindow.flpCT.Controls)
     {
         UCConterValue cv = new UCConterValue();
         cv.SetMChannel(c, this);
         flpChannels.Controls.Add(cv);
     }
     ReconfigureChannels();
     ConfigEnabled = true;
 }
        public FormMeasureAD(CardWindow AIParentWindow)
        {
            InitializeComponent();
            m_ParentWindow = AIParentWindow;
            m_ParentWindow.checkBoxUpdate.Checked = false;
            foreach (ADChannelSmall a in m_ParentWindow.flpADChannels.Controls) {
                ToolStripMenuItem it = (ToolStripMenuItem)menuStrip1.Items["channelsToolStripMenuItem"];
                ToolStripMenuItem ni = (ToolStripMenuItem)it.DropDownItems.Add(a.labelChannel.Text);
                ni.Tag     = a;
                ni.Checked = true;
                ni.CheckOnClick = true;
                ni.CheckStateChanged += new EventHandler(ni_CheckStateChanged);
            }

            numericUpDownADSamplerate.Value   = m_ParentWindow.numericUpDownADSamplerate.Value;
            numericUpDownADSamplerate.Minimum = 2;
            Reconfigure(null);
        }
Example #7
0
        public FormMeasureAD(CardWindow AIParentWindow)
        {
            InitializeComponent();
            m_ParentWindow = AIParentWindow;
            m_ParentWindow.checkBoxUpdate.Checked = false;
            foreach (ADChannelSmall a in m_ParentWindow.flpADChannels.Controls)
            {
                ToolStripMenuItem it = (ToolStripMenuItem)menuStrip1.Items["channelsToolStripMenuItem"];
                ToolStripMenuItem ni = (ToolStripMenuItem)it.DropDownItems.Add(a.labelChannel.Text);
                ni.Tag                = a;
                ni.Checked            = true;
                ni.CheckOnClick       = true;
                ni.CheckStateChanged += new EventHandler(ni_CheckStateChanged);
            }

            numericUpDownADSamplerate.Value   = m_ParentWindow.numericUpDownADSamplerate.Value;
            numericUpDownADSamplerate.Minimum = 2;
            Reconfigure(null);
        }
Example #8
0
        public CTChannel(MAIChannelCT AIChannel, CardWindow AIParentForm)
        {
            m_ParentForm = AIParentForm;
            // AIChannel.MyDevice.Properties.CTChannels[AIChannel.HardwareChannelNumber].CounterType
            InitializeComponent();
            Channel = AIChannel;
            ADSync = true;
            if (Channel.IsCounterModeAvailable(CounterMode.IMPULSECOUNTER) ){
                 Mode = CounterMode.IMPULSECOUNTER;
            }
            else  if (Channel.IsCounterModeAvailable(CounterMode.INCREMENTALCOUNTER)){
                    Mode = CounterMode.INCREMENTALCOUNTER;
            }
            else if (Channel.IsCounterModeAvailable(CounterMode.INCEEXTTIMESTAMP)){
                    Mode = CounterMode.INCEEXTTIMESTAMP;

            }

            CreateTmpMeaschan();
            //Channel.Mode
        }
        public FormOutputWaveForms(CardWindow AIParentWindow)
        {
            InitializeComponent();
            m_ParentWindow = AIParentWindow;
            m_ParentWindow.checkBoxUpdate.Checked = false;
            foreach (DAChannelSmall a in m_ParentWindow.flpDAChannels.Controls) {
                UCFuncGenChan tmp = new UCFuncGenChan();
                tmp.LabelName = a.labelChannel.Text;
                tmp.SetNewWidth(flpGenerators.Width - 10);
                tmp.MinimumRange = -10;
                tmp.SampleRate = (int)m_ParentWindow.nudSRDA.Value;
                tmp.Channel = a.Channel;
                if (m_ParentWindow.radioButtonOnlyPosDA.Checked) {
                    tmp.MinimumRange = 0;

                }
                tmp.Init();
                flpGenerators.Controls.Add(tmp);
            }
            getDateEvent = new MAIMeasurementBufferEvent(DAChannels_ProcessDataBuffers);
            m_ParentWindow.MAIDevice.DAChannels.ProcessDataBuffers += getDateEvent;
        }
Example #10
0
        public CTChannel(MAIChannelCT AIChannel, CardWindow AIParentForm)
        {
            m_ParentForm = AIParentForm;
            // AIChannel.MyDevice.Properties.CTChannels[AIChannel.HardwareChannelNumber].CounterType
            InitializeComponent();
            Channel = AIChannel;
            ADSync  = true;
            if (Channel.IsCounterModeAvailable(CounterMode.IMPULSECOUNTER))
            {
                Mode = CounterMode.IMPULSECOUNTER;
            }
            else if (Channel.IsCounterModeAvailable(CounterMode.INCREMENTALCOUNTER))
            {
                Mode = CounterMode.INCREMENTALCOUNTER;
            }
            else if (Channel.IsCounterModeAvailable(CounterMode.INCEEXTTIMESTAMP))
            {
                Mode = CounterMode.INCEEXTTIMESTAMP;
            }

            CreateTmpMeaschan();
            //Channel.Mode
        }
 public FormOutputWaveForms(CardWindow AIParentWindow)
 {
     InitializeComponent();
     m_ParentWindow = AIParentWindow;
     m_ParentWindow.checkBoxUpdate.Checked = false;
     foreach (DAChannelSmall a in m_ParentWindow.flpDAChannels.Controls)
     {
         UCFuncGenChan tmp = new UCFuncGenChan();
         tmp.LabelName = a.labelChannel.Text;
         tmp.SetNewWidth(flpGenerators.Width - 10);
         tmp.MinimumRange = -10;
         tmp.SampleRate   = (int)m_ParentWindow.nudSRDA.Value;
         tmp.Channel      = a.Channel;
         if (m_ParentWindow.radioButtonOnlyPosDA.Checked)
         {
             tmp.MinimumRange = 0;
         }
         tmp.Init();
         flpGenerators.Controls.Add(tmp);
     }
     getDateEvent = new MAIMeasurementBufferEvent(DAChannels_ProcessDataBuffers);
     m_ParentWindow.MAIDevice.DAChannels.ProcessDataBuffers += getDateEvent;
 }
Example #12
0
        internal static void Show(MAIDevice AIDevice)
        {
            try{
                AIDevice.DAChannels.SetRange(DARange.Bipolar);
            }
            catch { }
            CardWindow me = new CardWindow();

            me.m_maiDevice = AIDevice;
            if (me.m_maiDevice.Properties.ADChannels.Count > 0)
            {
                if (me.m_maiDevice.Properties.ADChannels[0].IEPEMode > 0)
                {
                    me.bIEPE_OFF.Visible = true;
                }
            }
            me.m_maiDevice.StopMeasure();
            try {
                me.m_maiDevice.DAChannels.StopOutput();
            }
            catch { }

            me.m_maiDevice.ClearAllChannelLists();


            bool  ADVisible   = AIDevice.ADChannels.Count() > 0;
            bool  DAVisible   = AIDevice.DAChannels.Count() > 0;
            bool  CTVisible   = AIDevice.CTChannels.Count() > 0;
            bool  DIOVisible  = AIDevice.TTLChannels.Count() > 0;
            bool  PWMVisible  = AIDevice.PWMChannels.Count > 0;
            Panel lastVisible = null;

            me.panelAD.Visible    = ADVisible;
            me.splitterAD.Visible = ADVisible;
            if (ADVisible)
            {
                lastVisible = me.panelAD;
            }
            me.panelDA.Visible    = DAVisible;
            me.splitterDA.Visible = DAVisible;
            if (DAVisible)
            {
                lastVisible = me.panelDA;
            }
            me.panelDIO.Visible    = DIOVisible;
            me.splitterDIO.Visible = DIOVisible;
            me.splitterDIO.Enabled = DIOVisible;
            if (DIOVisible)
            {
                lastVisible = me.panelDIO;
            }

            me.panelCT.Visible = CTVisible;

            if (CTVisible)
            {
                lastVisible = me.panelCT;
            }
            else
            {
                me.splitterDIO.Visible = false;
                me.splitterDIO.Enabled = false;
            }
            if (lastVisible != null)
            {
                lastVisible.Dock = DockStyle.Fill;
            }
            me.Text = AIDevice.Info.SerialNumber;

            me.groupBoxDARange.Enabled  = AIDevice.DeviceType != MeasurementDeviceType.MULTICHOICE_USB_BASIC && AIDevice.DeviceType != MeasurementDeviceType.MULTICHOICE_ETH;
            me.buttonDAOutput.Enabled   = DAVisible;
            me.buttonMeasrement.Enabled = ADVisible;
            me.buttonCTMeasure.Enabled  = CTVisible;
            me.buttonPWM.Enabled        = PWMVisible;
            me.ShowDialog();
            me.Dispose();
        }
Example #13
0
        internal static void Show(MAIDevice AIDevice)
        {
            try{
            AIDevice.DAChannels.SetRange(DARange.Bipolar);
            }
            catch { }
            CardWindow me = new CardWindow();
            me.m_maiDevice = AIDevice;
            if (me.m_maiDevice.Properties.ADChannels.Count > 0) {
                if (me.m_maiDevice.Properties.ADChannels[0].IEPEMode > 0)
                    me.bIEPE_OFF.Visible = true;
            }
            me.m_maiDevice.StopMeasure();
            try {
                me.m_maiDevice.DAChannels.StopOutput();
            }
            catch { }

            me.m_maiDevice.ClearAllChannelLists();

            bool ADVisible = AIDevice.ADChannels.Count() > 0;
            bool DAVisible = AIDevice.DAChannels.Count() > 0;
            bool CTVisible = AIDevice.CTChannels.Count() > 0;
            bool DIOVisible = AIDevice.TTLChannels.Count() > 0;
            bool PWMVisible = AIDevice.PWMChannels.Count > 0;
            Panel lastVisible = null;

            me.panelAD.Visible = ADVisible;
            me.splitterAD.Visible = ADVisible;
            if (ADVisible)
                lastVisible = me.panelAD;
            me.panelDA.Visible = DAVisible;
            me.splitterDA.Visible = DAVisible;
            if (DAVisible) {
                lastVisible = me.panelDA;
            }
            me.panelDIO.Visible = DIOVisible;
            me.splitterDIO.Visible = DIOVisible;
            me.splitterDIO.Enabled = DIOVisible;
            if (DIOVisible)
                lastVisible = me.panelDIO;

            me.panelCT.Visible = CTVisible;

            if (CTVisible) {
                lastVisible = me.panelCT;

            }
            else {

                me.splitterDIO.Visible = false;
                me.splitterDIO.Enabled = false;

            }
            if (lastVisible != null)
                lastVisible.Dock = DockStyle.Fill;
            me.Text = AIDevice.Info.SerialNumber;

            me.groupBoxDARange.Enabled = AIDevice.DeviceType != MeasurementDeviceType.MULTICHOICE_USB_BASIC && AIDevice.DeviceType != MeasurementDeviceType.MULTICHOICE_ETH;
            me.buttonDAOutput.Enabled = DAVisible;
            me.buttonMeasrement.Enabled = ADVisible;
            me.buttonCTMeasure.Enabled = CTVisible;
            me.buttonPWM.Enabled = PWMVisible;
            me.ShowDialog();
            me.Dispose();
        }