Beispiel #1
0
 //worker thread to switch cameras.
 private void CameraSwitcherWorkerTask()
 {
     for (var iCamDriverIndex = 0; iCamDriverIndex < overlayData.CamDrivers.Count; iCamDriverIndex++)
     {
         //get object of current CamDriver
         var curCamDriver = overlayData.CamDrivers[iCamDriverIndex];
         //Set camera to current camDriver Object
         ReplayControl.cameraControl.CameraOnDriver(short.Parse(curCamDriver.CurrentDriver.CarNumber), (short)curCamDriver.camGroupNumber);
         //remember start-time of current camers
         double startTimeCurCamera = curCamDriver.StartTime;
         try
         {
             double startTimeNextCamera = overlayData.CamDrivers[iCamDriverIndex + 1].StartTime;
             int    camDuration         = (int)(1000 * (startTimeNextCamera - startTimeCurCamera));
             TraceDebug.WriteLine("Camera switched to driver {0} using camera-group {1}. Remaining Time: {2}".F(curCamDriver.CurrentDriver.UserName, curCamDriver.camGroupNumber, camDuration));
             Thread.Sleep(camDuration);
         }
         catch
         {
             TraceDebug.Write("No more entries in list of CamDriver -> no more camera switches");
         }
     }
 }