public static void Create(DateTime time,DigitalGauge gauge) { if (timer == null) { timer = new System.Windows.Forms.Timer() { Enabled = false, Interval = 1000 }; timer.Tick += timer_Tick; } CurrentTime = time; timer.Enabled = true; Gauge = gauge; }
public override void SetupGaugeCore(GaugeControl gaugeContainer) { DigitalGauge digitalGauge = gaugeContainer.AddDigitalGauge(); // The number of digits. digitalGauge.DigitCount = 14; // Use 14 segment display mode. digitalGauge.DisplayMode = DigitalGaugeDisplayMode.FourteenSegment; // Add a background layer and set its painting style. DigitalBackgroundLayerComponent backgroundDigital = digitalGauge.AddBackgroundLayer(); BindableComponent = digitalGauge; backgroundDigital.ShapeType = DigitalBackgroundShapeSetType.Style2; // Set the color of digits. digitalGauge.AppearanceOn.ContentBrush = new SolidBrushObject(Color.Red); }
private void UpdateScaleInternal5(ASPxGaugeControl gauge, float value) { string newValue; DigitalGauge oldValue2 = (DigitalGauge)gauge.Gauges[0]; string oldValue; oldValue = oldValue2.Text; //Dennis: use a random value, just for demonstration purposes. //DataView dv = SqlDataSource1.Select(DataSourceSelectArguments.Empty) as DataView; //float newValue = Convert.ToSingle(dv.Table.Rows[0][0]); newValue = Convert.ToString(value); if (oldValue != newValue) { oldValue2.Text = newValue; ((DigitalGauge)gauge.Gauges[0]).Text = oldValue2.Text; //ASPxGaugeControl2.Value = newValue; //gauge.Gauges[0].ForceUpdateChildren(); } }
public void LoadControls(String panelName) { //Cargamos la configuracion var configuracion = ProyectoCraft.Base.Configuracion.Configuracion.Instance(); var opcion = configuracion.GetValue("Semaforos_Brasil_Enabled"); //puede retornar un true, false o null var pathxml = ""; Path = opcion.HasValue && opcion.Value.Equals(true) ? @"panel de control/Brasil" : @"panel de control/Chile"; pathxml = System.IO.Path.Combine(Application.StartupPath, string.Format( @Path + "/panel de control/{0}", panelName)); var xmldoc = new XmlDocument(); xmldoc.Load(pathxml); var panelNodes = xmldoc.SelectNodes("/panel/panel"); foreach (XmlNode panelNode in panelNodes) { var size = new Size(Convert.ToInt16(panelNode.Attributes["width"].Value), Convert.ToInt16(panelNode.Attributes["heigth"].Value)); var location = new Point(Convert.ToInt16(panelNode.Attributes["x"].Value), Convert.ToInt16(panelNode.Attributes["y"].Value)); var panelContainer = new PanelContainer(panelNode.Attributes["title"].Value, location, size); var xmlnodes = panelNode.SelectNodes("control"); foreach (XmlNode xmlnode in xmlnodes) { if (!String.IsNullOrEmpty(xmlnode.InnerText.Trim())) { MyControl myControl = null; var xmldocControles = new XmlDocument(); xmldocControles.Load(System.IO.Path.Combine(Application.StartupPath, string.Format( @Path + "/controles/{0}", xmlnode.InnerText.Trim()))); var TypeOfControl = xmldocControles.SelectSingleNode("/control").Attributes["type"].Value; size = new Size(Convert.ToInt16(xmlnode.Attributes["width"].Value), Convert.ToInt16(xmlnode.Attributes["heigth"].Value)); location = new Point(Convert.ToInt16(xmlnode.Attributes["x"].Value), Convert.ToInt16(xmlnode.Attributes["y"].Value)); switch (TypeOfControl.ToUpper()) { case "DIGITALGAUGE": myControl = new DigitalGauge(xmldocControles, location, size); break; case "LINEARGAUGE": myControl = new LinearGauge(xmldocControles, location, size); break; case "SEMAFORO": myControl = new Semaforo(xmldocControles, location, size); break; case "GRAFICOBARRA3D": myControl = new GraficoBarra3D(xmldocControles, location, size); break; case "SEMAFORO_V2": myControl = new SemaforoV2(xmldocControles, location, size); break; } if (myControl != null) panelContainer.Controles.Add(myControl); } } PanelContainers.Add(panelContainer); } }
public void LoadControls(String panelName) { //Cargamos la configuracion var configuracion = ProyectoCraft.Base.Configuracion.Configuracion.Instance(); var opcion = configuracion.GetValue("Semaforos_Brasil_Enabled"); //puede retornar un true, false o null var pathxml = ""; Path = opcion.HasValue && opcion.Value.Equals(true) ? @"panel de control/Brasil" : @"panel de control/Chile"; pathxml = System.IO.Path.Combine(Application.StartupPath, string.Format( @Path + "/panel de control/{0}", panelName)); var xmldoc = new XmlDocument(); xmldoc.Load(pathxml); var panelNodes = xmldoc.SelectNodes("/panel/panel"); foreach (XmlNode panelNode in panelNodes) { var size = new Size(Convert.ToInt16(panelNode.Attributes["width"].Value), Convert.ToInt16(panelNode.Attributes["heigth"].Value)); var location = new Point(Convert.ToInt16(panelNode.Attributes["x"].Value), Convert.ToInt16(panelNode.Attributes["y"].Value)); var panelContainer = new PanelContainer(panelNode.Attributes["title"].Value, location, size); var xmlnodes = panelNode.SelectNodes("control"); foreach (XmlNode xmlnode in xmlnodes) { if (!String.IsNullOrEmpty(xmlnode.InnerText.Trim())) { MyControl myControl = null; var xmldocControles = new XmlDocument(); xmldocControles.Load(System.IO.Path.Combine(Application.StartupPath, string.Format( @Path + "/controles/{0}", xmlnode.InnerText.Trim()))); var TypeOfControl = xmldocControles.SelectSingleNode("/control").Attributes["type"].Value; size = new Size(Convert.ToInt16(xmlnode.Attributes["width"].Value), Convert.ToInt16(xmlnode.Attributes["heigth"].Value)); location = new Point(Convert.ToInt16(xmlnode.Attributes["x"].Value), Convert.ToInt16(xmlnode.Attributes["y"].Value)); switch (TypeOfControl.ToUpper()) { case "DIGITALGAUGE": myControl = new DigitalGauge(xmldocControles, location, size); break; case "LINEARGAUGE": myControl = new LinearGauge(xmldocControles, location, size); break; case "SEMAFORO": myControl = new Semaforo(xmldocControles, location, size); break; case "GRAFICOBARRA3D": myControl = new GraficoBarra3D(xmldocControles, location, size); break; case "SEMAFORO_V2": myControl = new SemaforoV2(xmldocControles, location, size); break; } if (myControl != null) { panelContainer.Controles.Add(myControl); } } } PanelContainers.Add(panelContainer); } }