コード例 #1
0
        public override Task <Empty> ReadAndDownloadWaveformFromFile(RfsgServiceWaveformDownloadConfiguration request, ServerCallContext context)
        {
            var handle = (IntPtr)request.Session.Handle;

            NIRfsgPlayback.ReadAndDownloadWaveformFromFile(handle, request.Waveform.FilePath, request.Waveform.Name);
            return(Task.FromResult(new Empty()));
        }
コード例 #2
0
        void StartGeneration()
        {
            string rfsgName = resourceNameComboBox.Text;
            double freq     = (double)frequencyNumeric.Value;
            double power    = (double)powerLevelNumeric.Value;

            try
            {
                rfsgSession = new NIRfsg(rfsgName, true, false);
                rfsgHandle  = rfsgSession.GetInstrumentHandle().DangerousGetHandle();
                int i = 0;
                foreach (string tdmsPath in tdmsFilePaths)
                {
                    NIRfsgPlayback.ReadAndDownloadWaveformFromFile(rfsgHandle, tdmsPath, tdmsWaveformNames[i]);
                    i++;
                }
                //Q: Is it acceptable to utilize mostly private class data and keep prototype empty? I suppose if I don't aniticpate any reuse I can leave it empty...
                string autoScript = ScriptGen();
                NIRfsgPlayback.SetScriptToGenerateSingleRfsg(rfsgHandle, autoScript);
                rfsgSession.RF.Configure(freq, power);
                rfsgSession.Initiate();
            }
            catch (Exception uhOh)
            {
                ShowError("Start Generation", uhOh);
            }
        }