void BuildChart() { chart1.ChartAreas[0].AxisY.Minimum = 0; chart1.ChartAreas[0].AxisY.Maximum = this.DisplayOptions.GraphVRes; chart1.Series.Clear(); foreach (GraphVariable graphVariable in this.DisplayOptions.GraphVariables) { SessionVariable var = session.Variables[graphVariable.Variable]; if (var != null) { Series s = new Series(string.Format("{0} {1}-{2} {3}", graphVariable.Name, graphVariable.Min.ToString("0.##"), graphVariable.Max.ToString("0.##"), var.Unit)); s.Color = graphVariable.LineColor; s.ChartType = (SeriesChartType)cmbChartType.SelectedItem; s.BorderWidth = graphVariable.LineThickness; s.BorderDashStyle = graphVariable.LineStyle; s.Enabled = graphVariable.Active; s.ToolTip = "so tool tips show up"; chart1.Series.Add(s); for (int i = 0; i < this.DisplayOptions.GraphHRes; ++i) { s.Points.Add(-1, -1).AxisLabel = "0"; } } } foreach (LogLine line in buffer) { this.PlotLineOnChart(line); } }
void flp_MouseUp(object sender, EventArgs e) { SessionVariable v = ((Control)sender).Tag as SessionVariable; if (v != null) { bool newVar = false; GraphVariable graphVariable = this.DisplayOptions.GraphVariables.FirstOrDefault(gv => gv.Variable == v.Name); if (graphVariable == null) { newVar = true; graphVariable = new GraphVariable() { Variable = v.Name, Name = v.Alias }; } GraphVariableForm gvf = new GraphVariableForm(graphVariable); if (DialogResult.OK == gvf.ShowDialog()) { Control panel = (Control)sender; if (sender is Label) { panel = ((Control)sender).Parent; } this.AddGraphVariable(graphVariable, panel, newVar); } } }
void flp_MouseUp(object sender, EventArgs e) { SessionVariable v = ((Control)sender).Tag as SessionVariable; if (v != null) { bool newVar = false; GraphVariable graphVariable = this.DisplayOptions.GraphVariables.FirstOrDefault(gv => gv.Variable == v.Name); if (graphVariable == null) { newVar = true; graphVariable = new GraphVariable() { Variable = v.Name, Name = v.Alias }; } GraphVariableForm gvf = new GraphVariableForm(graphVariable); if (DialogResult.OK == gvf.ShowDialog()) { Control panel = (Control)sender; if (sender is Label) { panel = ((Control)sender).Parent; } this.AddGraphVariable(graphVariable, panel, newVar); } /* * GaugeWindow gw = new GaugeWindow(session, v); * session.LogLineRead += new ME7LoggerSession.LogLineReadDel(gw.Refresh); * gw.Show(this); */ } }
public bool Equals(SessionVariable other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(Equals(other.Key, Key) && Equals(other.Value, Value) && Equals(other.DataType, DataType)); }
public Variable(LogLine logLine, SessionVariable sessionVariable, string value) { this.LogLine = logLine; this.SessionVariable = sessionVariable; this.CurrentMinValue = decimal.MaxValue; this.CurrentMaxValue = decimal.MinValue; decimal tryParse; if (decimal.TryParse(value, System.Globalization.NumberStyles.Any, ME7LoggerLog.CultureInfo, out tryParse)) { this.Value = tryParse; } }
void graphed_Click(object sender, EventArgs e) { CheckBox c = (CheckBox)sender; SessionVariable v = c.Tag as SessionVariable; if (v != null) { bool newVar = false; GraphVariable graphVariable = this.DisplayOptions.GraphVariables.FirstOrDefault(gv => gv.Variable == v.Name); if (graphVariable == null) { newVar = true; graphVariable = new GraphVariable() { Variable = v.Name, Name = v.Alias }; } graphVariable.Active = c.Checked; this.AddGraphVariable(graphVariable, c.Parent, newVar); } }
// Module defining this command // Optional custom code for this activity /// <summary> /// Returns a configured instance of System.Management.Automation.PowerShell, pre-populated with the command to run. /// </summary> /// <param name="context">The NativeActivityContext for the currently running activity.</param> /// <returns>A populated instance of Sytem.Management.Automation.PowerShell</returns> /// <remarks>The infrastructure takes responsibility for closing and disposing the PowerShell instance returned.</remarks> protected override ActivityImplementationContext GetPowerShell(NativeActivityContext context) { System.Management.Automation.PowerShell invoker = global::System.Management.Automation.PowerShell.Create(); System.Management.Automation.PowerShell targetCommand = invoker.AddCommand(PSCommandName); // Initialize the arguments if (Method.Expression != null) { targetCommand.AddParameter("Method", Method.Get(context)); } if (UseBasicParsing.Expression != null) { targetCommand.AddParameter("UseBasicParsing", UseBasicParsing.Get(context)); } if (Uri.Expression != null) { targetCommand.AddParameter("Uri", Uri.Get(context)); } if (WebSession.Expression != null) { targetCommand.AddParameter("WebSession", WebSession.Get(context)); } if (SessionVariable.Expression != null) { targetCommand.AddParameter("SessionVariable", SessionVariable.Get(context)); } if (Credential.Expression != null) { targetCommand.AddParameter("Credential", Credential.Get(context)); } if (UseDefaultCredentials.Expression != null) { targetCommand.AddParameter("UseDefaultCredentials", UseDefaultCredentials.Get(context)); } if (CertificateThumbprint.Expression != null) { targetCommand.AddParameter("CertificateThumbprint", CertificateThumbprint.Get(context)); } if (Certificate.Expression != null) { targetCommand.AddParameter("Certificate", Certificate.Get(context)); } if (UserAgent.Expression != null) { targetCommand.AddParameter("UserAgent", UserAgent.Get(context)); } if (DisableKeepAlive.Expression != null) { targetCommand.AddParameter("DisableKeepAlive", DisableKeepAlive.Get(context)); } if (TimeoutSec.Expression != null) { targetCommand.AddParameter("TimeoutSec", TimeoutSec.Get(context)); } if (Headers.Expression != null) { targetCommand.AddParameter("Headers", Headers.Get(context)); } if (MaximumRedirection.Expression != null) { targetCommand.AddParameter("MaximumRedirection", MaximumRedirection.Get(context)); } if (Proxy.Expression != null) { targetCommand.AddParameter("Proxy", Proxy.Get(context)); } if (ProxyCredential.Expression != null) { targetCommand.AddParameter("ProxyCredential", ProxyCredential.Get(context)); } if (ProxyUseDefaultCredentials.Expression != null) { targetCommand.AddParameter("ProxyUseDefaultCredentials", ProxyUseDefaultCredentials.Get(context)); } if (Body.Expression != null) { targetCommand.AddParameter("Body", Body.Get(context)); } if (ContentType.Expression != null) { targetCommand.AddParameter("ContentType", ContentType.Get(context)); } if (TransferEncoding.Expression != null) { targetCommand.AddParameter("TransferEncoding", TransferEncoding.Get(context)); } if (InFile.Expression != null) { targetCommand.AddParameter("InFile", InFile.Get(context)); } if (OutFile.Expression != null) { targetCommand.AddParameter("OutFile", OutFile.Get(context)); } if (PassThru.Expression != null) { targetCommand.AddParameter("PassThru", PassThru.Get(context)); } return(new ActivityImplementationContext() { PowerShellInstance = invoker }); }
public Variable(LogLine logLine, SessionVariable sessionVariable, string value) { this.LogLine = logLine; this.SessionVariable = sessionVariable; this.Value = value; }