public override void OnEnable()
        {
            base.OnEnable();

            m_Materials         = serializedObject.FindProperty("m_Materials");
            m_BlendShapeWeights = serializedObject.FindProperty("m_BlendShapeWeights");
            m_AABB      = serializedObject.FindProperty("m_AABB");
            m_DirtyAABB = serializedObject.FindProperty("m_DirtyAABB");

            m_BoundsHandle.SetColor(Handles.s_BoundingBoxHandleColor);

            InitializeProbeFields();
            InitializeLightingFields();

            List <string> excludedProperties = new List <string>();

            excludedProperties.AddRange(new[]
            {
                "m_CastShadows",
                "m_ReceiveShadows",
                "m_MotionVectors",
                "m_Materials",
                "m_BlendShapeWeights",
                "m_AABB",
                "m_LightmapParameters",
                "m_DynamicOccludee"
            });
            excludedProperties.AddRange(Probes.GetFieldsStringArray());
            m_ExcludedProperties = excludedProperties.ToArray();
        }
        public virtual void OnEnable()
        {
            m_SortingOrder         = serializedObject.FindProperty("m_SortingOrder");
            m_SortingLayerID       = serializedObject.FindProperty("m_SortingLayerID");
            m_DynamicOccludee      = serializedObject.FindProperty("m_DynamicOccludee");
            m_RenderingLayerMask   = serializedObject.FindProperty("m_RenderingLayerMask");
            m_RendererPriority     = serializedObject.FindProperty("m_RendererPriority");
            m_MotionVectors        = serializedObject.FindProperty("m_MotionVectors");
            m_SkinnedMotionVectors = serializedObject.FindProperty("m_SkinnedMotionVectors");
            m_Materials            = serializedObject.FindProperty("m_Materials");
            m_MaterialsSize        = serializedObject.FindProperty("m_Materials.Array.size");

            m_ShowMaterials     = new SavedBool($"{target.GetType()}.ShowMaterials", true);
            m_ShowProbeSettings = new SavedBool($"{target.GetType()}.ShowProbeSettings", true);
            m_ShowOtherSettings = new SavedBool($"{target.GetType()}.ShowOtherSettings", true);

            m_Lighting = new LightingSettingsInspector(serializedObject);
            m_Lighting.showLightingSettings = new SavedBool($"{target.GetType()}.ShowLightingSettings", true);
            m_Lighting.showLightmapSettings = new SavedBool($"{target.GetType()}.ShowLightmapSettings", true);
            m_Lighting.showBakedLightmap    = new SavedBool($"{target.GetType()}.ShowBakedLightmapSettings", false);
            m_Lighting.showRealtimeLightmap = new SavedBool($"{target.GetType()}.ShowRealtimeLightmapSettings", false);

            m_Probes = new Probes();
            m_Probes.Initialize(serializedObject);
        }
示例#3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                txtFromDate.Text = GeneralUtility.ConvertDisplayDateStringFormat(System.DateTime.Now);
                txtToDate.Text   = GeneralUtility.ConvertDisplayDateStringFormat(System.DateTime.Now);

                var Probes = new Probes();
                var result = Probes.FindAllBranch();

                ddlCenterName.Items.Insert(0, "All");
                for (int i = 0; i < result.Count; i++)
                {
                    ddlCenterName.Items.Insert(i + 1, new ListItem(result[i].BranchName, result[i].BranchCode));
                }

                #region "Not Used"
                //var Probes = new Probes();
                //var result = Probes.Finds().Select(x => x.Center).Distinct().ToList();

                //ddlCenterName.Items.Insert(0, "All");
                //for (int i = 0; i < result.Count; i++)
                //{
                //    ddlCenterName.Items.Insert(i + 1, new ListItem(result[i], result[i]));
                //}
                #endregion
            }
        }
示例#4
0
        public override void OnEnable()
        {
            base.OnEnable();

            List <string> excludedProperties = new List <string>();

            excludedProperties.Add("m_Parameters");
            excludedProperties.AddRange(Probes.GetFieldsStringArray());
            if (!SupportedRenderingFeatures.active.rendererSupportsMotionVectors)
            {
                excludedProperties.Add("m_MotionVectors");
            }
            if (!SupportedRenderingFeatures.active.rendererSupportsReceiveShadows)
            {
                excludedProperties.Add("m_ReceiveShadows");
            }
            excludedProperties.Add("m_RenderingLayerMask");
            m_ExcludedProperties = excludedProperties.ToArray();

            m_CurveEditor.OnEnable(serializedObject);
            m_ColorGradient        = serializedObject.FindProperty("m_Parameters.colorGradient");
            m_NumCornerVertices    = serializedObject.FindProperty("m_Parameters.numCornerVertices");
            m_NumCapVertices       = serializedObject.FindProperty("m_Parameters.numCapVertices");
            m_Alignment            = serializedObject.FindProperty("m_Parameters.alignment");
            m_TextureMode          = serializedObject.FindProperty("m_Parameters.textureMode");
            m_GenerateLightingData = serializedObject.FindProperty("m_Parameters.generateLightingData");

            InitializeProbeFields();
        }
        /// <summary>
        /// The get probes.
        /// </summary>
        /// <param name="networkId">
        /// The network id.
        /// </param>
        /// <returns>
        /// The <see cref="Task"/>.
        /// </returns>
        public async Task <IEnumerable <Probe> > GetProbes(string networkId)
        {
            Probes probes =
                await
                this._apiClient.GetAsync <Probes>(
                    ApiUris.CreateOrGetVipProbes(this._apiClient.OrganizationId, networkId));

            return(probes.Items ?? null);
        }
        public override void OnEnable()
        {
            base.OnEnable();

            m_PointEditor = new LineRendererEditor(target as LineRenderer, this);
            m_PointEditor.Deselect();
            SceneView.onSceneGUIDelegate     += OnSceneGUIDelegate;
            Undo.undoRedoPerformed           += UndoRedoPerformed;
            EditMode.onEditModeStartDelegate += EditModeStarted;
            EditMode.onEditModeEndDelegate   += EditModeEnded;

            List <string> excludedProperties = new List <string>();

            excludedProperties.Add("m_Loop");
            excludedProperties.Add("m_Parameters");
            excludedProperties.Add("m_Positions");
            excludedProperties.AddRange(Probes.GetFieldsStringArray());
            if (!SupportedRenderingFeatures.active.rendererSupportsMotionVectors)
            {
                excludedProperties.Add("m_MotionVectors");
            }
            if (!SupportedRenderingFeatures.active.rendererSupportsReceiveShadows)
            {
                excludedProperties.Add("m_ReceiveShadows");
            }
            excludedProperties.Add("m_RenderingLayerMask");
            m_ExcludedProperties = excludedProperties.ToArray();

            m_CurveEditor.OnEnable(serializedObject);
            m_Loop                 = serializedObject.FindProperty("m_Loop");
            m_Positions            = serializedObject.FindProperty("m_Positions");
            m_PositionsSize        = serializedObject.FindProperty("m_Positions.Array.size");
            m_ColorGradient        = serializedObject.FindProperty("m_Parameters.colorGradient");
            m_NumCornerVertices    = serializedObject.FindProperty("m_Parameters.numCornerVertices");
            m_NumCapVertices       = serializedObject.FindProperty("m_Parameters.numCapVertices");
            m_Alignment            = serializedObject.FindProperty("m_Parameters.alignment");
            m_TextureMode          = serializedObject.FindProperty("m_Parameters.textureMode");
            m_GenerateLightingData = serializedObject.FindProperty("m_Parameters.generateLightingData");
            m_ShadowBias           = serializedObject.FindProperty("m_Parameters.shadowBias");

            m_PositionsView = new LineRendererPositionsView(m_Positions);
            m_PositionsView.selectionChangedCallback += PositionsViewSelectionChanged;

            m_ShowPositionsAnimation = new AnimBool(false, Repaint)
            {
                value = m_Positions.isExpanded
            };
            EditorApplication.contextualPropertyMenu += OnPropertyContextMenu;

            // We cannot access isEditingMultipleObjects when drawing the SceneView so we need to cache it here for later use.
            m_IsMultiEditing = serializedObject.isEditingMultipleObjects;

            InitializeProbeFields();
        }
示例#7
0
        protected override void InitializeChart()
        {
            double Tmax = 0;

            Probes.Foreach((p) => Tmax += p.T_ON + p.T_OFF + p.T_RESPONSE + 2);
            Visualizer.Pmax             = 100;
            Visualizer.Tmax             = Tmax;
            Visualizer.Conditioning     = false;
            Visualizer.SecondCuff       = SECOND_CUFF;
            Visualizer.PrimaryChannel   = 1;
        }
示例#8
0
        public override void OnEnable()
        {
            base.OnEnable();
            InitializeProbeFields();

            List <string> excludedProperties = new List <string>();

            excludedProperties.AddRange(new[]
            {
                "m_Materials",
                "m_LightmapParameters"
            });
            excludedProperties.AddRange(Probes.GetFieldsStringArray());
            m_ExcludedProperties = excludedProperties.ToArray();
        }
示例#9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //txtImportDate.Text = GeneralUtility.ConvertDisplayDateStringFormat(System.DateTime.Now);
                globalCenterName = string.Empty;
                var Probes = new Probes();
                var result = Probes.FindAllBranch();

                for (int i = 0; i < result.Count; i++)
                {
                    ddlCenterName.Items.Insert(i, new ListItem(result[i].BranchName, result[i].BranchCode));
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                var Probes = new Probes();
                var result = Probes.FindAllBranch();

                for (int i = 0; i < result.Count; i++)
                {
                    ddlCenterName.Items.Insert(i, new ListItem(result[i].BranchName, result[i].BranchCode));
                }
                var date1 = GeneralUtility.ConvertDisplayDateStringFormat(System.DateTime.Now);
                date = GeneralUtility.ConvertSystemDateStringFormat(txtImportDate.Text);
                txtImportDate.Text = date1.Substring(3, 7).ToString();
            }
        }
示例#11
0
文件: Board.cs 项目: Nkmol/Circuit
        public override void Calculate()
        {
            // TODO Support multiplle Input + Output for sub-boards
            if (Previous.Any())
            {
                Inputs.ForEach(input => input.Value = Previous.First().Value);
            }

            foreach (var cycle in Cycle())
            {
                cycle.ForEach(x => x.Calculate());
            }

            // Define the actuall value of the board by most occuring Probe value
            Value = Probes.GroupBy(x => x.Value).OrderByDescending(grp => grp.Count()).Select(group => group.Key)
                    .First();
        }
示例#12
0
        private void BuildCircuit()
        {
            string filepath = _fileSelectorFactoryAdapter.GetPathFromFile(_selectedFileName);

            _mc.BuildCircuit(filepath);

            Inputs.Clear();
            _mc.getInputs().ForEach(i => Inputs.Add(new NodeViewModel(i, this)));

            Nodes.Clear();
            _mc.getNodes().ForEach(i => Nodes.Add(new NodeViewModel(i, this)));

            Probes.Clear();
            _mc.getProbes().ForEach(i => Probes.Add(new NodeViewModel(i, this)));

            base.RaisePropertyChanged();
            _mc.Run();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //BindQAT();

                var Probes = new Probes();
                var result = Probes.FindAllBranch();

                for (int i = 0; i < result.Count; i++)
                {
                    ddlCenterName.Items.Insert(i, new ListItem(result[i].BranchName, result[i].BranchCode));
                }
                ddlCenterName_SelectedIndexChanged(sender, e);
                if (btnSubmit.Text == "Search")
                {
                    BindGrid();
                }
            }
        }
        public override void OnEnable()
        {
            base.OnEnable();

            InitializeProbeFields();

            List <string> excludedProperties = new List <string>();

            if (!SupportedRenderingFeatures.active.rendererSupportsMotionVectors)
            {
                excludedProperties.Add("m_MotionVectors");
            }
            if (!SupportedRenderingFeatures.active.rendererSupportsReceiveShadows)
            {
                excludedProperties.Add("m_ReceiveShadows");
            }
            excludedProperties.AddRange(Probes.GetFieldsStringArray());

            m_ExcludedProperties = excludedProperties.ToArray();
        }
示例#15
0
        internal IAutoHealthCheckContext AddProbe <TProbe>()
            where TProbe : class, IProbe
        {
            // validate type is not an interface
            if (typeof(TProbe).IsInterface)
            {
                throw new InvalidOperationException("Probe cannot be an interface.");
            }

            // validate type is not abstract
            if (typeof(TProbe).IsAbstract)
            {
                throw new InvalidOperationException("Probe cannot be abstract.");
            }

            if (Probes.All(p => p != typeof(TProbe)))
            {
                Probes.Add(typeof(TProbe));
            }

            return(this);
        }
示例#16
0
        private async void OnOpened(object sender, EventArgs _)
        {
            Device = FindDevice();
            try
            {
                await MonitoringMode(true);

                Console.WriteLine($"-- Listening on {Device.Name}, hit 'Enter' to stop...");

                Task.Run(() =>
                {
                    while (true)
                    {
                        Probes.Clear();
                        foreach (var kvp in ProbeCache.Cache)
                        {
                            foreach (var ce in kvp.Value)
                            {
                                Probes.Add(ce);
                            }
                        }
                        Beacons.Clear();
                        foreach (var kvp in BeaconCache.Cache)
                        {
                            foreach (var ce in kvp.Value)
                            {
                                Beacons.Add(ce);
                            }
                        }
                        Thread.Sleep(1000);
                    }
                }).ConfigureAwait(false);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
示例#17
0
 public void UseColliderForProbe(Collider collider)
 {
     probeCollider = collider;
     Probe         = Probes.ColliderBounds;
 }
 public static void NodeEquals(this Probes path, int x, int y)
 {
     Assert.AreEqual(x, path.X);
     Assert.AreEqual(y, path.Y);
 }
        protected void btnExport_Click(object sender, EventArgs e)
        {
            if (txtMonth.Text != "" && txtMonth.Text != null)
            {
                #region "For Above 96%+5K"

                string count1 = "0";
                string count2 = "0";

                calculateMonth = GeneralUtility.ConvertMonthYearStringFormat(txtMonth.Text.Trim());

                //calculateFromDate = calculateMonth + "16";  //calculateFromDate

                calculateToDate = calculateMonth + "15";  //calculateToDate

                string   calculatedate = new AccuracyPercentage().FindPreviousMonth(calculateToDate);
                DateTime calfromtime   = DateTime.Parse(calculatedate);
                var      cdate         = GeneralUtility.ConvertSystemDateStringFormat(calfromtime);
                string   cmonth        = cdate.Substring(4, 2);
                string   cyear         = cdate.Substring(0, 4);
                cMonth2 = cyear + cmonth;

                //calculateToDate = cMonth2 + "15"; //calculateToDate

                calculateFromDate = cMonth2 + "16"; //calculateFromDate

                if ((txtFromDate.Text == "" || txtFromDate.Text == null) || (txtToDate.Text == "" || txtToDate.Text == null))
                {
                    MessageBox.MessageShow(this.GetType(), "Please Choose From/To Date!.", ClientScript);
                    return;
                }

                else
                {
                    fromDate = GeneralUtility.ConvertSystemDateStringFormat(txtFromDate.Text);
                    toDate   = GeneralUtility.ConvertSystemDateStringFormat(txtToDate.Text);

                    DateTime dtStartDate = DateTime.ParseExact(GeneralUtility.ConvertDisplayDateStringFormat(this.txtFromDate.Text.Trim()), "dd/MM/yyyy", CultureInfo.InvariantCulture);
                    DateTime dtEndDate   = DateTime.ParseExact(GeneralUtility.ConvertDisplayDateStringFormat(this.txtToDate.Text.Trim()), "dd/MM/yyyy", CultureInfo.InvariantCulture);


                    count1 = new Probes().CheckDate(calculateFromDate, calculateToDate, fromDate);
                    count2 = new Probes().CheckDate(calculateFromDate, calculateToDate, toDate);

                    if (count1 == "0" || count2 == "0")
                    {
                        MessageBox.MessageShow(this.GetType(), "Please Check From/To Date Range!.", ClientScript);
                        return;
                    }

                    if ((dtEndDate.Date != dtStartDate.Date))
                    {
                        if (!(dtEndDate.Date > dtStartDate.Date))
                        {
                            MessageBox.MessageShow(this.GetType(), "Invalid End Date.", ClientScript);
                            //this.txtToDate.Focus();
                            return;
                        }
                    }

                    string fromYear  = fromDate.Substring(0, 4);
                    string fromMonth = fromDate.Substring(4, 2);

                    string toYear  = toDate.Substring(0, 4);
                    string toMonth = toDate.Substring(4, 2);

                    if (fromYear == toYear && fromMonth == toMonth)
                    {
                        Month1    = fromYear + fromMonth;
                        Month2    = string.Empty;
                        FromDate2 = string.Empty;
                        ToDate2   = string.Empty;
                    }
                    else
                    {
                        //string comparedate=new AccuracyPercentage().FindMonthAndYear(fromDate);
                        //string comparemonth = comparedate.Substring(3, 2);
                        //string compareyear = comparedate.Substring(6, 4);

                        string   comparedate  = new AccuracyPercentage().FindMonthAndYear(fromDate);
                        DateTime fromtime     = DateTime.Parse(comparedate);
                        var      fdate        = GeneralUtility.ConvertSystemDateStringFormat(fromtime);
                        string   comparemonth = fdate.Substring(4, 2);
                        string   compareyear  = fdate.Substring(0, 4);

                        if (compareyear != toYear || comparemonth != toMonth)
                        {
                            MessageBox.MessageShow(this.GetType(), "Please Check FromDate and ToDate!.", ClientScript);
                            return;
                        }

                        Month1    = fromYear + fromMonth;
                        Month2    = compareyear + comparemonth;
                        FromDate2 = Month2 + "01";
                        ToDate2   = toDate;
                        toDate    = new AccuracyPercentage().FindLastDayOfMonth(fromDate);
                    }
                }
                // FindByMonthFor3PA(branchcode, GeneralUtility.ConvertMonthYearStringFormat(txtMonth.Text.Trim()),fromDate,toDate,month2,fromDate2,toDate2);
                //@Center nvarchar(30),@Month nvarchar(30),@FromDate VARCHAR(8), @ToDate VARCHAR(8),@Month2 nvarchar(30),@FromDate2 VARCHAR(8), @ToDate2 VARCHAR(8)

                //var branchcode = string.Empty;

                //if (ddlCenterName.SelectedItem.Value != "All")
                //{
                //    branchcode = ddlCenterName.SelectedValue.ToString();
                //}

                var branchcode = string.Empty;

                if (ddlCenterName.SelectedIndex != 0)
                {
                    branchcode = ddlCenterName.SelectedValue.ToString();
                }
                else
                {
                    MessageBox.MessageShow(this.GetType(), "Please Choose Center!.", ClientScript);
                    return;
                }

                new Probes
                {
                    Criteria = new PPP_Project.Criteria.ImportJobsCriteria
                    {
                        CenterName = branchcode,
                        FromDate   = calculateFromDate,
                        ToDate     = calculateToDate,
                        Month1     = cMonth2,
                        Month2     = Month2,
                        FromDate2  = FromDate2,
                        ToDate2    = ToDate2,
                    }
                }.CalculateTotalProbes();

                var finalAccuracyList = new AccuracyPercentage().FindByMonthFor3PAGSS(branchcode, cMonth2, fromDate, toDate, Month2, FromDate2, ToDate2);

                DataTable attTbl = new DataTable();

                attTbl.Clear();
                attTbl.Columns.Clear();

                var result = (from dd in finalAccuracyList
                              orderby dd.QAT
                              select dd).ToList();

                // Convert to DataTable.
                DataTable table = ConvertToDataTable(result);

                table.Columns.Remove("RQuality");
                table.Columns.Remove("AmountforProbes");
                table.Columns.Remove("AmountforAccuracy");
                table.Columns.Remove("PPPA");
                table.Columns.Remove("Center");
                table.Columns.Remove("Month");
                table.Columns.Remove("Quality");
                table.Columns.Remove("Name");

                //int sum = finalProbesdt.AsEnumerable().Sum(s => s.Field<int>("Total Probes"));

                var      yrm  = GeneralUtility.ConvertSystemDateStringFormat(calculateToDate);
                int      yr   = Convert.ToInt32(yrm.Substring(0, 4).ToString());
                int      mth  = Convert.ToInt32(yrm.Substring(4, 2).ToString());
                DateTime date = new DateTime(yr, mth, 1);
                var      mm   = date.ToString("MMMM");
                var      yy   = date.ToString("yy");

                if (result.Count().Equals(0))
                {
                    MessageBox.MessageShow(GetType(), "No Export Data.!", ClientScript);
                }
                else
                {
                    var fileName = "3PA" + mm + "'" + yy + ".xlsx";
                    int count    = 0;
                    Response.Clear();
                    Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
                    //Response.AddHeader("content-disposition", "attachment;filename=" + HttpUtility.UrlEncode("Probes_List_Export.xlsx", System.Text.Encoding.UTF8));
                    this.Response.AddHeader(
                        "content-disposition",
                        string.Format("attachment;  filename={0}", fileName));

                    ExcelPackage pkg = new ExcelPackage();

                    using (pkg)
                    {
                        ExcelWorksheet ws = pkg.Workbook.Worksheets.Add("3PA Ori");

                        ws.Cells["A1"].LoadFromDataTable(table, true);

                        #region "No need region"
                        // using (ExcelRange rng = ws.Cells["A1:W1"])
                        //  using (ExcelRange r = workSheet.Cells[startRowFrom, 1, startRowFrom, dataTable.Columns.Count])
                        using (ExcelRange rng = ws.Cells[1, 1, 1, table.Columns.Count])
                        {
                            rng.Style.Font.Bold = true;
                            //Set Pattern for the background to Solid
                            rng.Style.Fill.PatternType = ExcelFillStyle.Solid;
                            //Set color to dark blue
                            rng.Style.Fill.BackgroundColor.SetColor(System.Drawing.Color.FromArgb(79, 129, 189));
                            //  rng.Style.Fill.BackgroundColor.SetColor(System.Drawing.Color.FromArgb(122,160,205));
                            rng.Style.Font.Color.SetColor(System.Drawing.Color.White);
                        }

                        //ws.Cells["A1:MT"].Style.Font.Bold = true;
                        ////ws.Cells["A1"].Style.Font.Bold = true;
                        //using (ExcelRange rng = ws.Cells["A1:U" + (colcount - 1)])
                        //{
                        //    rng.Style.Font.Bold = true;
                        //}

                        //var headerCell = ws.Cells["A5:MT"];
                        //headerCell.Style.Fill.PatternType = ExcelFillStyle.Solid;
                        //headerCell.Style.Fill.BackgroundColor.SetColor(System.Drawing.Color.BurlyWood);
                        //var headerFont = headerCell.Style.Font;
                        //headerFont.Bold = true;

                        //ws.Cells[1, 30].Style.Fill.PatternType = ExcelFillStyle.Solid;
                        //ws.Cells[1, 30].Style.Fill.BackgroundColor.SetColor(System.Drawing.Color.LightBlue);
                        //ws.Cells[1, 30].Style.VerticalAlignment = ExcelVerticalAlignment.Center;
                        //ws.Cells[1, 30].Style.HorizontalAlignment = ExcelHorizontalAlignment.Center;
                        #endregion

                        if (result.Count() > 0)
                        {
                            count = result.Count() + 2;
                            //    pkg.Workbook.Worksheets.FirstOrDefault().Cells[count, 3].Value = sum;//result.Sum(x => x.TotalProbes);
                            //    pkg.Workbook.Worksheets.FirstOrDefault().Cells[count, 3].Style.Font.Bold = true;
                            //    pkg.Workbook.Worksheets.FirstOrDefault().Cells[count, 3].Style.Font.UnderLine = true;
                            //    pkg.Workbook.Worksheets.FirstOrDefault().Cells[count, 3].Style.Font.Color.SetColor(System.Drawing.Color.Blue);
                            //    pkg.Workbook.Worksheets.FirstOrDefault().Cells[count, 3].Style.Border.BorderAround(ExcelBorderStyle.Thin);
                        }

                        pkg.Workbook.Worksheets.FirstOrDefault().DefaultColWidth = 20;
                        pkg.Workbook.Worksheets.FirstOrDefault().Row(1).Height = 25;

                        // using (ExcelRange r = workSheet.Cells[startRowFrom + 1, 1, startRowFrom + dataTable.Rows.Count, dataTable.Columns.Count])
                        // var modelTable = pkg.Workbook.Worksheets.FirstOrDefault().Cells["A1:MP" + (count - 1)]; //+ (count - 1)

                        var modelTable = pkg.Workbook.Worksheets.FirstOrDefault().Cells[ws.Dimension.Start.Row, 1, ws.Dimension.Start.Row + table.Rows.Count, table.Columns.Count]; //+ (count - 1)
                        var border     = modelTable.Style.Border.Top.Style = modelTable.Style.Border.Left.Style = modelTable.Style.Border.Right.Style = modelTable.Style.Border.Bottom.Style = ExcelBorderStyle.Thin;
                        pkg.Workbook.Properties.Title = "Attempts";

                        this.Response.BinaryWrite(pkg.GetAsByteArray());
                        this.Response.End();
                    }
                } // End Export Block


                #endregion // End Probes
            }
            else
            {
                MessageBox.MessageShow(this.GetType(), "Please Choose Export Date!.", ClientScript);
            }
        }
 public void ProbeRequest(Probes type, int urgency)
 {
     publisher.ProbeRequest(type, urgency);
 }
示例#21
0
        protected void btnExport_Click(object sender, EventArgs e)
        {
            fromDate = GeneralUtility.ConvertSystemDateStringFormat(txtFromDate.Text);
            toDate   = GeneralUtility.ConvertSystemDateStringFormat(txtToDate.Text);

            var branchcode = string.Empty;

            if (ddlCenterName.SelectedItem.Value != "All")
            {
                branchcode = ddlCenterName.SelectedValue.ToString();
            }


            var probesList = new Probes
            {
                Criteria = new PPP_Project.Criteria.ImportJobsCriteria
                {
                    CenterName = branchcode,
                    FromDate   = fromDate,
                    ToDate     = toDate,
                }
            }.FindProbesJobImportList(); // FindByCriteria(); // for Probes //

            #region "Probes"

            DataTable attTbl = new DataTable();
            attTbl.Clear();
            attTbl.Columns.Clear();


            #endregion

            var pricingprobesList = new PricingProbes
            {
                Criteria = new PPP_Project.Criteria.ImportJobsCriteria
                {
                    CenterName = branchcode,
                    FromDate   = fromDate,
                    ToDate     = toDate,
                }
            }.FindPricingProbesJobImportList(); //FindByCriteria(); // for PricingProbes

            var masksList = new Masks
            {
                Criteria = new PPP_Project.Criteria.ImportJobsCriteria
                {
                    CenterName = branchcode,
                    FromDate   = fromDate,
                    ToDate     = toDate,
                }
            }.FindMasksJobImportList();  //FindByCriteria(); // for Masks

            var votesList = new Votes
            {
                Criteria = new PPP_Project.Criteria.ImportJobsCriteria
                {
                    CenterName = branchcode,
                    FromDate   = fromDate,
                    ToDate     = toDate,
                }
            }.FindVotesJobImportList(); //FindByCriteria(); // for Votes

            var repricingList = new Repricing
            {
                Criteria = new PPP_Project.Criteria.ImportJobsCriteria
                {
                    CenterName = branchcode,
                    FromDate   = fromDate,
                    ToDate     = toDate,
                }
            }.FindRepricingJobImportList(); //FindByCriteria(); // for repricing

            var scenesList = new Scenes
            {
                Criteria = new PPP_Project.Criteria.ImportJobsCriteria
                {
                    CenterName = branchcode,
                    FromDate   = fromDate,
                    ToDate     = toDate,
                }
            }.FindScenesJobImportList(); //FindByCriteria(); // for scenes

            var scenerecognitionList = new SceneRecognition
            {
                Criteria = new PPP_Project.Criteria.ImportJobsCriteria
                {
                    CenterName = branchcode,
                    FromDate   = fromDate,
                    ToDate     = toDate,
                }
            }.FindSceneRecognitionJobImport(); //.FindByCriteria(); // for scenerecognition

            var categoryexpertList = new CategoryExpert
            {
                Criteria = new PPP_Project.Criteria.ImportJobsCriteria
                {
                    CenterName = branchcode,
                    FromDate   = fromDate,
                    ToDate     = toDate,
                }
            }.FindCategoryExpertJobImport(); //FindByCriteria(); // for categoryexpert

            #region "Currently No Need"

            //var smartstitchingList = new SmartStitching
            //{
            //    Criteria = new PPP_Project.Criteria.ImportJobsCriteria
            //    {
            //        CenterName = branchcode,
            //        FromDate = fromDate,
            //        ToDate = toDate,
            //    }
            //}.FindSmartStitchingJobImportList(); //FindByCriteria(); // for smartstitching

            //var categoryexpertvotingList = new CategoryExpertVoting
            //{
            //    Criteria = new PPP_Project.Criteria.ImportJobsCriteria
            //    {
            //        CenterName = branchcode,
            //        FromDate = fromDate,
            //        ToDate = toDate,
            //    }
            //}.FindCategoryExpertVotingJobImportList(); // for categoryexpert

            #endregion


            #region "For Probes"
            //if (ddlJobName.SelectedValue == "Probes")
            //{
            //    var probesList = new Probes
            //    {
            //        Criteria = new PPP_Project.Criteria.ImportJobsCriteria
            //        {
            //            CenterName = branchcode,
            //            FromDate = fromDate,
            //            ToDate = toDate,
            //        }

            //    }.FindByCriteria();

            //    DataTable attTbl = new DataTable();

            //    attTbl.Clear();
            //    attTbl.Columns.Clear();

            //    var result = (from dd in probesList
            //                  orderby dd.Center
            //                  select dd).ToList();

            //    // Convert to DataTable.
            //    DataTable table = ConvertToDataTable(result);

            //    //for (int i = table.Columns.Count - 1; i >= 0; i--)

            //    table.Columns.Remove(table.Columns[0]);
            //    table.Columns.Remove("TableName");

            //    if (result.Count() != 0)
            //    {
            //        for (int i = table.Columns.Count - 1; i >= 0; i--) // this is mean (table.Columns.Count - 1) last column count
            //        {
            //            DataRow row = table.Rows[table.Rows.Count - 1];
            //            //row["CreatedDate"] = GeneralUtility.ConvertDisplayDateStringFormat(Convert.ToDateTime(table.AsEnumerable().Last())); //(row["CreatedDate"]) // not good

            //            int totalRows = table.Rows.Count;
            //            int totalCols = table.Columns.Count;

            //            string value = table.Rows[totalRows - 1][totalCols - 1].ToString();

            //            for (int j = 0; j < totalRows; j++)
            //            {
            //                table.Rows[j]["CreatedDate"] = GeneralUtility.ConvertDisplayDateStringFormat(value); // this is change to String Datetime to Display String Date in DataTable

            //                table.AcceptChanges();
            //            }

            //        }
            //    }

            //    //DataTable finalProbesdt2 = table.CopyToDataTable();

            //    DataTable finalProbesdt = SupressEmptyColumns(table);

            //    //int sum = finalProbesdt.AsEnumerable().Sum(s => s.Field<int>("Total Probes"));

            //    if (result.Count().Equals(0))
            //    {
            //        MessageBox.MessageShow(GetType(), "No Export Data.!", ClientScript);
            //    }
            //    else
            //    {
            //        var fileName = "ProbesList_Export.xlsx";
            //        int count = 0;
            //        Response.Clear();
            //        Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
            //        //Response.AddHeader("content-disposition", "attachment;filename=" + HttpUtility.UrlEncode("Probes_List_Export.xlsx", System.Text.Encoding.UTF8));
            //        this.Response.AddHeader(
            //                    "content-disposition",
            //                    string.Format("attachment;  filename={0}", fileName));

            //        ExcelPackage pkg = new ExcelPackage();

            //        using (pkg)
            //        {

            //            ExcelWorksheet ws = pkg.Workbook.Worksheets.Add("Probes");

            //            ws.Cells["A1"].LoadFromDataTable(finalProbesdt, true);

            //            #region "No need region"
            //            //ws.Cells["A1:MT"].Style.Font.Bold = true;
            //            ////ws.Cells["A1"].Style.Font.Bold = true;
            //            //using (ExcelRange rng = ws.Cells["A1:U" + (colcount - 1)])
            //            //{
            //            //    rng.Style.Font.Bold = true;
            //            //}

            //            //var headerCell = ws.Cells["A5:MT"];
            //            //headerCell.Style.Fill.PatternType = ExcelFillStyle.Solid;
            //            //headerCell.Style.Fill.BackgroundColor.SetColor(System.Drawing.Color.BurlyWood);
            //            //var headerFont = headerCell.Style.Font;
            //            //headerFont.Bold = true;

            //            //ws.Cells[1, 30].Style.Fill.PatternType = ExcelFillStyle.Solid;
            //            //ws.Cells[1, 30].Style.Fill.BackgroundColor.SetColor(System.Drawing.Color.LightBlue);
            //            //ws.Cells[1, 30].Style.VerticalAlignment = ExcelVerticalAlignment.Center;
            //            //ws.Cells[1, 30].Style.HorizontalAlignment = ExcelHorizontalAlignment.Center;
            //            #endregion

            //            if (result.Count() > 0)
            //            {
            //                count = result.Count() + 2;
            //                //    pkg.Workbook.Worksheets.FirstOrDefault().Cells[count, 3].Value = sum;//result.Sum(x => x.TotalProbes);
            //                //    pkg.Workbook.Worksheets.FirstOrDefault().Cells[count, 3].Style.Font.Bold = true;
            //                //    pkg.Workbook.Worksheets.FirstOrDefault().Cells[count, 3].Style.Font.UnderLine = true;
            //                //    pkg.Workbook.Worksheets.FirstOrDefault().Cells[count, 3].Style.Font.Color.SetColor(System.Drawing.Color.Blue);
            //                //    pkg.Workbook.Worksheets.FirstOrDefault().Cells[count, 3].Style.Border.BorderAround(ExcelBorderStyle.Thin);
            //            }

            //            pkg.Workbook.Worksheets.FirstOrDefault().DefaultColWidth = 20;
            //            pkg.Workbook.Worksheets.FirstOrDefault().Row(1).Height = 25;


            //            var modelTable = pkg.Workbook.Worksheets.FirstOrDefault().Cells["A1:MP" + (count - 1)]; //+ (count - 1)
            //            var border = modelTable.Style.Border.Top.Style = modelTable.Style.Border.Left.Style = modelTable.Style.Border.Right.Style = modelTable.Style.Border.Bottom.Style = ExcelBorderStyle.Thin;
            //            pkg.Workbook.Properties.Title = "Attempts";

            //            this.Response.BinaryWrite(pkg.GetAsByteArray());
            //            this.Response.End();

            //        }

            //    } // End Probes Export Block

            //}
            #endregion // End Probes

            //MessageBox.MessageShow(this.GetType(), "Please Choose Job Name!.", ClientScript);
        }
示例#22
0
 public IPDPlayerProber(Probes type = Probes.One)
 {
     _alternative = type;
 }
示例#23
0
 protected void InitializeProbeFields()
 {
     this.m_Probes = new Probes();
     this.m_Probes.Initialize(base.serializedObject);
 }
 protected void InitializeProbeFields()
 {
     m_Probes = new Probes();
     m_Probes.Initialize(serializedObject);
 }
 protected void InitializeProbeFields()
 {
     this.m_Probes = new Probes();
     this.m_Probes.Initialize(base.serializedObject);
 }