示例#1
0
        public NLXReminder(W_Maze_Gui gui)
        {
            _gui          = gui;
            mNetComClient = W_Maze_Gui.mNetComClient;


            InitializeComponent();
        }
        // private Window NeuraLynxWindow { get; }

        public W_Maze_Gui()
        {
            //Arduino Basic commands set and connected to port
            CsvFiles.OpenRatDataCsv(); //open RatData.csv so we can read from it and access Rat info
            serialPort.BaudRate        = 9600;
            serialPort.PortName        = "COM3";
            serialPort.ReadTimeout     = 10000;
            serialPort.Encoding        = Encoding.UTF8;
            serialPort.DiscardNull     = true;
            serialPort.WriteBufferSize = 10000;
            serialPort.Open();

            serialPort.DiscardInBuffer();
            serialPort.DiscardOutBuffer();



            while (!CsvFiles.RatdataReader.EndOfStream)
            //this reads the RatData.csv file and makes a dictionary for the ages and for the session number
            {
                var line = CsvFiles.RatdataReader.ReadLine();
                var vals = line.Split(',');
                name_to_age.Add(vals[0], vals[1]);
                name_to_session.Add(vals[0], int.Parse(vals[2]));
                ratName.Add(vals[0]);
            }
            CsvFiles.CloseRatDataCsv();

            //Initializes MNetcom to connect to NETCOM for ONLINE connection with CHEETAH
            mNetComClient = new MNetCom.MNetComClient();



            InitializeComponent();
            foreach (var rat in ratName)
            {
                this.RatSelection.Items.Add(rat);
            }
            this.RatSelection.Items.Add("New Rat");  //option to create new rat

            //Displays time and date on GUI window
            dateString         = DateTime.Now.ToShortDateString();
            dateLString        = DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss");
            rat_datelabel.Text = DateTime.Now.ToShortDateString();
            rat_timelabel.Text = DateTime.Now.ToShortTimeString();



            //reminderWindow = new NLXReminder(this);
            //modeWindow = new appMode(this);
            //confirm();
            //if (recordingStatus == false) { ephys.Hide(); }
        }
示例#3
0
        public W_Maze_Gui()
        {
            CsvFiles.OpenRatDataCsv(); //open RatData.csv so we can read from it and access Rat info
            serialPort.BaudRate        = 9600;
            serialPort.PortName        = "COM3";
            serialPort.ReadTimeout     = 10000;
            serialPort.Encoding        = Encoding.UTF8;
            serialPort.DiscardNull     = true;
            serialPort.WriteBufferSize = 10000;
            serialPort.Open();

            serialPort.DiscardInBuffer();
            serialPort.DiscardOutBuffer();

            while (!CsvFiles.RatdataReader.EndOfStream)
            //this reads the RatData.csv file and makes a dictionary for the ages and for the session number
            {
                var line = CsvFiles.RatdataReader.ReadLine();
                var vals = line.Split(',');
                name_to_age.Add(vals[0], vals[1]);
                name_to_session.Add(vals[0], int.Parse(vals[2]));
                ratName.Add(vals[0]);
            }
            CsvFiles.CloseRatDataCsv();

            mNetComClient = new MNetCom.MNetComClient();



            InitializeComponent();
            foreach (var rat in ratName)
            {
                RatSelection.Items.Add(rat);
            }
            reminderWindow = new NLXReminder(this);
            //modeWindow = new appMode(this);
            confirm();
            NeuraLynxWindow = Desktop.Instance.Windows().FirstOrDefault(w => w.Name.Contains("Neuralynx"));
        }