示例#1
0
        private void  pollingTimer_Tick(object sender, EventArgs e)
        {
            SipperCommand cmd = null;

            lock  (executedCmds)
            {
                if (executedCmds.Count > 0)
                {
                    cmd = executedCmds.Dequeue();
                }
            }

            if (cmd == null)
            {
                return;
            }

            if (cmd.ExecutedOk())
            {
                errorLastTimeTryingToRetrieveData = false;
                cameraDataPrev2 = cameraDataPrev1;
                cameraDataPrev1 = cameraData;
                cameraData      = cmd.CameraLine();
                PaintImage();
                SaveImageInLogDirectory();
            }
            else
            {
                errorLastTimeTryingToRetrieveData = true;
                PaintErrorRetreivingCammeraLineData();
            }

            refreshButton.Enabled         = true;
            weAreWaitingForCameraLineData = false;
        }
示例#2
0
 private void refreshButton_Click(object sender, EventArgs e)
 {
     errorLastTimeTryingToRetrieveData = false;
     weAreWaitingForCameraLineData     = true;
     refreshButton.Enabled             = false;
     sipperCommunications.QueueSipperCommand(SipperCommand.CreateGetCammeraLineCmd(executedCmds, sipperCommunications, logFile));
 }
示例#3
0
        } /* CreateReadSerialPortCmd */

        public static SipperCommand CreateStopRecordingCmd(Queue <SipperCommand> _resultQueue,
                                                           CircularBuffer _circularBuffer,
                                                           StreamWriter _logFile
                                                           )
        {
            SipperCommand cmd = new SipperCommand(CmdTypes.StopRecordingCmd, _resultQueue, _circularBuffer, _logFile);

            return(cmd);
        } /* CreateReadSerialPortCmd */
示例#4
0
        } /* CreateReadSerialPortCmd */

        public static SipperCommand CreateReBootBatteryCmd(Queue <SipperCommand> _resultQueue,
                                                           CircularBuffer _circularBuffer,
                                                           StreamWriter _logFile
                                                           )
        {
            SipperCommand cmd = new SipperCommand(CmdTypes.ReBootBatteryCmd, _resultQueue, _circularBuffer, _logFile);

            return(cmd);
        } /* CreateReBootBatteryCmd */
示例#5
0
        } /* CreateReadSerialPortCmd */

        public static SipperCommand CreateGetCammeraParametersCmd(Queue <SipperCommand> _resultQueue,
                                                                  CircularBuffer _circularBuffer,
                                                                  StreamWriter _logFile
                                                                  )
        {
            SipperCommand cmd = new SipperCommand(CmdTypes.GetCameraParametersCmd, _resultQueue, _circularBuffer, _logFile);

            return(cmd);
        } /* CreateReadSerialPortCmd */
示例#6
0
        } /* CreateReadSerialPortCmd */

        public static SipperCommand  CreateUserCmd(Queue <SipperCommand> _resultQueue,
                                                   string _userCmd,
                                                   CircularBuffer _circularBuffer,
                                                   StreamWriter _logFile
                                                   )
        {
            SipperCommand cmd = new SipperCommand(CmdTypes.UserCmd, _resultQueue, _circularBuffer, _logFile);

            cmd.userCmd = _userCmd;
            return(cmd);
        } /* CreateReadSerialPortCmd */
示例#7
0
        } /* CreateReadSerialPortCmd */

        public static SipperCommand  CreatePreviewCmd(Queue <SipperCommand> _resultQueue,
                                                      int _blocksToRead,
                                                      CircularBuffer _circularBuffer,
                                                      StreamWriter _logFile
                                                      )
        {
            SipperCommand cmd = new SipperCommand(CmdTypes.PreviewCmd, _resultQueue, _circularBuffer, _logFile);

            cmd.blocksToRead = _blocksToRead;
            return(cmd);
        } /* CreateReadSerialPortCmd */
示例#8
0
        } /* CreateReadSerialPortCmd */

        public static SipperCommand  CreateReadSerialPortCmd(Queue <SipperCommand> _resultQueue,
                                                             int _serialPort,
                                                             CircularBuffer _circularBuffer,
                                                             StreamWriter _logFile
                                                             )
        {
            SipperCommand cmd = new SipperCommand(CmdTypes.ReadSerialPortCmd, _resultQueue, _circularBuffer, _logFile);

            cmd.serialPort = _serialPort;
            return(cmd);
        } /* CreateReadSerialPortCmd */
示例#9
0
        public static SipperCommand  CreateChangeBatteryCmd(Queue <SipperCommand> _resultQueue,
                                                            int _batteryNum,
                                                            CircularBuffer _circularBuffer,
                                                            StreamWriter _logFile
                                                            )
        {
            SipperCommand cmd = new SipperCommand(CmdTypes.ChangeBatteryCmd, _resultQueue, _circularBuffer, _logFile);

            cmd.batteryNum = _batteryNum;
            return(cmd);
        } /* CreateReadSerialPortCmd */
示例#10
0
        } /* CreateReadSerialPortCmd */

        public static SipperCommand  CreateSetFileNameAndStartRecordingCmd(Queue <SipperCommand> _resultQueue,
                                                                           string _fileName,
                                                                           string _fileDesc,
                                                                           CircularBuffer _circularBuffer,
                                                                           StreamWriter _logFile
                                                                           )
        {
            SipperCommand cmd = new SipperCommand(CmdTypes.SetFileNameAndStartRecordingCmd, _resultQueue, _circularBuffer, _logFile);

            cmd.fileName = _fileName;
            cmd.fileDesc = _fileDesc;
            return(cmd);
        } /* CreateReadSerialPortCmd */
示例#11
0
        public CameraLineDisplay(CircularBuffer _sipperCommunications,
                                 SipperConfigRec _configRec,
                                 StreamWriter _logFile
                                 )
        {
            InitializeComponent();

            executedCmds = new Queue <SipperCommand> ();

            sipperCommunications = _sipperCommunications;
            logFile   = _logFile;
            configRec = _configRec;

            oldScallingRatio = ScallingRatio();
            firstCameraCol   = 0;

            pollingTimer.Enabled = true;
            sipperCommunications.QueueSipperCommand(SipperCommand.CreateGetCammeraLineCmd(executedCmds, sipperCommunications, logFile));

            refreshButton.Enabled         = false;
            weAreWaitingForCameraLineData = true;

            PaintWaitingForCameraLineData();
        }