Exemplo n.º 1
0
        public NetComExampleCommandsForm()
        {
            //initialize class vars
            this.mNetComClient = new MNetCom.MNetComClient();

            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //

            //extra UI setup
            this.cmbCommandList.SelectedIndex = 0;
            this.btnDisconnect.Enabled        = false;
            this.pnlCommands.Enabled          = false;

            //Set the logfile name
            if (!(this.mNetComClient.SetLogFileName(Application.StartupPath.ToString() + "\\NetComExampleCommandsLogfile.txt")))
            {
                MessageBox.Show(this, "Call to set the logfile name failed", "NetCom Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
        }
Exemplo n.º 2
0
        public LinearTrackGui()
        {
            CsvFiles.openLTreader();
            serialPort.BaudRate        = 9600;
            serialPort.PortName        = "COM5";
            serialPort.ReadTimeout     = 10000;
            serialPort.Encoding        = Encoding.UTF8;
            serialPort.DiscardNull     = true;
            serialPort.WriteBufferSize = 10000;
            serialPort.Open();

            serialPort.DiscardInBuffer();
            serialPort.DiscardOutBuffer();
            while (!CsvFiles.LTreader.EndOfStream)
            //this reads the LTtraining.csv file and makes a dictionary for the ages and for the session number
            {
                var line = CsvFiles.LTreader.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.closeLTreader();
            mNetComClient = new MNetCom.MNetComClient();

            InitializeComponent();
            reminderWindow = new NLXReminder(this);
            confirm();
            //reminderWindow.Show();
            //this.Focus();

            //if (recordingStatus == false) { ephys.Hide(); }

            foreach (var rat in ratName)
            {
                this.ratSelection.Items.Add(rat);
            }
            this.ratSelection.Items.Add("New Rat");

            rat_datelabel.Text = DateTime.Now.ToShortDateString();
            rat_timelabel.Text = DateTime.Now.ToShortTimeString();
        }
Exemplo n.º 3
0
        public NetComExampleStreamsForm()
        {
            //initialize class vars
            mNetComClient = new MNetCom.MNetComClient();

            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
            //extra UI setup
            btnDisconnect.Enabled  = false;
            grpRecordLog.Enabled   = false;
            grpStreamProps.Enabled = false;

            //Set the log file name
            if ((mNetComClient.SetLogFileName(Application.StartupPath.ToString() + "\\NetComExampleStreamsLogfile.txt")) == false)
            {
                MessageBox.Show(this, "Call to set the log file name failed", "NetCom Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }

            //register the callback functions
            mNetcomSECallback = new MNetCom.MNC_SECallback(NetComCallbackSE);
            mNetComClient.SetCallbackFunctionSE(mNetcomSECallback, this);
            mNetcomSTCallback = new MNetCom.MNC_STCallback(NetComCallbackST);
            mNetComClient.SetCallbackFunctionST(mNetcomSTCallback, this);
            mNetcomTTCallback = new MNetCom.MNC_TTCallback(NetComCallbackTT);
            mNetComClient.SetCallbackFunctionTT(mNetcomTTCallback, this);
            mNetcomCSCCallback = new MNetCom.MNC_CSCCallback(NetComCallbackCSC);
            mNetComClient.SetCallbackFunctionCSC(mNetcomCSCCallback, this);
            mNetcomEVCallback = new MNetCom.MNC_EVCallback(NetComCallbackEV);
            mNetComClient.SetCallbackFunctionEV(mNetcomEVCallback, this);
            mNetcomVTCallback = new MNetCom.MNC_VTCallback(NetComCallbackVT);
            mNetComClient.SetCallbackFunctionVT(mNetcomVTCallback, this);
        }
Exemplo n.º 4
0
 public NLXReminder(LinearTrackGui gui)
 {
     _gui          = gui;
     mNetComClient = LinearTrackGui.mNetComClient;
     InitializeComponent();
 }