void ReleaseDesignerOutlets()
        {
            if (Cell1 != null)
            {
                Cell1.Dispose();
                Cell1 = null;
            }

            if (Cell2 != null)
            {
                Cell2.Dispose();
                Cell2 = null;
            }

            if (Cell3 != null)
            {
                Cell3.Dispose();
                Cell3 = null;
            }

            if (inboxCell != null)
            {
                inboxCell.Dispose();
                inboxCell = null;
            }
        }
示例#2
0
    // Constructor
    //public cellOutputValues (string cellName, float iradius, simulationManager2 imngr) {
    public cellOutputValues(Cell2 icell)
    {
        /*name = cellName;
         * cellRadius = iradius;
         * mngr = imngr;*/
        cell = icell;

        //if (!cell.randomStartingPosition) {
        //	allReceptorsOriginPoint = cell.globalToLocal(cell.globalMeshVerts[cell.originVert]);
        //}


        string expFolder = "exp_" + cell.mngr.experimentNumber;

        basicPathForOutput = Application.dataPath + "/Output/" + expFolder + "/";

        if (!Directory.Exists(basicPathForOutput))
        {
            Directory.CreateDirectory(basicPathForOutput);
            Directory.CreateDirectory(basicPathForOutput + "distance_from_interaction_point/");
            Directory.CreateDirectory(basicPathForOutput + "diffusion_calculations/");
            Directory.CreateDirectory(basicPathForOutput + "receptor_amounts/");
            Directory.CreateDirectory(basicPathForOutput + "signal/");
        }
    }
示例#3
0
        public static Vector2 GetSpawnPoint()
        {
            var vertices      = new Vertex2[4 + spaceships.Count + shots.Count];
            var index         = 0;
            var spaceHalfSize = Game.Size / 2;

            vertices[index++] = new Vertex2(-spaceHalfSize.x, -spaceHalfSize.y);
            vertices[index++] = new Vertex2(spaceHalfSize.x, -spaceHalfSize.y);
            vertices[index++] = new Vertex2(-spaceHalfSize.x, spaceHalfSize.y);
            vertices[index++] = new Vertex2(spaceHalfSize.x, spaceHalfSize.y);
            foreach (var obj in spaceships)
            {
                vertices[index++] = new Vertex2(obj.Position.x, obj.Position.y);
            }
            foreach (var obj in shots)
            {
                vertices[index++] = new Vertex2(obj.Position.x, obj.Position.y);
            }
            var   triangulation = Triangulation.CreateDelaunay <Vertex2, Cell2>(vertices);
            Cell2 maxTriangle   = triangulation.Cells.First();
            float maxArea       = 0;

            foreach (var triangle in triangulation.Cells)
            {
                var area = triangle.Area;
                if (area > maxArea)
                {
                    maxArea     = area;
                    maxTriangle = triangle;
                }
            }
            return(maxTriangle.Centroid);
        }
示例#4
0
        private static void NtxConfigurePositionQuad(FieldEntity entity, float baseTime, float targetTime,
                                                     Cell2 srcCell,
                                                     Cell2 targetCell, float height1, float height2, float arcHeight)
        {
            var a = new FVector3(srcCell.X, srcCell.Y, height1);
            var c = new FVector3(targetCell.X, targetCell.Y, height2);
            var b = FVector3.Midpoint(a, c);

            b = new FVector3(b.X, b.Y, arcHeight);
            entity.Position = new Position(a, b, c, baseTime, targetTime);
        }
示例#5
0
 private IEnumerable <FieldEntity> MgScanPrimaryMulti(Cell2 startCell, Cell2 axis,
                                                      int count)
 {
     for (var i = 0; i < count; i++)
     {
         var res = Manager?.CheckPrimaryEntity(startCell + axis * i);
         if (res != null)
         {
             yield return(res);
         }
     }
 }
示例#6
0
        private FieldEntity MgScanPrimary(Cell2 startCell, Cell2 axis, int count)
        {
            for (var i = 0; i < count; i++)
            {
                var res = Manager?.CheckPrimaryEntity(startCell + axis * i);
                if (res != null)
                {
                    return(res);
                }
            }

            return(null);
        }
示例#7
0
        public void loadnewSS(string filepath)
        {
            int Cols = 0;
            int Rows = 0;
            IEnumerable <string> SScols = from dimensions in XDocument.Load(filepath).Descendants("spreadsheet")
                                          select dimensions.Element("columns").Value;

            IEnumerable <string> SSrows = from dimensions in XDocument.Load(filepath).Descendants("spreadsheet")
                                          select dimensions.Element("rows").Value;

            if (Int32.TryParse(SScols.First(), out Cols) && Int32.TryParse(SSrows.First(), out Rows))
            {
                if (Cols != ColumnCount || Rows != RowCount)
                {
                    // Set size for Collection
                    Collection = new Cell2[Cols, Rows];
                    // Set each cell in Collection to specific Cell2 and tie to Property changed event
                    for (int i = 0; i < Cols; i++)
                    {
                        for (int a = 0; a < Rows; a++)
                        {
                            Collection[i, a] = new Cell2(i, a);
                            Collection[i, a].PropertyChanged    += Cell_PropertyChanged;
                            Collection[i, a].ValPropertyChanged += Cell_PropertyChanged;
                        }
                    }
                    // Set ColumnCount and RowCount values
                    ColumnCount = Cols;
                    RowCount    = Rows;
                }
            }
            var Cellvals = from dimensions in XDocument.Load(filepath).Descendants("cells").Descendants("cell")
                           where new Regex("[a-zA-Z]+[\\d]*").IsMatch(dimensions.Element("placement").Value)
                           select new
            {
                TextVal = dimensions.Element("text").Value,
                CellVal = dimensions.Element("placement").Value,
                ValVal  = dimensions.Element("value").Value
            };

            foreach (var cellval in Cellvals)
            {
                getCell(cellval.CellVal)._Text = cellval.TextVal;
                //((Cell2)hold).SetValue(cellval.ValVal);
            }
        }
示例#8
0
        /// <summary>
        /// 显示Cell文件
        /// </summary>
        /// <param name="fileID">文件ID</param>
        private void showCell(string fileID)
        {
            // string fileID = e.Node.Name;
            IList <MDL.T_CellAndEFile> cellAndEFile_List =
                (new BLL.T_CellAndEFile_BLL()).FindByFileID(fileID, Globals.ProjectNO);

            if (cellAndEFile_List != null && cellAndEFile_List.Count > 0)
            {
                string filePath = cellAndEFile_List[0].filepath;
                if (filePath != null && filePath.Length > 0 && filePath.IndexOf(".cll") > -1)
                {
                    int retValue = Cell2.OpenFile(string.Concat(Globals.ProjectPath, filePath), "");
                    Cell2.HScrollHeight = 1;
                    //Cell2.VScrollWidth = 0;
                    if (Cell2.GetTotalSheets() > 1)
                    {
                        Cell2.SetCurSheet(0);
                    }
                }
                else
                {
                    IList <MDL.T_CellFileTemplate> cellFileTemplate_List =
                        (new BLL.T_CellFileTemplate_BLL()).FindByFileID(fileID);
                    if (cellFileTemplate_List != null && cellFileTemplate_List.Count > 0 &&
                        cellFileTemplate_List[0].filepath != null && cellFileTemplate_List[0].filepath.Length > 0)
                    {
                        int retValue = Cell2.OpenFile(string.Concat(Application.StartupPath, "\\", "Template", cellFileTemplate_List[0].filepath), "");
                        //Cell2.AutoScrollOffset = 1;
                        //Cell2.VScrollWidth = 0;
                        if (Cell2.GetTotalSheets() > 1)
                        {
                            Cell2.SetCurSheet(0);
                        }
                    }
                    else
                    {
                        Cell2.OpenFile(Globals.BlankCell, "");
                    }
                }
            }
            else
            {
                Cell2.OpenFile(Globals.BlankCell, "");
            }
        }
示例#9
0
 // Constructor for spreadsheet
 public spreadsheet(int Col, int Row)
 {
     // Set size for Collection
     Collection = new Cell2[Col, Row];
     // Set each cell in Collection to specific Cell2 and tie to Property changed event
     for (int i = 0; i < Col; i++)
     {
         for (int a = 0; a < Row; a++)
         {
             Collection[i, a] = new Cell2(i, a);
             Collection[i, a].PropertyChanged    += Cell_PropertyChanged;
             Collection[i, a].ValPropertyChanged += Cell_PropertyChanged;
         }
     }
     // Set ColumnCount and RowCount values
     ColumnCount = Col;
     RowCount    = Row;
 }
示例#10
0
    public twoCellInteraction(Cell2 icellA, Cell2 icellB)
    {
        cellA = icellA;
        cellB = icellB;

        // Assigning the closest point on each cell surface to the cells themselves. DONT FORGET TO MOVE IT HERE!
        // Find the closest point between the two cells on each cell's surface, and calculate the radius around which a receptor interaction might happen. LOCAL SPACE!
        Vector3 fromCellAToCellB = cellB.gameObject.transform.position - cellA.gameObject.transform.position;

        //Vector3 closestPointIfSphere = cellA.localToGlobal(cellA.radius * fromCellAToCellB.normalized);// WHY USE THIS?!
        // to find actual closest point on surface, we find the closest vertex to the point on a spherical cell
        //cellA.closestPointToInteractingCellOnCellSurface = cellA.findClosestVertexOnSurface(closestPointIfSphere); // KANAL - no need to find closest point on sphere first, just find the closest point to the other cell.
        cellA.closestPointToInteractingCellOnCellSurface = cellA.findClosestVertexOnSurface(cellB.transform.position);
        // Setting the origin vertex for filopodia
        //cellA.endocytosisCenterVert = cellA.findFarthestVertexIndexOnSurface(cellB.transform.position);

        // cell 2
        Vector3 fromCellBToCellA = cellA.gameObject.transform.position - cellB.gameObject.transform.position;

        //closestPointIfSphere = cellB.localToGlobal(cellB.radius * fromCellBToCellA.normalized);
        // to find actual closest point on surface, we find the closest vertex to the point on a spherical cell
        //cellB.closestPointToInteractingCellOnCellSurface = cellB.findClosestVertexOnSurface(closestPointIfSphere);
        cellB.closestPointToInteractingCellOnCellSurface = cellB.findClosestVertexOnSurface(cellA.transform.position);
        // Setting the origin vertex for filopodia
        //cellB.endocytosisCenterVert = cellB.findFarthestVertexIndexOnSurface(cellA.transform.position);

        // Set values for output

        /*cellA.outputValues.interactionPointOnCell = cellA.closestPointToInteractingCellOnCellSurface;
        *  cellB.outputValues.interactionPointOnCell = cellB.closestPointToInteractingCellOnCellSurface;*/

        // Create a line between the cells

        /*LineRenderer lineObject = GameObject.Instantiate(Resources.Load("LineBetweenReceptors", typeof(LineRenderer))) as LineRenderer;
         * lineObject.gameObject.name = "LineBetweenCells";
         * // Draw the line itself
         * lineObject.SetPosition(0, cellA.closestPointToInteractingCellOnCellSurface);//cellA.transform.position
         * lineObject.SetPosition(1, cellB.closestPointToInteractingCellOnCellSurface); //cellB.transform.position
         * lineObject.SetColors(new Color(0f, 0f, 1f, 0.3f), new Color(0f, 0f, 1f, 0.3f));*/

        Debug.Log("Distance between cells: " + Utils.calcEuclideanDistance(cellA.closestPointToInteractingCellOnCellSurface, cellB.closestPointToInteractingCellOnCellSurface));
    }
示例#11
0
 /// <summary>
 /// 初始化详细过程
 /// </summary>
 public void Init()
 {
     try
     {
         Cell2.WorkbookReadonly = true;
         this.Text      = "工程资料用表 - " + Globals.Projectname; //窗体标题
         tssLabel1.Text = Globals.NormalStatus;              //状态栏:就绪
         tssLabel2.Text = Globals.AppTitle;                  //状态栏:应用程序标题
         tssLabel3.Text = "当前用户:" + Globals.LoginUser;       //状态栏:当前用户
         ImageList imageList1 = treeFactory.CreateTreeImageList();
         treeView1.ImageList = imageList1;
         treeFactory.GetTree(treeView1, Globals.ProjectNO, "", true, true, 1, true);
         Cell2.OpenFile(Globals.BlankCell, "");
         listView1.LargeImageList = imageList1;
         listView1.SmallImageList = imageList1;
     }
     catch
     {
     }
 }
示例#12
0
    // builds a map of the neighbors of each vector
    public void buildNeighborsDetails(Cell2 icell, Mesh mesh)
    {
        objectMesh = mesh;
        cell       = icell;

        int[] t = mesh.triangles;
        //verticesHash = new ArrayList(mesh.vertices.Length);

        /*for (int i = 0; i < mesh.vertices.Length; i++) {
         *      neighborsForVertex.Add(i, new List<int>());
         * }*/
        //vertexDetails tempDets;

        // Initialize vertexDetails array to each vertex.
        for (int i = 0; i < mesh.vertices.Length; i++)
        {
            vertexDetails tempDets = new vertexDetails();
            tempDets.neighborIndicesList    = new List <int>();
            tempDets.distancePerNeighbor    = new List <float>();
            tempDets.probabilityPerNeighbor = new List <float>();
            //tempDets.probabilityDensityPerNeighbor = new List<float>();
            tempDets.neighborIndicesByProbability = new List <int>();

            detailsForVertex.Add(i, tempDets);
        }

        // For each trio of indices of vectors that form a triangle, register that they are neighbors of each other...
        for (int i = 0; i < t.Length; i += 3)
        {
            // read the indices of the vertices that make up the tri
            int indexOfVert1 = t[i];
            int indexOfVert2 = t[i + 1];
            int indexOfVert3 = t[i + 2];

            addAllVerticesToEachOthersLists(indexOfVert1, indexOfVert2, indexOfVert3);
        }

        calculateStandardProbability();

        calculateDensityForExocytosis();
    }
示例#13
0
    private int overwriteReceptorsInInteractionRadiusList(Cell2 cell, List <Receptor3> receptorsInInteractionRadius)
    {
        int innerCounter = 0;

        // going over all receptors of cell to check if they're inside the possible interaction radius.
        foreach (Receptor3 rec in cell.receptors)
        {
            if (rec.inInteractionRadius()) // receptor IN interaction radius
            {
                try {                      // TRYING TO OVERWRITE
                    // Insert it into beginning of array. We're overwriting elements intentionally, to not search the array everytime (to add delete elements) and to not define new arrays in every iteration.
                    receptorsInInteractionRadius[innerCounter++] = rec;
                } catch {                 // NO PLACE ALLOCATED YET - ADDING.
                    receptorsInInteractionRadius.Add(rec);
                    // We're NOT incrementing innerCounter, because apparently it is done even if the above code fails and we reach here. Interesting.
                }
            }
        }

        // returning length of array:
        return(innerCounter);
    }
示例#14
0
 public FieldEntity CheckPrimaryEntity(Cell2 cell) =>
 _gridPrimaryEntities.TryGetValue((long)cell, out var res) ? res : null;
示例#15
0
 private static void NtxConfigurePositionStatic(FieldEntity entity, Cell2 cell, float height) =>
 entity.Position = new Position(new FVector3(cell.X, cell.Y, height));
示例#16
0
 private bool MgCheckWarnCell(Cell2 cell) => Manager?.CheckWarnCell(cell) ?? true;
示例#17
0
        //this function supports for single ring polygon

        public static Vector2 GetPolyLabel(Vector2[] polygon, float precision = 1f)
        {
            //Find the bounding box of the outer ring
            float minX = 0, minY = 0, maxX = 0, maxY = 0;

            for (int i = 0; i < polygon.Length; i++)
            {
                var p = polygon[i];
                if (i == 0 || p.x < minX)
                {
                    minX = p.x;
                }
                if (i == 0 || p.y < minY)
                {
                    minY = p.y;
                }
                if (i == 0 || p.x > maxX)
                {
                    maxX = p.x;
                }
                if (i == 0 || p.y > maxY)
                {
                    maxY = p.y;
                }
            }

            float width    = maxX - minX;
            float height   = maxY - minY;
            float cellSize = Math.Min(width, height);
            float h        = cellSize / 2;

            //A priority queue of cells in order of their "potential" (max distance to polygon)
            PriorityQueue <float, Cell2> cellQueue = new PriorityQueue <float, Cell2>();

            if (FloatEquals(cellSize, 0))
            {
                return(new Vector2(minX, minY));
            }

            //Cover polygon with initial cells
            for (float x = minX; x < maxX; x += cellSize)
            {
                for (float y = minY; y < maxY; y += cellSize)
                {
                    Cell2 cell = new Cell2(x + h, y + h, h, polygon);
                    cellQueue.Enqueue(cell.Max, cell);
                }
            }
            //Take centroid as the first best guess
            Cell2 bestCell = GetCentroidCell2(polygon);

            //Special case for rectangular polygons
            var bboxCell = new Cell2(minX + width / 2, minY + height / 2, 0, polygon);

            if (bboxCell.D > bestCell.D)
            {
                bestCell = bboxCell;
            }

            int numProbes = cellQueue.Count;

            while (cellQueue.Count > 0)
            {
                //Pick the most promising cell from the queue
                var cell = cellQueue.Dequeue();

                //Update the best cell if we found a better one
                if (cell.D > bestCell.D)
                {
                    bestCell = cell;
                }

                //Do not drill down further if there's no chance of a better solution
                if (cell.Max - bestCell.D <= precision)
                {
                    continue;
                }

                //Split the cell into four cells
                h = cell.H / 2;
                var cell1 = new Cell2(cell.X - h, cell.Y - h, h, polygon);
                cellQueue.Enqueue(cell1.Max, cell1);
                var cell2 = new Cell2(cell.X + h, cell.Y - h, h, polygon);
                cellQueue.Enqueue(cell2.Max, cell2);
                var cell3 = new Cell2(cell.X - h, cell.Y + h, h, polygon);
                cellQueue.Enqueue(cell3.Max, cell3);
                var cell4 = new Cell2(cell.X + h, cell.Y + h, h, polygon);
                cellQueue.Enqueue(cell4.Max, cell4);
                numProbes += 4;
            }

            return(new Vector2(bestCell.X, bestCell.Y));
        }
示例#18
0
        public int PrintCellToPDF(string cellFileName, string outFileName)
        {
            if (!System.IO.File.Exists(cellFileName))
            {
                return(0);
            }

            string FileExt = System.IO.Path.GetExtension(cellFileName);//文件后缀

            try
            {
                if (FileExt.ToLower() != ".cll")
                {
                    if (FileExt.ToLower() == ".pdf" ||
                        FileExt.ToLower() == ".daf")
                    {
                        System.IO.File.Copy(cellFileName, outFileName, true);
                        return(this.MergePDFFilesPages(outFileName));
                    }
                    else
                    {
                        if (this.FileConverToPDF(cellFileName, outFileName))
                        {
                            return(this.MergePDFFilesPages(outFileName));
                        }
                        else
                        {
                            return(0);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MyCommon.WriteLog("50cllPdf 转换pdf异常:" + ex.Message);
            }
            //System.Collections.ArrayList fileList = new System.Collections.ArrayList();
            //Cell2.SetPrinter(PrinterOperate.UsePrinterName);
            //Cell2.PrintPara(1, 1, 0, 0); //单色打印

            if (System.IO.Directory.Exists(tempPath))
            {
                MyCommon.DeleteAndCreateEmptyDirectory(tempPath, false);
                MyCommon.DeleteAndCreateEmptyDirectory(tempPath, true);
            }
            else
            {
                MyCommon.DeleteAndCreateEmptyDirectory(tempPath, true);
            }

            ArrayList fileList = new ArrayList();

            try
            {
                if (Cell2.OpenFile(cellFileName, "") != 1)
                {
                    return(0);
                }

                Cell2.PrintSetAlign(1, 1);
                Cell2.PrintSetMargin(5, 5, 5, 5);
                Cell2.PrintPara(1, 1, 0, 0); //单色打印
                //Cell2.SetCurSheet(j);
                //Cell2.PrintPageBreak(0);
            }
            catch (Exception ex)
            {
                MyCommon.WriteLog("Cell2 打开错误:" + ex.Message);
            }
            //判断当前页 所有的单元是否只读
            // 如果当前页的所有单元格只读,就不转换PDF
            // 否则 就直接转换PDF
            Assembly asm     = Assembly.GetExecutingAssembly();
            string   AppPath = asm.Location;

            try
            {
                bool isToPDF_flg = true;
                for (int j = 0; j < Cell2.GetTotalSheets(); j++)
                {
                    Cell2.SetCurSheet(j);
                    string TittleName = Cell2.GetSheetLabel(j);
                    if (TittleName != null)
                    {
                        if (TittleName.Contains("填表提示") || TittleName.Contains("填表说明") || TittleName.Trim() == "说明")//
                        {
                            continue;
                        }
                    }

                    string tempoutfileName = Guid.NewGuid().ToString() + ".pdf";
                    isToPDF_flg = true;
                    for (int iRow = 1; iRow < Cell2.GetRows(j) - 1; iRow++)
                    {
                        if (!isToPDF_flg)
                        {
                            break;
                        }
                        if (Cell2.IsRowHidden(iRow, j) == false && Cell2.GetRowHeight(1, iRow, j) > 10)
                        {
                            for (int iCol = 1; iCol < Cell2.GetCols(j) - 1; iCol++)
                            {
                                if (!isToPDF_flg)
                                {
                                    break;
                                }
                                if (Cell2.IsColHidden(iCol, j) == false && Cell2.GetColWidth(1, iCol, j) > 10)
                                {
                                    if (Cell2.GetCellInput(iCol, iRow, j) != 5)
                                    {
                                        isToPDF_flg = false;
                                        break;
                                    }
                                }
                            }
                        }
                    }
                    if ((!isToPDF_flg))
                    {
                        //ConverToPDF.PreparePrint(Assembly.GetExecutingAssembly().FullName, "", tempPath + tempoutfileName);
                        //Cell2.PrintSheet(0, j);
                        //ConverToPDF.Wait4PringFinish("", tempPath + tempoutfileName);
                        if (Cell2.ExportPdfFile(tempPath + tempoutfileName, j, 0, 1))
                        {
                            fileList.Add(tempPath + tempoutfileName);
                        }
                    }
                }
                Cell2.closefile();
            }
            catch (Exception ex)
            {
                MyCommon.WriteLog("Cell2 转换PDF错误:" + ex.Message);
            }
            #region

            /*
             * //Cell2.ExportPdfFile(tempPath + tempoutfileName, -1, 0, Cell2.GetTotalSheets());
             *
             *
             * //for (int j = 0; j < Cell2.GetTotalSheets(); j++)
             * //{
             * //    string TittleName = Cell2.GetSheetLabel(j);
             * //    if (!TittleName.Contains(Globals.Descriptive))
             * //    {
             * //        fileList.Add(tempFile + j.ToString() + ".pdf");
             * //        outFile = tempFile + j.ToString() + ".pdf";
             * //        NewPrint();
             * //        oPrinterMonitor.OnPrinterInit += new _IPrinterMonitorEvents_OnPrinterInitEventHandler(oPrinterMonitor_OnPrinterInit);
             * //        Cell2.PrintSheet(0, j);
             * //        oPrinterMonitor.OnPrinterInit -= new _IPrinterMonitorEvents_OnPrinterInitEventHandler(oPrinterMonitor_OnPrinterInit);
             * //        Application.DoEvents();
             * //    }
             * //}
             *
             * //foreach (object obj in fileList)
             * //{
             * //    if(!System.IO.File.Exists(obj.ToString()))
             * //    {
             * //        fileList.Remove(obj);
             * //    }
             * //}
             * //if (fileList.Count <= 0)
             * //{
             * //    return 0;
             * //}
             * */
            #endregion
            string[] FileName = new string[fileList.Count];
            for (int i = 0; i < fileList.Count; i++)
            {
                FileName[i] = fileList[i].ToString();
            }
            if (FileName.Length <= 0)
            {
                return(0);
            }
            return(MergePDFFilesPages(outFileName));
        }
示例#19
0
 private static void NtxConfigureHitBox(FieldEntity entity, Cell2 cell, HitBox.AvoidType avoidType,
                                        bool targetable, bool primary) => entity.HitBox = new HitBox(cell, avoidType, targetable, primary);
示例#20
0
 private static void NtxConfigurePositionLinear(FieldEntity entity, float baseTime, float targetTime,
                                                Cell2 srcCell,
                                                Cell2 targetCell, float height1, float height2) =>
 entity.Position = new Position(new FVector3(srcCell.X, srcCell.Y, height1),
                                new FVector3(targetCell.X, targetCell.Y, height2), baseTime, targetTime);
示例#21
0
        private bool Printcells(string filepath, string printerName)
        {
            int b = Cell2.OpenFile(filepath, "");

            if (b != 1)
            {
                return(false);
            }

            Cell2.PrintSetAlign(1, 1);
            Cell2.PrintSetMargin(5, 5, 5, 5);

            //判断当前页 所有的单元是否只读
            // 如果当前页的所有单元格只读,就不转换PDF
            // 否则 就直接转换PDF
            bool isToPDF_flg = true;

            for (int j = 0; j < Cell2.GetTotalSheets(); j++)
            {
                Cell2.SetCurSheet(j);
                string TittleName = Cell2.GetSheetLabel(j);
                if (TittleName != null &&
                    TittleName.Contains("填表提示"))//
                {
                    continue;
                }

                isToPDF_flg = true;
                for (int iRow = 1; iRow < Cell2.GetRows(j) - 1; iRow++)
                {
                    if (!isToPDF_flg)
                    {
                        break;
                    }
                    if (Cell2.IsRowHidden(iRow, j) == false && Cell2.GetRowHeight(1, iRow, j) > 10)
                    {
                        for (int iCol = 1; iCol < Cell2.GetCols(j) - 1; iCol++)
                        {
                            if (!isToPDF_flg)
                            {
                                break;
                            }
                            if (Cell2.IsColHidden(iCol, j) == false && Cell2.GetColWidth(1, iCol, j) > 10)
                            {
                                if (Cell2.GetCellInput(iCol, iRow, j) != 5)
                                {
                                    isToPDF_flg = false;
                                    break;
                                }
                            }
                        }
                    }
                }
                if ((!isToPDF_flg))
                {
                    Cell2.PrintSheet(0, j);
                }
            }
            Cell2.closefile();
            return(true);
        }
示例#22
0
    Vector3 hardCodedCellCenter = new Vector3(-51.17f, 21.22f, 7.54f);     // :_( It's the only way to find the cell body (without the filopodia) center.

    // Constructor
    public Receptor3(Cell2 icell, /*simulationManager2*/ simulationManager3 ismngr, System.Random rand, bool ivisible)        //GameObject receptorMesh,
    // saving the cell and the sim manager objets
    {
        cell       = icell;
        smngr      = ismngr;
        receptorId = smngr.generateUniqueId();

        // Initializing variables.
        nextV           = -1;
        totalMinisteps  = 0;
        currentMiniStep = 0;

        // Assign position if set to random
        //if (icell.randomStartingPosition) {
        currentV = rand.Next(0, cell.globalMeshVerts.Length);

        // COMMENTING OUT TO AVOID RUNNING THIS. PROBABLY NOT RELEVANT ANYWAY.

        /*if (icell.exocytoseOutsideInteractionRadius) { // we have to check if the random position is outside the interactions radius
         *      while (isVertexInInteractionRadius(currentV)) { // run until you find a vertex that's outside the interaction radius
         *              currentV = rand.Next(0, cell.globalMeshVerts.Length);
         *      }
         * }*/

        /*if (icell.noExocytosisInFilopodia) { // we have to check if the random position is on the main body
         *      while (!isVertexInMainBody(currentV)) { // run until you find a vertex that's on the main body itself (not on filopodia)
         *              currentV = rand.Next(0, cell.globalMeshVerts.Length);
         *      }
         * }*/

        if (icell.exocytosisMainlyInFilopodia)       // we have to check if the random position is on the filopodia
        {
            float chanceOfExocytosingInFilopodia = (float)rand.NextDouble();

            if (chanceOfExocytosingInFilopodia <= icell.ratioOfExocytosingReceptorsInFilopodia)
            {
                // exocytose in filopodia
                while (isVertexInMainBody(currentV))       // run until you find a vertex that's on the filopodia itself (not on the cell body)
                {
                    currentV = rand.Next(0, cell.globalMeshVerts.Length);
                }
            }
            else
            {
                // exocytose in cell body
                while (!isVertexInMainBody(currentV))       // run until you find a vertex that's on the cell body.
                {
                    currentV = rand.Next(0, cell.globalMeshVerts.Length);
                }
            }
        }


        recPosition = cell.globalMeshVerts[currentV];

        // Create receptor mesh if visible
        if (ivisible)
        {
            visible = true;
        }
    }
示例#23
0
 public override string ToString()
 {
     return(Cell1.ToString() + ":" + Cell2.ToString());
 }
示例#24
0
 private FieldEntity MgCheckPrimaryEntity(Cell2 cell) => Manager?.CheckPrimaryEntity(cell);
示例#25
0
 public bool CheckWarnCell(Cell2 cell) => _gridWarnCells.ContainsKey((long)cell);