Пример #1
0
        private void doTask()
        {
            Sequence current = seq.getCurrentSequence();

            current.compile();
            taskManager.clearTask();
            taskManager.setRepeatFlag(isRepeatEnabled);
            if (current.taskAsm.Count() == 0)
            {
                MainWindow.WriteMessage("有効なチャンネルがありません。\n");
                MainWindow.myInstance.Dispatcher.BeginInvoke(
                    new Action(() => { MainWindow.myInstance.Callback_SystemStop(); })
                    );
                return;
            }
            foreach (TaskAssemble ta in current.taskAsm)
            {
                if (ta.analogOutputChannelNames.Count() > 0)
                {
                    taskManager.initTask(ta.deviceName, current.sampleRate, current.getSequenceSampleCount());
                    taskManager.popTaskAnalogOutput(ta.analogOutputChannelNames, ta.outputMinVoltage, ta.outputMaxVoltage, ta.outputWaves);
                    taskManager.verify();
                }
                if (ta.digitalOutputChannelNames.Count() > 0)
                {
                    taskManager.initTask(ta.deviceName, current.sampleRate, current.getSequenceSampleCount());
                    taskManager.popTaskDigitalOutput(ta.digitalOutputChannelNames, ta.outputDigis);
                    taskManager.verify();
                }
                if (ta.analogInputChannelNames.Count() > 0)
                {
                    taskManager.initTask(ta.deviceName, current.sampleRate, current.getSequenceSampleCount());
                    taskManager.popTaskAnalogInput(ta.analogInputChannelNames, ta.inputMinVoltage, ta.inputMaxVoltage);
                    taskManager.verify();
                }
            }
            taskManager.start();
        }