public SaveData(int sampleDuration, string fileName, bool complex, Controller controller)
        {
            this.controller = controller;
            if (complex)
                nrSignals = 9;
            else
                nrSignals = 3;

            edfFile = new EdfFile(fileName, false, false, false, false);
            edfFile.CreateNewFile(nrSignals, true);

            edfFile.FileInfo.SampleRecDuration = sampleDuration;
            buffer = new List<short>[nrSignals];

            for (int i = 0; i < nrSignals; i++)
                buffer[i]=new List<short>();

            addSignal(0, "Audio", "Amplitude", Statics.FS, 1024, 0);
            addSignal(1, "Aktivitaet", "Aktivitaet", Statics.FS /20, 100, 0);
            addSignal(2, "Position", "Position", Statics.FS / 20, 3, 0);
            if (complex)
            {
                addSignal(3, "Gyro X", "Winkelgeschwindigkeit", Statics.FS / 20, 255, 0);
                addSignal(4, "Gyro Y", "Winkelgeschwindigkeit", Statics.FS / 20, 255, 0);
                addSignal(5, "Gyro Z", "Winkelgeschwindigkeit", Statics.FS / 20, 255, 0);

                addSignal(6, "Acc X", "Beschleunigung", Statics.FS / 20, 255, 0);
                addSignal(7, "Acc Y", "Beschleunigung", Statics.FS / 20, 255, 0);
                addSignal(8, "Acc Z", "Beschleunigung", Statics.FS / 20, 255, 0);
            }
        }
 static void Main()
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Controller controller = new Controller();
     //Application.Run(new View());
 }
 public void setController(Controller controller)
 {
     this.controller = controller;
     //this.buttonExit.Click += new EventHandler(controller.Exit);
     this.buttonCancel.Click += new EventHandler(controller.CancelDialog);
     //this.buttonLoad.Click += new EventHandler(controller.LoadData);
     //this.buttonConfirm.Click += new EventHandler(controller.StartRecording);
     this.FormClosing += new FormClosingEventHandler(controller.CancelDialog);
 }
        public void setController(Controller controller)
        {
            this.controller = controller;
            //this.buttonExit.Click += new EventHandler(controller.Exit);
            //this.buttonSave.Click += new EventHandler(controller.OpenSaveDialog);
            //this.buttonLoad.Click += new EventHandler(controller.LoadData);
            this.buttonConnect.Click += new EventHandler(controller.Connect);
            this.FormClosing += new FormClosingEventHandler(controller.Exit);
            //this.timerDisconnect.Tick += new EventHandler(controller.Reconnect);

            //Subscribe to new Data Event
            controller.UpdateStatus += new EventHandler<UpdateStatusEvent>(UpdateStatus);
        }
 public SaveData(Controller controller)
 {
     this.controller = controller;
 }
 public SerialCommunication(Controller controller)
 {
     this.controller = controller;
     serialPort = new SerialPort();
 }