/* C R E A T E N E W W I N D O W */ /*---------------------------------------------------------------------------- * %%Function: CreateNewWindow * %%Qualified: AzLog.AzLogWindow.CreateNewWindow * %%Contact: rlittle * * ----------------------------------------------------------------------------*/ public static AzLogWindow CreateNewWindow(AzLogModel azlm, string sViewName, AzLogFilter azlf, ILogClient ilc) { AzLogWindow azlw = new AzLogWindow(); if (String.IsNullOrEmpty(sViewName)) { sViewName = "Default"; } azlw.SetView(sViewName); azlw.m_azlv = new AzLogView(azlw); azlw.m_azlv.SetFilter(azlf); // propagate the filter values we were given into the textboxes on our window AzLogFilter.AzLogFilterCondition azlfc; azlfc = azlf.Operations[0].Condition; if (azlfc.LHS.Source == AzLogFilter.AzLogFilterValue.DataSource.DttmRow && azlfc.Comparison == AzLogFilter.AzLogFilterCondition.CmpOp.Gte) { azlw.m_ebStart.Text = azlfc.RHS.Dttm(null).ToLocalTime().ToString("MM/dd/yy HH:mm"); } azlfc = azlf.Operations[1].Condition; if (azlfc.LHS.Source == AzLogFilter.AzLogFilterValue.DataSource.DttmRow && azlfc.Comparison == AzLogFilter.AzLogFilterCondition.CmpOp.Lt) { azlw.m_ebEnd.Text = azlfc.RHS.Dttm(null).ToLocalTime().ToString("MM/dd/yy HH:mm"); } azlw.m_ilc = ilc; azlw.m_azlm = azlm; azlw.m_azlv.BuildView(azlw.m_azlm, new CompareLogEntryTickCount(azlw.m_azlm)); // azlw.m_lvLog.VirtualListSize = azlw.m_azlv.Length; azlw.m_lvLog.SetVirtualListSize(azlw.m_azlv.Length); return(azlw); }
/* C R E A T E N E W W I N D O W */ /*---------------------------------------------------------------------------- %%Function: CreateNewWindow %%Qualified: AzLog.AzLogWindow.CreateNewWindow %%Contact: rlittle ----------------------------------------------------------------------------*/ public static AzLogWindow CreateNewWindow(AzLogModel azlm, string sViewName, AzLogFilter azlf, ILogClient ilc) { AzLogWindow azlw = new AzLogWindow(); azlw.SetView(sViewName); azlw.m_azlv = new AzLogView(azlw); azlw.m_azlv.SetFilter(azlf); // propagate the filter values we were given into the textboxes on our window AzLogFilter.AzLogFilterCondition azlfc; azlfc = azlf.Operations[0].Condition; if (azlfc.LHS.Source == AzLogFilter.AzLogFilterValue.DataSource.DttmRow && azlfc.Comparison == AzLogFilter.AzLogFilterCondition.CmpOp.Gte) azlw.m_ebStart.Text = azlfc.RHS.Dttm(null).ToString("MM/dd/yy HH:mm"); azlfc = azlf.Operations[1].Condition; if (azlfc.LHS.Source == AzLogFilter.AzLogFilterValue.DataSource.DttmRow && azlfc.Comparison == AzLogFilter.AzLogFilterCondition.CmpOp.Lt) azlw.m_ebEnd.Text = azlfc.RHS.Dttm(null).ToString("MM/dd/yy HH:mm"); azlw.m_ilc = ilc; azlw.m_azlm = azlm; azlw.m_azlv.BuildView(azlw.m_azlm, new CompareLogEntryTickCount(azlw.m_azlm)); azlw.m_lvLog.VirtualListSize = azlw.m_azlv.Length; return azlw; }
/* C R E A T E V I E W F O R C O L L E C T I O N */ /*---------------------------------------------------------------------------- * %%Function: CreateViewForCollection * %%Qualified: AzLog.AzLog.CreateViewForCollection * %%Contact: rlittle * * Create a window with the initial query parameters from this screen * ----------------------------------------------------------------------------*/ private void CreateViewForCollection(object sender, EventArgs e) { if (m_azlm == null) { m_azlm = new AzLogModel(); // load all of our datasources and attach them foreach (IAzLogDatasource iazlds in m_azlc.Sources) { if (!iazlds.FOpen(null, s_sRegRoot)) { throw new Exception(String.Format("couldn't open datasource {0}", iazlds.ToString())); } m_azlm.AttachDatasource(iazlds); } } // figure out the timespan being requested DateTime dttmMin, dttmMac; if (m_cbAllDates.Checked) { if (!m_azlm.FGetMinMacDateRange(out dttmMin, out dttmMac)) { MessageBox.Show("Cannot automatically set date range -- this option only works when at least one datasource is a file. Setting date range to today."); dttmMin = DateTime.Today; dttmMac = dttmMin.AddDays(1); } } else { AzLogModel.FillMinMacFromStartEnd(m_ebStart.Text, m_ebEnd.Text, out dttmMin, out dttmMac); } AzLogFilter azlf = new AzLogFilter(); // create a basic filter based on the range they asked for azlf.Add(new AzLogFilter.AzLogFilterCondition(AzLogFilter.AzLogFilterValue.ValueType.DateTime, AzLogFilter.AzLogFilterValue.DataSource.DttmRow, AzLogEntry.LogColumn.Nil, AzLogFilter.AzLogFilterCondition.CmpOp.Gte, dttmMin)); azlf.Add(new AzLogFilter.AzLogFilterCondition(AzLogFilter.AzLogFilterValue.ValueType.DateTime, AzLogFilter.AzLogFilterValue.DataSource.DttmRow, AzLogEntry.LogColumn.Nil, AzLogFilter.AzLogFilterCondition.CmpOp.Lt, dttmMac)); azlf.Add(AzLogFilter.AzLogFilterOperation.OperationType.And); AzLogWindow azlw = AzLogWindow.CreateNewWindow(m_azlm, m_azlc.DefaultView, azlf, this); azlw.Show(); m_azlm.AddView(azlw.View); // we don't know what partition we're going to find this data in, so launch a query // from the first partition for this date range //m_azlm.FFetchPartitionsForDateRange(dttmMin, nHourMin, dttmMac, nHourMac); m_azlm.FFetchPartitionsForDateRange(dttmMin, dttmMac); }
/* A Z L O G V I E W */ /*---------------------------------------------------------------------------- * %%Function: AzLogView * %%Qualified: AzLog.AzLogView.AzLogView * %%Contact: rlittle * * Constructor used only by unit tests -- there is no attached window! * ----------------------------------------------------------------------------*/ public AzLogView() { m_azlw = null; m_nLogViewGeneration = (new Random(System.Environment.TickCount)).Next(10000); }
/* A Z L O G V I E W */ /*---------------------------------------------------------------------------- * %%Function: AzLogView * %%Qualified: AzLog.AzLogView.AzLogView * %%Contact: rlittle * * ----------------------------------------------------------------------------*/ public AzLogView(AzLogWindow azlw) { m_azlw = azlw; m_nLogViewGeneration = (new Random(System.Environment.TickCount)).Next(10000); }
/* A Z L O G V I E W */ /*---------------------------------------------------------------------------- %%Function: AzLogView %%Qualified: AzLog.AzLogView.AzLogView %%Contact: rlittle Constructor used only by unit tests -- there is no attached window! ----------------------------------------------------------------------------*/ public AzLogView() { m_azlw = null; m_nLogViewGeneration = (new Random(System.Environment.TickCount)).Next(10000); }
/* A Z L O G V I E W */ /*---------------------------------------------------------------------------- %%Function: AzLogView %%Qualified: AzLog.AzLogView.AzLogView %%Contact: rlittle ----------------------------------------------------------------------------*/ public AzLogView(AzLogWindow azlw) { m_azlw = azlw; m_nLogViewGeneration = (new Random(System.Environment.TickCount)).Next(10000); }