private static void OnCameraEventExposureEndData(Object sender, ParameterChangedEventArgs e, Camera camera) { // An image has been received. Block ID is equal to frame number for GigE camera devices. long frameNumber = 0; if (camera.Parameters[exposureEndEventFrameId].IsReadable) { frameNumber = camera.Parameters[exposureEndEventFrameId].GetValue(); } logItems.Add(new LogItem("ExposureEndEvent", frameNumber)); if (GetIncrementedFrameNumber(frameNumber) != nextExpectedFrameNumberExposureEnd) { // Check whether the imaged item or the sensor head can be moved. // This will be the case if the Exposure End has been lost or if the Exposure End is received later than the image. if (frameNumber == nextFrameNumberForMove) { MoveImagedItemOrSensorHead(); } // Check for missing images. if (frameNumber != nextExpectedFrameNumberExposureEnd) { throw new Exception("An Exposure End event has been lost. Expected frame number is " + nextExpectedFrameNumberExposureEnd + " but got frame number" + frameNumber); } nextExpectedFrameNumberExposureEnd = IncrementFrameNumber(nextExpectedFrameNumberExposureEnd); } }
private void OnUrlParameterChanged(object sender, ParameterChangedEventArgs e) { Task.Run(async() => { if (!await UpdateLabel(e.Parameter)) { StartStationInfoUpdate(); } }); }
// Event handler for exposure end. Only very short processing tasks should be performed by this method. // Otherwise, the event notification will block the processing of images. public void OnEventExposureEndData(Object sender, ParameterChangedEventArgs e) { if (Parameters[exposureEndFrameID].IsReadable && Parameters[exposureEndTimestamp].IsReadable) { Console.WriteLine("OnEventExposureEndData: Camera: {0} EventArgs {1} FrameID {2} TimeStamp {3}" , CameraInfo[CameraInfoKey.ModelName] , e.Parameter.ToString() , Parameters[exposureEndFrameID].ToString() , Parameters[exposureEndTimestamp].ToString()); } }
private void OnMuteChanged(object sender, ParameterChangedEventArgs e) { var parameterValue = e.NewValue; bool currentValue = false; if (parameterValue.GetValue(ref currentValue)) { Console.WriteLine($"Mute Changed = {currentValue}"); SetMuteAsync(currentValue); } }
private void OnVolumeChanged(object sender, ParameterChangedEventArgs e) { var parameterValue = e.NewValue; int currentValue = 0; if (parameterValue.GetValue(ref currentValue)) { Console.WriteLine($"Volume Changed = {currentValue}"); SetVolumeAsync(currentValue); } }
private void OnActiveStationParameterChanged(object sender, ParameterChangedEventArgs e) { var parameterValue = e.NewValue; int activeStationValue = 0; if (parameterValue.GetValue(ref activeStationValue)) { Console.WriteLine($"Active Station Changed = {activeStationValue}"); SetActiveStationAsync(activeStationValue); } }
private void OnParameterChanged(object sender, ParameterChangedEventArgs e) { Parameter parameter = e.Parameter; if (parameter != null) { var device = parameter.Device; if (device != null) { QueueParameterChanged(new ParameterChangeQueueItem(device.NodeId, parameter)); } } }
private void OnParameterChanged(object sender, ParameterChangedEventArgs args) { var parameterValue = args.NewValue; int val = 0; try { if (parameterValue.GetValue(ref val)) { Console.WriteLine($"parameter value changed {args.Parameter.UniqueId}, 0x{args.Parameter.Index:X4}:0x{args.Parameter.SubIndex:X2}, new value = {val}"); } } catch (Exception e) { Console.WriteLine(e.Message); } }
// The parameter state changed. Update the control. private void ParameterChanged(object sender, ParameterChangedEventArgs e) { if (!Dispatcher.CheckAccess()) { Dispatcher.BeginInvoke(new EventHandler <ParameterChangedEventArgs>(ParameterChanged), sender, e); return; } try { UpdateValues(); } catch { // If errors occurred disable the control. Reset(); } }
private void View_ParameterChanged(object sender, ParameterChangedEventArgs e) { model.SetParameterValue(e.ParameterType, e.ParameterName, e.Value); }
private void OnImageFilterPropertyChanged(object sender, ParameterChangedEventArgs e) { updateSettings(e.senderName, e.Value); }
//internal async Task ParameterChanged(AlgorithmParameter param) //{ // //since the selected algorithm display is derived, I have to invoke a redraw // this.StateHasChanged(); //} public void OnChanged(ParameterChangedEventArgs args) { //since the selected algorithm display is derived, I have to invoke a redraw this.StateHasChanged(); }
protected virtual void OnChanged(ParameterChangedEventArgs e) { if (this.Parent != null) this.Parent.OnChanged(e); if (Changed != null) { Changed(this, e); } }
private void MModel_ParameterChanged(object sender, ParameterChangedEventArgs e) { }
private static void OnCameraEventOverrunEventData(Object sender, ParameterChangedEventArgs e) { // The camera was unable to send all its events to the PC. // Events have been dropped by the camera. logItems.Add(new LogItem("EventOverrunEvent", 0)); }
private static void OnCameraEventFrameStartOvertriggerData(Object sender, ParameterChangedEventArgs e) { logItems.Add(new LogItem("FrameStartOvertrigger", 0)); //Handle This Error... }