Пример #1
0
        /// <summary>
        /// Retruns true if no error occured while sending the settings
        /// </summary>
        public override bool Setting_for_Sensitivity(Sensitvity_Measurement mySensitivity)
        {
            //1. Error Counter zurücksetzen**************************************************************************************************************
            uint error_Sum = 0;

            //2. Mess-Einstellungen anpassen*************************************************************************************************************
            error_Sum += Activate_Chanel_0();
            error_Sum += Diff_Channel_0to1();
            error_Sum += Input_1MOhm_Channel_0();
            error_Sum += Input_1MOhm_Channel_1();
            error_Sum += Set_Range();
            error_Sum += Set_Frequency();                   //Eventuell Freuenz ändern
            error_Sum += Setting_for_Single_Measurment();

            //3. Parameter für Messlänge senden**********************************************************************************************************
            error_Sum += Set_Sample_Count(mySensitivity.Nr_of_samples);
            error_Sum += Set_Samples_PostTrigger(mySensitivity.Nr_of_samples);

            //4. Feld für die Messdaten generiern********************************************************************************************************
            mySensitivity.RawData = new short[mySensitivity.Nr_of_samples];                                 //Feld in der Länger definieren
            H_BufferHandle        = GCHandle.Alloc(mySensitivity.RawData, GCHandleType.Pinned);             //Speicherplatz sperren
            Daten_Pointer         = H_BufferHandle.AddrOfPinnedObject();                                    //Pointer für gesperten Speicherplatz suchen

            //5. Fehlerauswertung********************************************************************************************************
            if (error_Sum != 0)
            {
                MessageBox.Show("An error occured while sending the Settings!\n Look on LOG and try again.", "Warning",
                                MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return(false);
            }
            else
            {
                return(true);
            }
        }
Пример #2
0
 public bool TTA_reserve_Storage(short[,] array)
 {
     //Speicherplatz sperren
     H_BufferHandle = GCHandle.Alloc(array, GCHandleType.Pinned);
     //Pointer für gesperten Speicherplatz suchen
     Daten_Pointer = H_BufferHandle.AddrOfPinnedObject();
     return(true);
 }
Пример #3
0
        /// <summary>
        /// Retruns true if no error occured while sending the settings
        /// </summary>
        public override bool Measure_Sensitivity_DEMO(Sensitvity_Measurement mySensitivity)
        {
            //Mögliche Errors mitzählen
            uint error_Sum = 0;

            //Speicher definieren & Spreren
            mySensitivity.RawData = new short[mySensitivity.Nr_of_samples];
            H_BufferHandle        = GCHandle.Alloc(mySensitivity.RawData, GCHandleType.Pinned);
            Daten_Pointer         = H_BufferHandle.AddrOfPinnedObject();

            //Messung starten
            error_Sum += WaitTime_for_Trigger_inf();
            error_Sum += Adopt_Settings();
            error_Sum += Start_Card();
            error_Sum += Force_Trigger();

            //Daten abholen
            error_Sum += WaitTime_for_Trigger_inf();
            error_Sum += Wait_for_all_samples();

            //Datentransfer einstellen (Datapointer enspricht der Stelle des ersten Samples im Array)
            IntPtr aktuellerPointer = new IntPtr(Daten_Pointer.ToInt64());

            error_Sum += Send_Pointer_of_Array(aktuellerPointer, mySensitivity.Nr_of_samples);
            error_Sum += Get_Data();

            //Auf Errors checken
            if (error_Sum != 0)
            {
                MessageBox.Show("An Error occured while measurment!\n Look at LOG: .", "Warning",
                                MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return(false);
            }
            else
            {
                return(true);
            }
        }