コード例 #1
0
    public void EditOrReviewStepDetail(StepDetail detailAction)
    {
        if (detailPanel != null)
        {
            Destroy(detailPanel);
        }

        detailPanel = (GameObject)Instantiate(stepDetailPanel);

        detailPanel.transform.SetParent(selectionPanel.transform);
        //detailPanel.transform.position = new Vector3(0, 0, 0);
        detailPanel.GetComponent <RectTransform>().offsetMin = new Vector2(0, 0); //left bottom
        detailPanel.GetComponent <RectTransform>().offsetMax = new Vector2(0, 0); //right top
        detailPanel.transform.localScale = new Vector3(1f, 1f, 1f);

        detailPanel.name = "StepDetailPanel";
        stepDetailPAnel panelscript = detailPanel.GetComponent <stepDetailPAnel>();

        panelscript.Setup(this);
        panelscript.detailIntro.text = detailAction.stepDetailInfo;

        panelscript.scrollView.GetComponent <DetailStepScrollview>().storeData = storedData;

        createOperatorOnMap();

        storedData.isUpdated = true;
    }
コード例 #2
0
        public override StepDetail RunNextStep()
        {
            StepDetail result = ProcessFile(files[currentStep]);

            currentStep++;
            return(result);
        }
コード例 #3
0
    public void AddSteps()
    {
        if (detailPanel != null)
        {
            Destroy(detailPanel);
        }

        detailPanel     = (GameObject)Instantiate(stepDetailPanel);
        IndetailActions = true;
        detailPanel.transform.SetParent(selectionPanel.transform);
        //detailPanel.transform.position = new Vector3(0,0,0);
        detailPanel.GetComponent <RectTransform>().offsetMin = new Vector2(0, 0); //left bottom
        detailPanel.GetComponent <RectTransform>().offsetMax = new Vector2(0, 0); //right top
        detailPanel.transform.localScale = new Vector3(1f, 1f, 1f);
        detailPanel.name = "StepDetailPanel";
        stepDetailPAnel panelscript = detailPanel.GetComponent <stepDetailPAnel>();

        panelscript.Setup(this);
        StepDetail newDetail = new StepDetail();

        storedData.newStrategy.steps.Add(newDetail);
        storedData.chosenStepIndex = storedData.newStrategy.steps.Count - 1;
        newDetail.stepIndex        = storedData.newStrategy.steps.Count - 1;
        cancelDetailBtn.SetActive(true);
        //Debug.Log(panel.transform.position);
    }
コード例 #4
0
    void buttonClicked()
    {
        CommonData storeData = _common.gameObject.GetComponent <CommonData>();

        if (DataObj.isScan == false || DataObj.isUserOwn == true)
        {
            if (detailIntro.text.Length == 0)
            {
                MNPopup mNPopup = new MNPopup("Info", "Add some information about this step");
                mNPopup.AddAction("Ok", () => { Debug.Log("Ok action callback"); });
                mNPopup.Show();
                //EditorUtility.DisplayDialog("Error", "Add some information about this step", "OK");
                return;
            }


            StepDetail detail = storeData.newStrategy.steps[storeData.chosenStepIndex];
            detail.stepDetailInfo = detailIntro.text;

            foreach (GameObject item in storeData.Operators)
            {
                Destroy(item);
            }
        }
        _common.cancelDetailBtn.SetActive(false);
        storeData.finishClicked = true;
        _common.IndetailActions = false;
        Destroy(gameObject);
    }
コード例 #5
0
        public override StepDetail RunNextStep()
        {
            StepDetail result = ProcessTrack(tracks[currentStep]);

            currentStep++;
            return(result);
        }
コード例 #6
0
    // Update is called once per frame
    void Update()
    {
        if (storedData.finishClicked)
        {
            storedData.finishClicked = false;

            foreach (Transform button  in contentPanel.GetComponentsInChildren <Transform>())
            {
                if (button.gameObject.tag.Equals("Step"))
                {
                    Destroy(button.gameObject);
                }
            }

            for (int i = 0; i < storedData.newStrategy.steps.Count; i++)
            {
                GameObject newobj = (GameObject)Instantiate(buttonPrefab);
                newobj.transform.SetParent(contentPanel);
                newobj.transform.localScale = new Vector3(1f, 1f, 1f);
                StepDetail item    = storedData.newStrategy.steps[i];
                StepBtn    nameBtn = newobj.GetComponent <StepBtn>();
                nameBtn.btnIndex     = i;
                nameBtn.btnName.text = item.stepDetailInfo;
                nameBtn.stepContent  = this;
            }
        }
    }
コード例 #7
0
ファイル: HandelAction.cs プロジェクト: ycy1164656/R6Strategy
    public void editSetup()
    {
        CommonData       storedata   = controlScript.gameObject.GetComponent <CommonData>();
        StepDetail       detailsteps = storedata.newStrategy.steps[storedata.chosenStepIndex];
        string           createtime  = actionObj.GetComponent <OperatorData>().createTime;
        StepDetailAction tempAction  = new StepDetailAction();

        foreach (StepDetailAction step in detailsteps.detailActions)
        {
            if (step.createTime.Equals(createtime))
            {
                tempAction = step;
            }
        }
        if (tempAction.actionInfo != null)
        {
            addInfoText.text = @"Description";
            existInfo        = tempAction.actionInfo;
        }
        else
        {
            addInfoText.text = @"Description";
            existInfo        = "";
        }
        hasArrow = tempAction.hasArrow;
        if (tempAction.hasArrow)
        {
            AddArrowText.text = @"Arrow";
        }
        else
        {
            AddArrowText.text = @"Arrow";
        }
    }
コード例 #8
0
        private static EmrActivityState GetStateFromLastStep(JobFlowDetail jobFlowDetail)
        {
            List <StepDetail> steps = jobFlowDetail.Steps;

            if (steps.Count == 0)
            {
                return(EmrActivityState.Completed);
            }

            StepDetail         lastStep      = steps[steps.Count - 1];
            StepExecutionState lastStepState = lastStep.ExecutionStatusDetail.State;

            if (lastStepState == StepExecutionState.PENDING)
            {
                return(EmrActivityState.Running);
            }
            else if (lastStepState != StepExecutionState.COMPLETED)
            {
                return(EmrActivityState.Failed);
            }
            else
            {
                return(EmrActivityState.Completed);
            }
        }
コード例 #9
0
        private void ReportPseudoStepInit(string desc)
        {
            StepDetail detail = new StepDetail();

            detail.Description = desc;

            RaiseTaskStepInitEvent(detail);
        }
コード例 #10
0
    public void GotoDetailAction(int btnIndex)
    {
        StepDetail item = storedData.newStrategy.steps[btnIndex];

        storedData.chosenStepIndex = btnIndex;
        controllerObj.GetComponent <CommonControl>().IndetailActions = true;
        controllerObj.GetComponent <CommonControl>().EditOrReviewStepDetail(item);
    }
コード例 #11
0
        public override StepDetail RunNextStep()
        {
            StepDetail sd = new StepDetail();

            //sd.Description = SearchPath;
            sd.IsSuccess = true;
            sd.Results   = "TXT_SUCCESS";

            finished = true;

            return(sd);
        }
コード例 #12
0
        void task_TaskStepInit(StepDetail currentStep)
        {
            if (InvokeRequired)
            {
                BeginInvoke(new TaskStepInitHandler(task_TaskStepInit),
                            new object[] { currentStep });
                return;
            }

            lblStepDetails.Text    = Translator.TranslateTaggedString(currentStep.Description);
            lblStepDetails.Visible = true;
        }
コード例 #13
0
        private StepDetail ProcessTrack(Track track)
        {
            string newFileName = string.Format("{0}.{1}",
                                               CdRipper.GetFileName(WordCasing.KeepCase, track, OutputFilePattern),
                                               this.EncoderSettings.FormatType.ToString().ToLowerInvariant());

            StepDetail detail = new StepDetail();

            detail.Description = Translator.Translate("TXT_PROCESSING_TRACK", track, newFileName);
            RaiseTaskStepInitEvent(detail);

            detail.Results   = Translator.Translate("TXT_UNHANDLED");
            detail.IsSuccess = false;

            try
            {
                _grabber = CdRipper.CreateGrabber(this.EncoderSettings.FormatType);
                char letter = DrivePath.ToUpperInvariant()[0];
                using (CDDrive cd = new CDDrive())
                {
                    if (cd.Open(letter) && cd.Refresh() && cd.HasAudioTracks())
                    {
                        string destFile = Path.Combine(OutputFolder, newFileName);

                        bool generateTagsFromMetadata = false;

                        switch (this.EncoderSettings.FormatType)
                        {
                        case AudioMediaFormatType.WAV:
                            break;

                        case AudioMediaFormatType.MP3:
                            Mp3EncoderSettings settings = (this.EncoderSettings as Mp3EncoderSettings);
                            (_grabber as GrabberToMP3).Options = settings.Options;
                            generateTagsFromMetadata           = settings.CopyInputFileMetadata;
                            break;
                        }

                        _grabber.Grab(cd, track, destFile, generateTagsFromMetadata);
                    }
                }

                detail.IsSuccess = true;
            }
            catch (Exception ex)
            {
                detail.Results = ex.Message;
            }

            return(detail);
        }
コード例 #14
0
        // GET: StepDetails/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            StepDetail stepDetail = db.StepDetails.Find(id);

            if (stepDetail == null)
            {
                return(HttpNotFound());
            }
            return(View(stepDetail));
        }
コード例 #15
0
        // GET: StepDetails/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            StepDetail stepDetail = db.StepDetails.Find(id);

            if (stepDetail == null)
            {
                return(HttpNotFound());
            }
            ViewBag.ProjectID = new SelectList(db.ProjectDetails, "ProjectID", "ProjectName", stepDetail.ProjectID);
            return(View(stepDetail));
        }
コード例 #16
0
ファイル: PaintOnMap.cs プロジェクト: ycy1164656/R6Strategy
    public void confirmModifyClicked()
    {
        CommonData storeData = GetComponent <CommonData>();
        StepDetail detail    = storeData.newStrategy.steps[storeData.chosenStepIndex];


        foreach (StepDetailAction step in detail.detailActions)
        {
            if (step.createTime.Equals(detailAction.createTime))
            {
                step.actionInfo = browsedescText.text;
            }
        }
        storeData.isUpdated = true;
        imagePanel.SetActive(false);
    }
コード例 #17
0
        void task_TaskProgress(StepDetail currentStepDetail, int stepsDone)
        {
            if (InvokeRequired)
            {
                BeginInvoke(new TaskProgressHandler(task_TaskProgress),
                            new object[] { currentStepDetail, stepsDone });
                return;
            }

            try
            {
                Logger.LogInfo("Task is executing step {0} of {1}", stepsDone, BkgTask.TotalSteps);

                if (currentStepDetail != null)
                {
                    if (!currentStepDetail.IsSuccess)
                    {
                        TreeNode tnParent = new TreeNode(currentStepDetail.Description + "     ");
                        tnParent.NodeFont = ThemeManager.LargeFont;

                        tnParent.ImageIndex         = 0;
                        tnParent.SelectedImageIndex = 0;

                        TreeNode tnChild = new TreeNode(currentStepDetail.Results);
                        tnChild.NodeFont = ThemeManager.SmallFont;

                        tnChild.ImageIndex         = 2;
                        tnChild.SelectedImageIndex = 2;

                        tnParent.Nodes.Add(tnChild);

                        tvResults.Nodes.Add(tnParent);

                        tvResults.ExpandAll();

                        _errorsFound = true;
                    }
                }

                pbProgress.Value = stepsDone;
            }
            catch
            {
            }

            tvResults.Visible = _errorsFound;
        }
コード例 #18
0
    public void confirmAction()
    {
        if (ControlObj.GetComponent <CommonControl>().canDrawLine || ControlObj.GetComponent <PaintOnMap>().isModify)
        {
            descriptionText.text = textField.text;
            gameObject.SetActive(false);
            ControlObj.GetComponent <PaintOnMap>().isModify = false;
        }
        else
        {
            if (textField.text.Length == 0)
            {
                MNPopup mNPopup = new MNPopup("Info", "Add some information about this step");
                mNPopup.AddAction("Ok", () => { Debug.Log("Ok action callback"); });
                mNPopup.Show();
                //EditorUtility.DisplayDialog("Error", "Add some information about this step", "OK", "Cancel");
                return;
            }

            OperatorData objdata   = operatorObj.GetComponent <OperatorData>();
            CommonData   storeData = ControlObj.GetComponent <CommonData>();
            StepDetail   detail    = storeData.newStrategy.steps[storeData.chosenStepIndex];
            Debug.Log(JsonUtility.ToJson(objdata));

            //Text infotext = textCanvas.GetComponentInChildren<Text>();
            //infotext.text = "Detail";
            //int stepIndex = objdata.actionNumber;
            foreach (StepDetailAction step in detail.detailActions)
            {
                if (step.createTime.Equals(objdata.createTime))
                {
                    step.actionInfo = textField.text;
                }
            }



            objdata.actionInfo = textField.text;
            Debug.Log(JsonUtility.ToJson(storeData));
            textField.text      = "";
            storeData.isUpdated = true;

            gameObject.SetActive(false);
        }
    }
コード例 #19
0
        public ActionResult Create([Bind(Include = "ProjectID,ProjectName,UserID,Status,Progress,CreationDate,EstOrgCompDate,EstCurrCompDate,ActCompDate")] ProjectDetail projectDetail)
        {
            if (ModelState.IsValid)
            {
                ApplicationUser user = System.Web.HttpContext.Current.GetOwinContext().GetUserManager <ApplicationUserManager>().FindById(System.Web.HttpContext.Current.User.Identity.GetUserId());
                projectDetail.UserID       = user.Id;
                projectDetail.CreationDate = DateTime.Now.Date;
                db.ProjectDetails.Add(projectDetail);
                db.SaveChanges();
                var users = Request.Form["List"];

                UserProject proj = new UserProject();
                if (users != null)
                {
                    var user1 = users.Split(',');
                    foreach (var item in user1)
                    {
                        proj.UserID    = item;
                        proj.ProjectID = projectDetail.ProjectID;
                        db.UserProjects.Add(proj);
                        db.SaveChanges();
                    }
                }

                // To create automatic steps
                IEnumerable <string> query = from p in db.MasterSteps
                                             where p.StepStatus == true
                                             select p.MasterStepName;

                StepDetail sd = new StepDetail();
                foreach (string step in query.ToList())
                {
                    sd.ProjectID = projectDetail.ProjectID;
                    sd.StepName  = step;
                    sd.Status    = "Planned";
                    db.StepDetails.Add(sd);
                    db.SaveChanges();
                }

                return(RedirectToAction("Index"));
            }
            return(View(projectDetail));
        }
コード例 #20
0
    public void doneEditArrow(GameObject arrow)
    {
        StepDetail detailsteps = storedData.newStrategy.steps[storedData.chosenStepIndex];
        string     createtime  = arrow.GetComponent <ArrowControl>().objCreateTime;

        foreach (StepDetailAction step in detailsteps.detailActions)
        {
            if (step.createTime.Equals(createtime))
            {
                step.hasArrow = true;
                step.directionTransform.localscale    = arrow.transform.localScale;
                step.directionTransform.localposition = arrow.transform.localPosition;
                step.directionTransform.localrotation = arrow.transform.localRotation;
            }
        }
        Destroy(arrow.GetComponent <ArrowControl>());
        arrowControl = false;
        doneEditArrowBtn.SetActive(false);
    }
コード例 #21
0
        private StepDetail ProcessFile(string file)
        {
            StepDetail detail = new StepDetail();

            detail.Description = "TXT_PROCESSING_FILE: " + file;
            RaiseTaskStepInitEvent(detail);

            detail.Results   = Translator.Translate("TXT_UNHANDLED");
            detail.IsSuccess = false;

            try
            {
                switch (taskType)
                {
                case TaskType.MultiRename:
                    detail.Results = RenameFile(file);
                    break;

                case TaskType.EditTag:
                    detail.Results = ChangeTag(file);
                    break;

                case TaskType.FillTagByFS:
                    detail.Results = GenerateTag(file);
                    break;

                case TaskType.ChangeEncoding:
                    detail.Results = ChangeEncoding(file);
                    break;
                }

                detail.IsSuccess = true;
            }
            catch (Exception ex)
            {
                detail.Results   = ex.Message;
                detail.IsSuccess = false;
            }

            return(detail);
        }
        public async Task SaveStepDetailsAsync(StepDetail stepDetail)
        {
            var result = await stepDetailCollection.FindAsync(doc => doc.QuestionId.Equals(stepDetail.QuestionId)).Result.FirstOrDefaultAsync();

            if (result == null)
            {
                await stepDetailCollection.InsertOneAsync(stepDetail);
            }
            else
            {
                var filter = Builders <StepDetail> .Filter.Where(sd => sd.QuestionId.Equals(stepDetail.QuestionId));

                var updateFramework = Builders <StepDetail> .Update.Set(sd => sd.FrameworkItemType, stepDetail.FrameworkItemType);

                var updateDescription = Builders <StepDetail> .Update.Set(sd => sd.QuestionDescription, stepDetail.QuestionDescription);

                var combinedDefinitions =
                    Builders <StepDetail> .Update.Combine(updateFramework, updateDescription);

                await stepDetailCollection.UpdateOneAsync(filter, combinedDefinitions);
            }
        }
コード例 #23
0
ファイル: PaintOnMap.cs プロジェクト: ycy1164656/R6Strategy
    public void deleteImage()
    {
        CommonData storedata   = GetComponent <CommonData>();
        StepDetail detailsteps = storedata.newStrategy.steps[storedata.chosenStepIndex];



        StepDetailAction tempAction = new StepDetailAction();

        foreach (StepDetailAction step in detailsteps.detailActions)
        {
            if (step.createTime.Equals(detailAction.createTime))
            {
                tempAction = step;
            }
        }
        //detailsteps.detailActions = newList;
        detailsteps.detailActions.Remove(tempAction);

        storedata.isUpdated = true;
        imagePanel.SetActive(false);
    }
コード例 #24
0
    public void RotateToCenterOfScreen(string btnTitle)
    {
        StepDetail stepDetail = storeData.newStrategy.steps[storeData.chosenStepIndex];

        foreach (StepDetailAction tempoperator in stepDetail.detailActions)
        {
            if (tempoperator.imageType)
            {
                if (tempoperator.createTime.Equals(btnTitle))
                {
                    storeData.gameObject.GetComponent <PaintOnMap>().showImageView(tempoperator);
                }
            }
            else if (tempoperator.createTime.Equals(btnTitle))
            {
                if (!storeData.gameObject.GetComponent <MapObj>().currentFloorName.Equals(tempoperator.parentFloor))
                {
                    storeData.gameObject.GetComponent <MapObj>().createMapWithName(tempoperator.parentFloor);
                }
                tempRotation = tempoperator.mainTransform.rotation;
                btnclicked   = true;
                storeData.gameObject.GetComponent <CommonControl>().operatorCreateTime = btnTitle;

                //GameObject EditPanelobj = storeData.gameObject.GetComponent<CommonControl>().EditPanelobj;

                //EditPanelobj.SetActive(true);
                //foreach (GameObject temp in storeData.Operators)
                //{
                //    if (temp.GetComponent<OperatorData>().createTime.Equals(btnTitle)){
                //        EditPanelobj.GetComponent<HandelAction>().actionObj = temp;
                //    }
                //}


                //EditPanelobj.GetComponent<HandelAction>().controlScript = storeData.gameObject.GetComponent<CommonControl>();
                //EditPanelobj.GetComponent<HandelAction>().editSetup();
            }
        }
    }
コード例 #25
0
        public override StepDetail RunNextStep()
        {
            StepDetail detail = new StepDetail();

            detail.Description = string.Format("Importing from {0} ...", SourcePath);

            _abortScan.Reset();

            try
            {
                Catalog     cat    = new Catalog(CatalogPath);
                CatalogItem parent = cat.GetByItemID(InsertionPointID);

                ScanFolder(cat, this.SourcePath, parent);

                finished = true;

                bool isAborted = _abortScan.WaitOne(0);
                if (!isAborted)
                {
                    cat.CatalogDescription = CatalogDescription;
                    cat.Save(CatalogPath);
                }

                detail.Results   = (isAborted) ? Translator.Translate("TXT_ABORTED") : Translator.Translate("TXT_SUCCESS");
                detail.IsSuccess = !isAborted;
            }
            catch (Exception ex)
            {
                detail.Results   = ex.Message;
                detail.IsSuccess = false;
            }
            finally
            {
                finished = true;
            }

            return(detail);
        }
コード例 #26
0
ファイル: HandelAction.cs プロジェクト: ycy1164656/R6Strategy
    void deleteAction()
    {
        CommonData storedata   = controlScript.gameObject.GetComponent <CommonData>();
        StepDetail detailsteps = storedata.newStrategy.steps[storedata.chosenStepIndex];
        string     createtime  = actionObj.GetComponent <OperatorData>().createTime;


        StepDetailAction tempAction = new StepDetailAction();

        foreach (StepDetailAction step in detailsteps.detailActions)
        {
            if (step.createTime.Equals(createtime))
            {
                tempAction = step;
            }
        }
        //detailsteps.detailActions = newList;
        detailsteps.detailActions.Remove(tempAction);


        storedata.isUpdated = true;
        Destroy(actionObj);
        this.gameObject.SetActive(false);
    }
コード例 #27
0
    public void buttonClicked(GameObject btnObj)
    {
        if (DataObj.isDp)
        {
            ExitGames.Client.Photon.Hashtable h = new ExitGames.Client.Photon.Hashtable();
            h.Add("operator", btnObj.name);
            DataObj.lbc.LocalPlayer.SetCustomProperties(h);

            gameObject.SetActive(false);
            return;
        }

        controlScript.canAddOperation = false;

        OperatorObj operatorobj = new OperatorObj();

        foreach (OperatorObj op in operators)
        {
            if (op.name.Equals(btnObj.name))
            {
                operatorobj = op;
            }
        }


        GameObject cube1 = (GameObject)Instantiate(operatorobj.operatorPrefab);

        ghostObjInstance = Instantiate(cube1, cube1.transform.position, Quaternion.identity).GetComponent <Transform>();
        ghostObjInstance.transform.localScale *= controlScript.scaleChange;
        Debug.Log(controlScript.scaleChange);
        Vector3 pivotOffsetExtra;
        bool    objPivotIsBase = controlScript.isPivotInBase(ghostObjInstance, out pivotOffsetExtra);

        if (!objPivotIsBase)
        {
            ghostObjInstance = controlScript.CreateBasePivot(ghostObjInstance, pivotOffsetExtra);
        }
        Vector3 pos = rayhit.point;

        ghostObjInstance.position = pos;

        controlScript.AlignGhostToSurface(ghostObjInstance, rayhit.normal);

        ghostObjInstance = ghostObjInstance.GetComponent <PivotHelper>().DeletePivot();

        GameObject cube = Instantiate(operatorobj.operatorPrefab, ghostObjInstance.position, ghostObjInstance.rotation);

        Destroy(ghostObjInstance.gameObject);
        Destroy(cube1);
        cube.transform.SetParent(hitobject.transform);
        cube.transform.rotation = hitobject.transform.rotation;
        //cube.transform.localScale = new Vector3(0.012f, 0.012f, 0.012f);
        cube.transform.localScale *= controlScript.scaleChange;

        string currentFloor = controlScript.gameObject.GetComponent <MapObj>().currentFloorName;

        StepDetailAction action = new StepDetailAction(cube.transform, "Operator", currentFloor, hitobject.name);

        action.createTime = System.DateTime.Now.ToString();
        action.actionName = operatorobj.name;
        CommonData storeData = controlScript.gameObject.GetComponent <CommonData>();
        StepDetail detail    = storeData.newStrategy.steps[storeData.chosenStepIndex];

        if (detail.detailActions != null)
        {
            detail.detailActions.Add(action);
        }
        else
        {
            detail.detailActions = new List <StepDetailAction>();
            detail.detailActions.Add(action);
        }

        OperatorData cubeData = cube.GetComponent <OperatorData>();

        cubeData.createTime  = action.createTime;
        cubeData.actionName  = operatorobj.name;
        cubeData.parentFloor = currentFloor;
        cubeData.actionType  = "Operator";

        stepDetailPAnel panelScript = controlScript.detailPanel.GetComponent <stepDetailPAnel>();

        panelScript.scrollView.GetComponent <DetailStepScrollview>().storeData = storeData;

        storeData.Operators.Add(cube);


        Debug.Log(JsonUtility.ToJson(storeData));
        storeData.isUpdated = true;

        //controlScript.alreadyHavepoint = false;
        this.gameObject.SetActive(false);
    }
コード例 #28
0
        public ActionResult Edit([Bind(Include = "StepID,ProjectID,EstStartDate,EstEndDate,ActStartDate,ActEndDate,StepName,Status")] StepDetail stepDetail)
        {
            if (ModelState.IsValid)
            {
                // For automatic Progress
                var StepsCount          = db.StepDetails.Where(x => x.ProjectID == stepDetail.ProjectID).Count();
                var CompletedStepsCount = db.StepDetails.Where(x => x.ProjectID == stepDetail.ProjectID && x.Status == "Completed").Count();

                double ProjectProgress = (((Double)CompletedStepsCount / (Double)StepsCount) * 100);
                Double ProgressDec     = Math.Round(ProjectProgress, 2);

                ProjectDetail progress1 = db.ProjectDetails.Where(x => x.ProjectID == stepDetail.ProjectID).FirstOrDefault();
                progress1.Progress = (int)ProgressDec;

                stepDetail.Status = stepDetail.Status;

                // For Date Shift functionality
                StepDetail step = db.StepDetails.Single(x => x.StepID == stepDetail.StepID);
                step.ActStartDate = stepDetail.ActStartDate;
                step.EstStartDate = stepDetail.EstStartDate;

                if (step.EstEndDate != null && stepDetail.EstEndDate != null)
                {
                    DateTime PrevEstEndDate = step.EstEndDate.Value;
                    DateTime NewEstEndDate  = stepDetail.EstEndDate.Value;

                    double StepDateDiff = (NewEstEndDate.Date - PrevEstEndDate.Date).Days;

                    List <StepDetail> Steplist = db.StepDetails.Where(x => x.ProjectID == step.ProjectID).ToList();
                    step.EstEndDate = stepDetail.EstEndDate;
                    foreach (StepDetail item in Steplist)
                    {
                        if (item.StepID != step.StepID)
                        {
                            if (item.EstEndDate != null)
                            {
                                item.EstEndDate = item.EstEndDate.Value.AddDays(StepDateDiff);
                            }
                        }
                    }
                }
                else
                {
                    step.EstEndDate = stepDetail.EstEndDate;
                }


                if (step.ActEndDate != null && stepDetail.ActEndDate != null)
                {
                    DateTime NewActEndDate  = stepDetail.ActEndDate.Value;
                    DateTime PrevActEndDate = step.ActEndDate.Value;

                    int StepDateDiff = (NewActEndDate.Date - PrevActEndDate.Date).Days;

                    List <StepDetail> Steplist = db.StepDetails.Where(x => x.ProjectID == step.ProjectID).ToList();
                    step.ActEndDate = stepDetail.ActEndDate;

                    foreach (StepDetail item in Steplist)
                    {
                        if (item.StepID != step.StepID)
                        {
                            if (item.ActEndDate != null)
                            {
                                item.ActEndDate = item.ActEndDate.Value.AddDays(StepDateDiff);
                            }
                        }
                    }
                }
                else
                {
                    step.ActEndDate = stepDetail.ActEndDate;
                }

                db.Entry(step).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index", "StepDetails", new { id = stepDetail.ProjectID }));
            }
            ViewBag.ProjectID = new SelectList(db.ProjectDetails, "ProjectID", "ProjectName", stepDetail.ProjectID);
            return(View(stepDetail));
        }
コード例 #29
0
        void task_TaskProgress(StepDetail currentStepDetail, int stepsDone)
        {
            if (InvokeRequired)
            {
                BeginInvoke(new TaskProgressHandler(task_TaskProgress),
                    new object[] { currentStepDetail, stepsDone });
                return;
            }

            try
            {
                Logger.LogInfo("Task is executing step {0} of {1}", stepsDone, BkgTask.TotalSteps);

                if (currentStepDetail != null)
                {
                    if (!currentStepDetail.IsSuccess)
                    {
                        TreeNode tnParent = new TreeNode(currentStepDetail.Description + "     ");
                        tnParent.NodeFont = ThemeManager.LargeFont;

                        tnParent.ImageIndex = 0;
                        tnParent.SelectedImageIndex = 0;

                        TreeNode tnChild = new TreeNode(currentStepDetail.Results);
                        tnChild.NodeFont = ThemeManager.SmallFont;

                        tnChild.ImageIndex = 2;
                        tnChild.SelectedImageIndex = 2;

                        tnParent.Nodes.Add(tnChild);

                        tvResults.Nodes.Add(tnParent);

                        tvResults.ExpandAll();

                        _errorsFound = true;
                    }
                }

                pbProgress.Value = stepsDone;
            }
            catch
            {
            }

            tvResults.Visible = _errorsFound;
        }
コード例 #30
0
    private void Update()
    {
        if (saveSucceed)
        {
            saveSucceed = false;
            if (DataObj.isDp)
            {
                DataObj.isJoin = false;
                DataObj.lbc.OpLeaveRoom(false);
                DataObj.lbc.Disconnect();
            }
            DataObj.isScan      = false;
            DataObj.isBrowseMap = false;
            DataObj.isDp        = false;
            DataObj.shouHud     = false;
            DataObj.isRecommend = false;
            SceneManager.LoadScene(0);
        }


        if (fileSaved)
        {
            fileSaved = false;
            saveAfterFileupload();
        }


        if (!tempCurrentFloorName.Equals(gameObject.GetComponent <MapObj>().currentFloorName))
        {
            tempCurrentFloorName = gameObject.GetComponent <MapObj>().currentFloorName;
            createOperatorOnMap();
        }

        //电脑操作
        if (EventSystem.current.IsPointerOverGameObject())
        {
            //Debug.Log("当前触摸在UI上");
            return;
        }
        else
        {
            //Debug.Log("当前没有触摸在UI上");
        }


        if (Input.touchCount == 0)
        {
            return;
        }
        //if (Input.GetMouseButtonUp(0))
        if (Input.GetTouch(0).phase == TouchPhase.Began)
        {
            Ray ray = Camera.main.ScreenPointToRay(Input.GetTouch(0).position);
            //Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
            //Debug.Log(ray);
            RaycastHit hit;
            if (Physics.Raycast(ray, out hit))
            {
                //Debug.Log(hit.point);

                if (hit.collider.gameObject.tag.Equals("Operator"))
                {
                    //Debug.Log("11121212121");
                    if (canAddOperation)
                    {
                        canAddOperation = false;
                        return;
                    }
                    else if (detailPanel == null)
                    {
                        return;
                    }
                    else
                    {
                        if (DataObj.isScan && DataObj.isUserOwn == false)
                        {
                            StepDetail       detailsteps = storedData.newStrategy.steps[storedData.chosenStepIndex];
                            string           createtime  = hit.collider.gameObject.GetComponent <OperatorData>().createTime;
                            StepDetailAction tempAction  = new StepDetailAction();

                            foreach (StepDetailAction step in detailsteps.detailActions)
                            {
                                if (step.createTime.Equals(createtime))
                                {
                                    tempAction = step;
                                }
                            }

                            MNPopup mNPopup = new MNPopup("Info", tempAction.actionInfo);
                            mNPopup.AddAction("Ok", () => { Debug.Log("Ok action callback"); });
                            mNPopup.Show();
                        }
                        else
                        {
                            if (arrowControl == false)
                            {
                                EditPanelobj.SetActive(true);
                                EditPanelobj.GetComponent <HandelAction>().actionObj     = hit.collider.gameObject;
                                EditPanelobj.GetComponent <HandelAction>().controlScript = this;
                                EditPanelobj.GetComponent <HandelAction>().editSetup();
                            }
                        }
                    }
                }

                if (gameObject.GetComponent <DpScanMap>().canAddMark)
                {
                    addMarkOnMap(hit);
                    gameObject.GetComponent <DpScanMap>().canAddMark = false;
                }

                if (canAddOperation && OperatorChoosePanel.activeSelf == false)
                {
                    OperatorChoosePanel.SetActive(true);
                    OperatorChoosePanel.GetComponent <OperatorChoose>().controlScript = this;
                    OperatorChoosePanel.GetComponent <OperatorChoose>().hitPoint      = hit.point;
                    OperatorChoosePanel.GetComponent <OperatorChoose>().hitobject     = hit.collider.gameObject;
                    OperatorChoosePanel.GetComponent <OperatorChoose>().rayhit        = hit;
                    //canAddOperation = false;
                }
            }
        }
    }
コード例 #31
0
        void task_TaskStepInit(StepDetail currentStep)
        {
            if (InvokeRequired)
            {
                BeginInvoke(new TaskStepInitHandler(task_TaskStepInit),
                   new object[] { currentStep });
                return;
            }

            lblStepDetails.Text = Translator.TranslateTaggedString(currentStep.Description);
            lblStepDetails.Visible = true;
        }
コード例 #32
0
ファイル: PaintOnMap.cs プロジェクト: ycy1164656/R6Strategy
    //private void LoadByIO()
    //{

    //    //double startTime = (double)Time.time;
    //    //创建文件读取流
    //    FileStream fileStream = new FileStream(Application.persistentDataPath + "/CaptureScreenshot.png", FileMode.Open, FileAccess.Read);
    //    fileStream.Seek(0, SeekOrigin.Begin);
    //    //创建文件长度缓冲区
    //    byte[] bytes = new byte[fileStream.Length];
    //    //读取文件
    //    fileStream.Read(bytes, 0, (int)fileStream.Length);
    //    //释放文件读取流
    //    fileStream.Close();
    //    fileStream.Dispose();
    //    fileStream = null;

    //    //创建Texture
    //  Texture2D texture = new Texture2D(Screen.width, Screen.height);
    //texture.LoadImage(bytes);

    //    //创建Sprite


    //    //startTime = (double)Time.time - startTime;
    //    //Debug.Log("IO加载用时:" + startTime);
    //}



    // Update is called once per frame
    void Update()
    {
        //if (EventSystem.current.IsPointerOverGameObject())
        //{
        //    Debug.Log("当前触摸在UI上");
        //    return;

        //}

        if (fileSaved)
        {
            fileSaved = false;
            CommonData storeData = GetComponent <CommonData>();

            StepDetailAction action = new StepDetailAction();
            action.createTime   = System.DateTime.Now.ToString();
            action.imageType    = true;
            action.actionInfo   = descText.text;
            action.stepImageUrl = tempFile.Url.ToString();
            action.actionType   = "Image";
            action.parentFloor  = "10";
            StepDetail detail = storeData.newStrategy.steps[storeData.chosenStepIndex];
            if (detail.detailActions != null)
            {
                detail.detailActions.Add(action);
            }
            else
            {
                detail.detailActions = new List <StepDetailAction>();
                detail.detailActions.Add(action);
            }



            stepDetailPAnel panelScript = GetComponent <CommonControl>().detailPanel.GetComponent <stepDetailPAnel>();
            panelScript.scrollView.GetComponent <DetailStepScrollview>().storeData = storeData;
            storeData.isUpdated = true;
        }



        if (GetComponent <CommonControl>().canDrawLine)
        {
            if (Application.platform == RuntimePlatform.Android || Application.platform == RuntimePlatform.IPhonePlayer)
            {
                if (Input.touchCount == 1)
                {
                    Touch touch = Input.touches[0];
                    if (touch.phase == TouchPhase.Began)
                    {
                        clone = (GameObject)Instantiate(lineObj, lineObj.transform.position, Quaternion.identity);
                        lineArray.Add(clone);
                        //获得该物体上的LineRender组件
                        line = clone.GetComponent <LineRenderer>();
                        //设置起始和结束的颜色
                        line.startColor = Color.red;

                        line.endColor = Color.red;
                        //设置起始和结束的宽度
                        line.startWidth = .2f;
                        line.endWidth   = .2f;
                        //计数
                        i = 0;
                    }

                    if (touch.phase == TouchPhase.Moved)
                    {
                        i++;
                        //设置顶点数
                        line.positionCount = i;
                        //设置顶点位置(顶点的索引,将鼠标点击的屏幕坐标转换为世界坐标)
                        line.SetPosition(i - 1, Camera.main.ScreenToWorldPoint(new Vector3(touch.position.x, touch.position.y, 15)));
                    }
                }
            }
            else
            {
                if (Input.GetMouseButtonDown(0))
                {
                    //实例化对象
                    clone = (GameObject)Instantiate(lineObj, lineObj.transform.position, Quaternion.identity);
                    lineArray.Add(clone);
                    //获得该物体上的LineRender组件
                    line = clone.GetComponent <LineRenderer>();
                    //设置起始和结束的颜色
                    line.startColor = Color.red;

                    line.endColor = Color.red;
                    //设置起始和结束的宽度
                    line.startWidth = .2f;
                    line.endWidth   = .2f;
                    //计数
                    i = 0;
                }
                if (Input.GetMouseButton(0))
                {
                    //每一帧检测,按下鼠标的时间越长,计数越多
                    i++;
                    //设置顶点数
                    line.positionCount = i;
                    //设置顶点位置(顶点的索引,将鼠标点击的屏幕坐标转换为世界坐标)
                    line.SetPosition(i - 1, Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, 15)));
                }
            }
        }
    }