Beispiel #1
0
        public FormDatabase()
        {
            InitializeComponent();

            // Initialize sensor arrays
            gs_x = new double[SENSOR_AMOUNT];
            gs_y = new double[SENSOR_AMOUNT];
            gs_z = new double[SENSOR_AMOUNT];
            sensorCalibrationSet = new bool[SENSOR_AMOUNT];

            for (int i = 0; i < SENSOR_AMOUNT; i++)
            {
                gs_x[i] = 0;
                gs_y[i] = 0;
                gs_z[i] = 0;
                sensorCalibrationSet[i] = false;
            }

            globalDataSet   = new GlobalDataSet();
            helperFunctions = new HelperFunctions(globalDataSet);

            globalDataSet.DebugMode           = false;
            globalDataSet.ShowProgramDuration = false;

            backgroundWorker_CalculateRecordDuration.DoWork             += new DoWorkEventHandler(backgroundWorker_CalculateRecordDuration_DoWork);
            backgroundWorker_CalculateRecordDuration.RunWorkerCompleted += new RunWorkerCompletedEventHandler(backgroundWorker_CalculateRecordDuration_RunWorkerCompleted);

            backgroundWorker_DeleteDb.DoWork             += new DoWorkEventHandler(backgroundWorker_DeleteDb_DoWork);
            backgroundWorker_DeleteDb.RunWorkerCompleted += new RunWorkerCompletedEventHandler(backgroundWorker_DeleteDb_RunWorkerCompleted);

            backgroundWorker_DataSet.DoWork             += new DoWorkEventHandler(backgroundWorker_DataSet_DoWork);
            backgroundWorker_DataSet.RunWorkerCompleted += new RunWorkerCompletedEventHandler(backgroundWorker_DataSet_RunWorkerCompleted);

            backgroundWorker_saveDbToTxt.DoWork             += new DoWorkEventHandler(backgroundWorker_saveDbToTxt_DoWork);
            backgroundWorker_saveDbToTxt.RunWorkerCompleted += new RunWorkerCompletedEventHandler(backgroundWorker_saveDbToTxt_RunWorkerCompleted);

            backgroundWorker_loadTxtToDb.DoWork             += new DoWorkEventHandler(backgroundWorker_loadTxtToDb_DoWork);
            backgroundWorker_loadTxtToDb.RunWorkerCompleted += new RunWorkerCompletedEventHandler(backgroundWorker_loadTxtToDb_RunWorkerCompleted);

            backgroundWorker_CheckAliveState.DoWork += new DoWorkEventHandler(backgroundWorker_CheckAliveState_DoWork);


            // Initialize
            liteVersion        = false;
            notInUseByGraph    = true;
            notInUseByDatabase = true;
            sampleStep         = DEFAULT_SAMPLE_TIME_FACTOR;
            aliveBit           = false;
            recordIsActive     = false;
            notExecuted        = true;
            firstSensorId      = -1;
            writeCycle         = 0;
            savedRowCounter    = 0;
            helperFunctions.changeElementText(textBox_maxSamples, "3500", false); // Write to textbox to activate event routine and dto calculate measurement duration
        }
Beispiel #2
0
 public HelperFunctions(GlobalDataSet globalDataSet)
 {
     this.globalDataSet = globalDataSet;
 }
Beispiel #3
0
 public DatabaseConnection(GlobalDataSet globalDataSet)
 {
     this.globalDataSet = globalDataSet;
 }