diff -r 9b09e2ee0968 -r fe4c711fd7f8 GUI/MainForm.cs --- a/GUI/MainForm.cs Thu Apr 18 23:25:10 2013 +0200 +++ b/GUI/MainForm.cs Sun Sep 21 21:55:36 2014 +0200 @@ -39,6 +39,7 @@ private Color[] plotColorPalette; private SystemTray systemTray; private SoundGraphDisplay soundGraphDisplay; + private SharpDisplay sharpDisplay; private bool displayTick; private StartupManager startupManager = new StartupManager(); private UpdateVisitor updateVisitor = new UpdateVisitor(); @@ -57,6 +58,8 @@ private UserOption autoStart; private UserOption frontViewPacked; //Tells whether FrontView should cycle or pack sensors private UserOption frontViewDisplayTime; //Tells whether or not FrontView should display current time + private UserOption sharpDisplayPacked; //Tells whether SharpDisplay should cycle or pack sensors + private UserOption sharpDisplayShowTime; //Tells whether or not SharpDisplay should display current time private UserOption readMainboardSensors; private UserOption readCpuSensors; @@ -131,14 +134,18 @@ treeView.Model = treeModel; this.computer = new Computer(settings); - + + //System tray systemTray = new SystemTray(computer, settings, unitManager); systemTray.HideShowCommand += hideShowClick; systemTray.ExitCommand += exitClick; + //SoundGraph Display soundGraphDisplay = new SoundGraphDisplay(computer, settings, unitManager); - - + //Sharp Display Manager + sharpDisplay = new SharpDisplay(computer, settings, unitManager); + + // int p = (int)Environment.OSVersion.Platform; if ((p == 4) || (p == 128)) { // Unix treeView.RowHeight = Math.Max(treeView.RowHeight, 18); @@ -233,6 +240,10 @@ frontViewPacked = new UserOption("frontViewPackedMenuItem", false, frontViewPackedMenuItem, settings); frontViewDisplayTime = new UserOption("frontViewDisplayTimeMenuItem", false, frontViewDisplayTimeMenuItem, settings); + sharpDisplayPacked = new UserOption("sharpDisplayPackedMenuItem", false, sharpDisplayPackedMenuItem, settings); + sharpDisplayShowTime = new UserOption("sharpDisplayShowTimeMenuItem", false, sharpDisplayShowTimeMenuItem, settings); + + readMainboardSensors = new UserOption("mainboardMenuItem", true, mainboardMenuItem, settings); readMainboardSensors.Changed += delegate(object sender, EventArgs e) { @@ -499,6 +510,14 @@ SolidBrush greenBrush = new SolidBrush(Color.FromName("mediumspringgreen")); e.BackgroundBrush = greenBrush; } + + //If displayed in SharpDisplay draw background in blue + if (sensorNode != null && settings.GetValue(new Identifier(sensorNode.Sensor.Identifier, "SharpDisplay").ToString(), false)) + { + SolidBrush aquaBrush = new SolidBrush(Color.FromName("aqua")); + e.BackgroundBrush = aquaBrush; + } + } else { e.TextColor = Color.DarkGray; @@ -571,6 +590,11 @@ */ } + if (sharpDisplay != null) + { + sharpDisplay.Redraw(sharpDisplayPacked.Value, sharpDisplayShowTime.Value); + } + if (logSensors != null && logSensors.Value && delayCount >= 4) logger.Log(); @@ -640,6 +664,7 @@ server.Quit(); systemTray.Dispose(); soundGraphDisplay.Dispose(); + sharpDisplay.Dispose(); } private void aboutMenuItem_Click(object sender, EventArgs e) { @@ -711,6 +736,18 @@ }; treeContextMenu.MenuItems.Add(item); } + { + MenuItem item = new MenuItem("Show in SharpDisplay"); + item.Checked = sharpDisplay.Contains(node.Sensor); + item.Click += delegate(object obj, EventArgs args) + { + if (item.Checked) + sharpDisplay.Remove(node.Sensor); + else + sharpDisplay.Add(node.Sensor, true); + }; + treeContextMenu.MenuItems.Add(item); + } if (gadget != null) { MenuItem item = new MenuItem("Show in Gadget"); item.Checked = gadget.Contains(node.Sensor);