private void stateChanged(object sender, iMonStateChangedEventArgs e) { lock (this.displayLock) { if (e.IsInitialized) { iMonDisplayType display = this.imon.DisplayType; if ((display & iMonDisplayType.LCD) == iMonDisplayType.LCD) { this.imon.LCD.ScrollFinished += lcdScrollFinished; this.lcd = true; } if ((display & iMonDisplayType.VFD) == iMonDisplayType.VFD) { this.vfd = true; } try { this.semReady.Release(); } catch (SemaphoreFullException) { Logging.Error(LoggingArea, "Error: 'SemaphoreFullException' for semReady in DisplayHandler.stateChanged()"); } } else { this.lcd = false; this.vfd = false; this.update(); } } }
private void onMessage(iMonNativeApi.iMonDisplayNotifyCode code, IntPtr data) { this.OnLog("Message received: " + code + "(" + data + ")"); switch (code) { case iMonNativeApi.iMonDisplayNotifyCode.PluginSuccess: case iMonNativeApi.iMonDisplayNotifyCode.HardwareConnected: case iMonNativeApi.iMonDisplayNotifyCode.iMonRestarted: this.displayType = (iMonDisplayType)data; this.onStateChanged(true); break; case iMonNativeApi.iMonDisplayNotifyCode.PluginFailed: this.onError(this.getErrorType((iMonNativeApi.iMonDisplayInitResult)data)); break; case iMonNativeApi.iMonDisplayNotifyCode.HardwareDisconnected: case iMonNativeApi.iMonDisplayNotifyCode.iMonClosed: this.onError(this.getErrorType(code)); break; case iMonNativeApi.iMonDisplayNotifyCode.LCDTextScrollDone: this.lcd.OnScrollFinished(); break; } }
public iMonWrapperApi() { this.displayType = iMonDisplayType.Unknown; this.vfd = new iMonVfd(this); this.lcd = new iMonLcd(this); }