GUI/MainForm.cs
changeset 394 60a1e2b6ed71
parent 393 4e41fb513d52
child 395 df649224ba4d
     1.1 --- a/GUI/MainForm.cs	Mon Feb 04 00:47:01 2013 +0100
     1.2 +++ b/GUI/MainForm.cs	Sat Feb 09 17:18:09 2013 +0100
     1.3 @@ -39,6 +39,7 @@
     1.4      private Color[] plotColorPalette;
     1.5      private SystemTray systemTray;
     1.6      private SoundGraphDisplay soundGraphDisplay;
     1.7 +    private bool displayTick;
     1.8      private StartupManager startupManager = new StartupManager();
     1.9      private UpdateVisitor updateVisitor = new UpdateVisitor();
    1.10      private SensorGadget gadget;
    1.11 @@ -285,18 +286,9 @@
    1.12  
    1.13        InitializePlotForm();
    1.14  
    1.15 -      //
    1.16 -      if (soundGraphDisplay.IsDllLoaded)
    1.17 -      {
    1.18 -          //Try init
    1.19 -          //NativeWindow window;
    1.20 -          soundGraphDisplay.Init(Handle);
    1.21  
    1.22 -          //= Window.GetWindow(this);
    1.23 -          //var wih = new WindowInteropHelper(window);
    1.24 -          //IntPtr hWnd = wih.Handle;
    1.25 -      }
    1.26 -      
    1.27 +      soundGraphDisplay.Init();
    1.28 +
    1.29  
    1.30  
    1.31        startupMenuItem.Visible = startupManager.IsAvailable;
    1.32 @@ -523,6 +515,20 @@
    1.33  
    1.34        if (wmiProvider != null)
    1.35          wmiProvider.Update();
    1.36 +
    1.37 +      if (soundGraphDisplay != null)
    1.38 +      {
    1.39 +          displayTick=!displayTick;
    1.40 +          if (displayTick)
    1.41 +          {
    1.42 +              soundGraphDisplay.SetText("       ---", "");
    1.43 +          }
    1.44 +          else
    1.45 +          {
    1.46 +              soundGraphDisplay.SetText("       -+-", "");
    1.47 +          }
    1.48 +      }  
    1.49 +
    1.50      }
    1.51  
    1.52      private void SaveConfiguration() {
    1.53 @@ -738,41 +744,8 @@
    1.54        const int SC_MINIMIZE = 0xF020;
    1.55        const int SC_CLOSE = 0xF060;
    1.56  
    1.57 -      if (m.Msg == SoundGraph.WM_DSP_PLUGIN_NOTIFY)
    1.58 -      {
    1.59 -        //Handling messages from our iMON Display
    1.60 -          switch ((SoundGraph.DSPNotifyCode)m.WParam.ToInt32())
    1.61 -          {
    1.62 -              case SoundGraph.DSPNotifyCode.DSPNM_PLUGIN_SUCCEED:
    1.63 -              case SoundGraph.DSPNotifyCode.DSPNM_IMON_RESTARTED:
    1.64 -              case SoundGraph.DSPNotifyCode.DSPNM_HW_CONNECTED:
    1.65 -                  {
    1.66 -                      //Connection with our display is now open
    1.67 -                      //Check if we have LCD or VFD
    1.68 -                      //if ((lParam & DSPN_DSP_VFD) == DSPN_DSP_VFD) m_bVfdConnected = TRUE;
    1.69 -                      //if ((lParam & DSPN_DSP_LCD) == DSPN_DSP_LCD) m_bLcdConnected = TRUE;
    1.70 -                      soundGraphDisplay.DisplayPluginMessage(m.WParam.ToInt32(),false);
    1.71 -                  }
    1.72 -                  break;
    1.73 -
    1.74 -              case SoundGraph.DSPNotifyCode.DSPNM_PLUGIN_FAILED:
    1.75 -              case SoundGraph.DSPNotifyCode.DSPNM_HW_DISCONNECTED:
    1.76 -              case SoundGraph.DSPNotifyCode.DSPNM_IMON_CLOSED:
    1.77 -                  {
    1.78 -                      //Connection with our display is closed
    1.79 -                      soundGraphDisplay.DisplayPluginMessage(m.LParam.ToInt32(), true);
    1.80 -                  }
    1.81 -                  break;
    1.82 -
    1.83 -              case SoundGraph.DSPNotifyCode.DSPNM_LCD_TEXT_SCROLL_DONE:
    1.84 -                  {
    1.85 -                      //Scroll finnished
    1.86 -                  }
    1.87 -                  break;
    1.88 -          }
    1.89 -
    1.90 -      }
    1.91 -      else if (minimizeToTray.Value &&
    1.92 + 
    1.93 +      if (minimizeToTray.Value &&
    1.94          m.Msg == WM_SYSCOMMAND && m.WParam.ToInt64() == SC_MINIMIZE)
    1.95        {
    1.96            SysTrayHideShow();