예제 #1
0
        ///// <summary>
        ///// 已经排到的最后一天
        ///// </summary>
        //public DateTime? CapEndTime { get; set; }
        ///// <summary>
        ///// 最后一天剩余的能力值
        ///// </summary>
        //public double LastCap { get; set; }

        ///// <summary>
        ///// 添加Step到数组中,并记录最后的完成时间
        ///// </summary>
        ///// <param name="step"></param>
        //public DateTime? AddStep(MOItemTask step)
        //{
        //    DateTime? EndTime = null ;
        //    if (!StepList.Where(p => p.MOItemTaskId == step.MOItemTaskId).Any())
        //    {
        //        StepList.Add(step);

        //        this.endTime = step.PlannedDateTo;

        //        EndTime = this.endTime;
        //    }

        //    SetTimeslice();

        //    return EndTime;
        //}

        //public void AddStep(MOItemTask step,double cap)
        //{
        //    double sum = LastCap + cap;
        //    double maxcap = VentureCap * 1.2;
        //    if (sum <= maxcap)
        //    {
        //        LastCap = VentureCap - sum;
        //    }
        //    else
        //    {
        //        LastCap = VentureCap - cap;
        //        if(CapEndTime == null)
        //        {
        //            CapEndTime = DateTime.Now;
        //        }

        //        do
        //        {
        //            CapEndTime = CapEndTime.Value.AddDays(1);
        //        }
        //        while (IsWorkTime(CapEndTime.Value));
        //    }

        //    step.PlannedDateFrom = new DateTime(CapEndTime.Value.Year, CapEndTime.Value.Month, CapEndTime.Value.Day, 8, 0, 0);
        //    step.PlannedDateTo = new DateTime(CapEndTime.Value.Year, CapEndTime.Value.Month, CapEndTime.Value.Day, 17, 0, 0);


        //    StepList.Add(step);
        //}

        public DateTime?AddStep(MOItemTask step, DateTime?lastTime, double cap)
        {
            if (lastTime != null)
            {
                var workTime = VenTureDayModel.GetWorkTime((DateTime)lastTime, VentureId);

                var venTureDayModel = this.VenTureDayModelList.Where(p => p.DayDate.Year == workTime.Year && p.DayDate.Month == workTime.Month && p.DayDate.Day == workTime.Day && p.LastCap > 0).FirstOrDefault();

                if (venTureDayModel == null)
                {
                    this.VenTureDayModelList.Add(new VenTureDayModel(workTime, VentureCap, new List <MOItemTask>()));

                    venTureDayModel = this.VenTureDayModelList.Where(p => p.DayDate >= lastTime).FirstOrDefault();
                }

                if (venTureDayModel.LastCap < cap && VentureCap * 0.25 < cap)
                {
                }

                var retModel = venTureDayModel.AddStep(step, cap, lastTime, this.VentureId);

                StepList.Add(retModel.MOItemTask);

                return(retModel.EndTime);
            }
            else
            {
                return(null);
            }
        }
예제 #2
0
        internal void Reset()
        {
            GremlinVariable inputVariable = null;

            if (VariableList.First() is GremlinContextVariable)
            {
                inputVariable = VariableList.First();
            }

            ParentContext = null;
            PivotVariable = null;
            VariableList.Clear();
            ProjectedProperties.Clear();
            TableReferences.Clear();
            MatchPathList.Clear();
            Predicates = null;
            StepList.Clear();
            ContextLocalPath = null;

            //TODO: reserve the InputVariable, used for repeat step, should be refactored later
            if (inputVariable != null)
            {
                VariableList.Add(inputVariable);
            }
        }
예제 #3
0
        public void UpdateCurrentMap(JObject j)
        {
            WorldMap map = j["value"]["maps"][0].ToObject <WorldMap>();

            worldMaps[currentMapId] = map;

            StepList.BeginUpdate();

            StepList.Clear();

            try
            {
                List <Step> steps = map.steps.ToList();
                steps.Sort((Step a, Step b) => a.position.CompareTo(b.position));

                foreach (Step step in steps)
                {
                    StepList.Items.Add($"{step.position} {(map.curr_position == step.position ? step.capture - map.curr_capture : (map.curr_position > step.position ? 0 : step.capture)).ToString("f1")}/{step.capture.ToString("f1")}");
                }

                StepList.EnsureVisible(map.curr_position);
                StepList.Items[map.curr_position].Selected = true;
                StepList.Select();
            }
            catch (Exception Ex)
            {
                MessageBox.Show(Ex.ToString());
                StepList.Clear();
            }

            StepList.EndUpdate();

            TotalStep.Text = map.steps.Sum((s) => s.capture).ToString();
        }
예제 #4
0
        internal void Reset()
        {
            GremlinVariable inputVariable = null;

            if (VariableList.First() is GremlinContextVariable)
            {
                inputVariable = VariableList.First();
            }

            PivotVariable = null;
            Predicates    = null;
            VariableList.Clear();
            TableReferences.Clear();
            PathList.Clear();
            StepList.Clear();
            IsPopulateGremlinPath = false;
            CurrentContextPath    = null;
            ProjectVariablePropertiesList.Clear();
            ProjectedProperties.Clear();

            //reserve the InputVariable
            if (inputVariable != null)
            {
                VariableList.Add(inputVariable);
            }
        }
예제 #5
0
        public void Delete()
        {
            if (SelectedStep == null)
            {
                return;
            }
            var diagle = windowManager.ShowMessageBox(String.Format("确定要删除"), "系统提示", MessageBoxButton.YesNo);

            if (diagle == MessageBoxResult.Yes)
            {
                List <T_LogicStep> selsteps = new List <T_LogicStep>(SelectedStep.ToArray());
                foreach (var selstep in selsteps)
                {
                    if (this.logicService.DeleteT_LogicStep(selstep.ID))
                    {
                        var CurrentIndex = StepList.IndexOf(selstep);
                        for (int i = CurrentIndex; i < StepList.Count; i++)
                        {
                            StepList[i].OrderIndex = StepList[i].OrderIndex - 1;
                        }
                        StepList.Remove(selstep);
                        Program.LogicSteps = StepList.ToList();
                        SaveEvent?.Invoke(Program);
                    }
                    else
                    {
                        this.View.ShowHint(new MessageWin(false));
                    }
                }
            }
        }
예제 #6
0
        public IHttpActionResult TestResukt(SOAPEnvelope sop)
        {
            //string xmlData = HttpContext.Current.Server.MapPath(@"D:/objectXmlWebApi.xml");

            //XDocument Rsp = XDocument.Load(@"D:/objectXmlWebApi.xml");


            XmlDocument doc = new XmlDocument();

            doc.Load(@"D:\StepList.xml");

            //TextReader testData = new StringReader(@"D:\soapenvelopefortest.xml");

            //string testData = @"<StepList>
            //            <Step>
            //                <Name>My Name Is Isit</Name>
            //                <Desc>Desc1</Desc>
            //            </Step>
            //            <Step>
            //                <Name>Name2</Name>
            //                <Desc>Desc2</Desc>
            //            </Step>
            //        </StepList>";

            XmlSerializer serializer = new XmlSerializer(typeof(StepList));

            using (TextReader reader = new StringReader(doc.ToString()))
            {
                StepList result = (StepList)serializer.Deserialize(reader);
                return(Ok(result));
            }
        }
예제 #7
0
        public void ShowProcessFlowSummary(Step lastProcessFlowStep)
        {
            List <StepAnswer> stepAnswersList = new List <StepAnswer>();

            if (lastProcessFlowStep != null)
            {
                StepList.Add(lastProcessFlowStep);
            }

            // loop throuch each of the steps and display the question and answers depending on the Step Type (Button, Text, Numeric, Date)
            foreach (var step in StepList)
            {
                var stepIndex = StepList.IndexOf(step);

                //skip the first step since it is the root step
                if (stepIndex > 0)
                {
                    //get the step interacted with before the current one
                    var stepBefore = StepList[stepIndex - 1];

                    // if the step before the current one is of type button then the NavigationText attribute is the answer to the prior step
                    if (stepBefore.Type == (int)StepInputTypeEnum.Options)
                    {
                        //Logger.Verbose(stepBefore.HeaderText + " : " + step.NavigationText);
                        //Logger.Verbose("");
                        stepAnswersList.Add(new StepAnswer {
                            AnswerValue = step.NavigationText, QuestionValue = stepBefore.HeaderText
                        });
                    }
                    else
                    {
                        // else if the step before the current one is of type text/numeric/date then get the answer from the dictionary
                        string stepAnwer = "";
                        if (StepAnswersDictionary.TryGetValue(stepBefore.Id, out stepAnwer))
                        {
                            Logger.Verbose(stepBefore.HeaderText + " : " + stepAnwer);
                            //Logger.Verbose("");
                            stepAnswersList.Add(new StepAnswer {
                                AnswerValue = stepAnwer, DataKey = stepBefore.DataKey, QuestionValue = stepBefore.HeaderText
                            });
                        }
                    }
                }
            }

            //set the serialiazed string of step answers
            StepAnswerListStringDefinition = JsonConvert.SerializeObject(stepAnswersList);

            //set the OutcomeId of the last step (with an Endpoint)
            if (lastProcessFlowStep != null)
            {
                OutComeIdString = lastProcessFlowStep.Outcome.ToString();
            }

            //display the process flow summary
            ReplaceFragment(ProcessFlowSummaryFragmentInstance, Resource.Id.ticket_placeholder, SummaryFragmentTag);
        }
        public void AddStep(object obj)
        {
            Step step = new Step();

            scene.steps.Add(step);
            StepViewModel stepVm = new StepViewModel(this);

            stepVm.step = step;
            StepList.Add(stepVm);
        }
예제 #9
0
    public void PlaySteps(StepList stepList)
    {
        currentSteps = new List <RunningStep>();

        playingList  = stepList;
        songFinished = false;
        stepIndex    = 0;
        playTime     = 0;
        nextStepTime = 0;
    }
예제 #10
0
 private static void AddStep(Project p)
 {
     if (p.ModuleConfiguration.InstallSteps == null)
     {
         p.ModuleConfiguration.InstallSteps = StepList.Create();
     }
     if (p.ModuleConfiguration.InstallSteps.InstallStep == null)
     {
         p.ModuleConfiguration.InstallSteps.InstallStep = new ObservableCollection <InstallStep>();
     }
     p.ModuleConfiguration.InstallSteps.InstallStep.Add(InstallStep.Create());
 }
예제 #11
0
 private void M_ConfirmEvent(object sender, T_LogicStep Step)
 {
     if (Step.OrderIndex == 0)
     {
         int orderIndex = 1;
         if (StepList.Count > 0)
         {
             orderIndex = StepList[StepList.Count - 1].OrderIndex + 1;
         }
         Step.OrderIndex = orderIndex;
         StepList.Add(Step);
     }
 }
예제 #12
0
 internal void Reset()
 {
     PivotVariable = null;
     Predicates    = null;
     VariableList.Clear();
     TableReferences.Clear();
     PathList.Clear();
     StepList.Clear();
     IsPopulateGremlinPath = false;
     CurrentContextPath    = null;
     ProjectVariablePropertiesList.Clear();
     ProjectedProperties.Clear();
 }
예제 #13
0
        protected override void OnViewLoaded()
        {
            t_GSBackup = TransExpUtil <T_GelStep, T_GelStep> .Trans(t_GelStep);

            if (t_GelStep.StepID != 0)
            {
                var obj = StepList.Where(c => c.ID == t_GelStep.StepID);
                if (obj != null && obj.Count() > 0)
                {
                    SwitchPage(obj.First());
                }
            }
        }
예제 #14
0
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();

        StepList config = (StepList)target;

        EditorGUILayout.BeginVertical(EditorStyles.helpBox);

        EditorGUILayout.BeginHorizontal();
        GUILayout.Label("Index", GUILayout.Width(128));
        GUILayout.Label("Start time", GUILayout.Width(128));
        GUILayout.Label("Perfect time", GUILayout.Width(128));
        GUILayout.Label("Value/Duration", GUILayout.Width(128));
        GUILayout.Label("Component", GUILayout.Width(128));
        EditorGUILayout.EndHorizontal();

        for (int i = 0; i < config.steps.Length; i++)
        {
            EditorGUILayout.BeginHorizontal(EditorStyles.helpBox);

            ref Step step = ref config.steps[i];

            GUILayout.Label(i.ToString(), GUILayout.Width(128));
            step.startTime   = EditorGUILayout.FloatField(step.startTime, GUILayout.Width(128));
            step.perfectTime = EditorGUILayout.FloatField(step.perfectTime, GUILayout.Width(128));
            GUI.enabled      = ComponentHasValue(step.component);
            step.value       = EditorGUILayout.FloatField(GUI.enabled ? step.value : -1, GUILayout.Width(128));
            GUI.enabled      = true;
            step.component   = (DJComponent)EditorGUILayout.EnumPopup(step.component, GUILayout.Width(128));

            if (GUILayout.Button("↑", GUILayout.Width(32)))
            {
                MoveStep(config, i, -1);
            }
            if (GUILayout.Button("↓", GUILayout.Width(32)))
            {
                MoveStep(config, i, +1);
            }
            if (GUILayout.Button("+", GUILayout.Width(32)))
            {
                AddStep(config, i + 1);
            }
            if (GUILayout.Button("-", GUILayout.Width(32)))
            {
                RemoveStep(config, i);
            }

            EditorGUILayout.EndHorizontal();
        }
예제 #15
0
        public void ShowPreviousStep()
        {
            //if there are still steps/questions
            if (StepList.Any())
            {
                //get the last step in the list
                var lastStep = StepList.Last();

                //display it
                ShowStep(lastStep);
            }
            else
            {
                //if there are no steps remaining, call OnBackPressed
                base.OnBackPressed();
            }
        }
예제 #16
0
 public void Confirm()
 {
     if (String.IsNullOrEmpty(Program.Name))
     {
         this.View.ShowHint(new MessageWin("程序名称不能为空"));
         return;
     }
     Program.LogicSteps = StepList.ToList();
     if (logicService.SaveT_LogicTest(Program))
     {
         SaveEvent?.Invoke(Program);
         this.View.ShowHint(new MessageWin());
     }
     else
     {
         this.View.ShowHint(new MessageWin("保存失败!"));
     }
 }
예제 #17
0
    public void StopSteps()
    {
        playingList  = null;
        songFinished = true;

        for (int stepIndex = 0; stepIndex < currentSteps.Count; ++stepIndex)
        {
            GameObject instance = currentSteps[stepIndex].markInstance;
            LeanTween.cancel(instance);
            Destroy(instance);
        }
        currentSteps.Clear();

        for (int characterIndex = 0; characterIndex < Game.data.characterCount; ++characterIndex)
        {
            Character character = Game.data.characters[characterIndex];
            character.StopDance();
        }
    }
        private async Task PerformStepsAsync(StepList steps, ValueTestList valueTests)
        {
            _CurrentTestResult.UseCaseResults.Add(_CurrentUseCaseResult);

            foreach (var step in steps)
            {
                var stepResult = await RunStepAsync(step);

                _CurrentUseCaseResult.StepResults.Add(stepResult);

                if (step is IGetValueStep getValueStep)
                {
                    if (string.IsNullOrEmpty(getValueStep.ValueKey))
                    {
                        continue;
                    }

                    _CurrentUseCaseResult.TestValues.Add(getValueStep.ValueKey, stepResult.Value);

                    var valueTestsForStep = valueTests.Where(vt => vt.ValueKey == getValueStep.ValueKey);
                    foreach (var valueTest in valueTestsForStep)
                    {
                        var value = _CurrentUseCaseResult.TestValues[valueTest.ValueKey];

                        var dependentValue = GetDependentValue(value);

                        var item = new TestValueResult(valueTest);
                        item.ErrorMessage = CheckValueTest(valueTest, dependentValue, item);

                        _CurrentUseCaseResult.TestValueResults.Add(item);

                        if (valueTest.IsRequired && !string.IsNullOrEmpty(item.ErrorMessage))
                        {
                            throw new Exception($"The test cannot continue because a required Value Test failed.\r\n {valueTest.ToString()}");
                        }
                    }
                }
            }
        }
예제 #19
0
        public void Copy()
        {
            if (SelectedStep == null)
            {
                return;
            }
            List <T_LogicStep> selsteps = new List <T_LogicStep>(SelectedStep.ToArray());

            foreach (var selstep in selsteps)
            {
                var NewStep = TransExpUtil <T_LogicStep, T_LogicStep> .Trans(selstep);

                NewStep.ID = 0;
                int orderIndex = 1;
                if (StepList.Count > 0)
                {
                    orderIndex = StepList[StepList.Count - 1].OrderIndex + 1;
                }
                NewStep.OrderIndex = orderIndex;
                StepList.Add(NewStep);
            }
        }
예제 #20
0
        public void MoveUp()
        {
            if (SelectedStep == null)
            {
                return;
            }
            List <T_LogicStep> selsteps = new List <T_LogicStep>(SelectedStep.ToArray());

            foreach (var selstep in selsteps)
            {
                var CurrentIndex = StepList.IndexOf(selstep);
                if (CurrentIndex == 0)
                {
                    return;
                }
                var sec = StepList[CurrentIndex - 1];
                sec.OrderIndex     = sec.OrderIndex + 1;
                selstep.OrderIndex = selstep.OrderIndex - 1;
                StepList.Remove(sec);
                StepList.Insert(CurrentIndex, sec);
            }
        }
예제 #21
0
 internal void SetPivotVariable(GremlinVariable newPivotVariable)
 {
     PivotVariable = newPivotVariable;
     StepList.Add(newPivotVariable);
 }
예제 #22
0
파일: Scenario.cs 프로젝트: lanpin/abp
 protected void AddStep(ScenarioStep step)
 {
     StepList.Add(step);
 }
예제 #23
0
 internal void SetPivotVariable(GremlinVariable newPivotVariable)
 {
     PivotVariable = newPivotVariable;
     StepList.Add(newPivotVariable);
     newPivotVariable.HomeContext = this;
 }
예제 #24
0
        public async void ShowStep(Step processFlowStep)
        {
            //either display the step or  remove it from the persisted step list
            if (processFlowStep != null)
            {
                var stepToAddRemove = processFlowStep;

                if (StepList.Contains(stepToAddRemove))
                {
                    //text/numeric/date input answers to be removed from state
                    if (stepToAddRemove.Type != (int)StepInputTypeEnum.Options)
                    {
                        //remove the saved answer from persisted state
                        StepAnswersDictionary.Remove(stepToAddRemove.Id);
                    }

                    //if it already exists in the persisted step list, remove it
                    StepList.Remove(stepToAddRemove);

                    if (StepList.Any())
                    {
                        //and get the step before it
                        stepToAddRemove = StepList.Last();
                    }
                    else
                    {
                        //if after removing and there are no more steps, go back to the previous activity
                        base.OnBackPressed();
                    }
                }
                else
                {
                    //if it doesnt exist in the persisted step list, add it
                    StepList.Add(stepToAddRemove);
                }

                //instantiate a new Step Fragment
                var    processFlowFragment = new ProcessFlowFragment();
                Bundle args = new Bundle();

                //serialize the object to a step definition string
                var processFlowString = JsonConvert.SerializeObject(stepToAddRemove);

                //pass the step string definition to the fragment in the bundle
                args.PutString(ProcessFlowStep, processFlowString);

                // if the step to be shown is a text/numeric/date input, check the dictionary for a saved answer entered previously and pass it to the fragment
                if (stepToAddRemove.Type != (int)StepInputTypeEnum.Options)
                {
                    string stepAnwer = null;
                    if (StepAnswersDictionary.TryGetValue(stepToAddRemove.Id, out stepAnwer))
                    {
                        Logger.Verbose(stepToAddRemove.HeaderText + " : Answer found in Dictionary to be shown in Fragment : " + stepAnwer);
                    }

                    args.PutString(ProcessFlowStepAnswer, stepAnwer);
                }

                processFlowFragment.Arguments = args;

                //display the fragment
                ReplaceFragment(processFlowFragment, Resource.Id.ticket_placeholder, TicketFragmentTag);
            }
        }
 protected StepListPipe(IPlugInContext context, StepList <IEnvelope <TIn> > stepList) : base(context)
 {
     _stepList           = stepList;
     _stepList.Tail.Next = new TerminalStep <IEnvelope <TOut> >((value) => _subject.OnNext((IEnvelope <TOut>)value));
 }
 void Awake()
 {
     givens = new List <Given>();
     steps  = new StepList();
 }
예제 #27
0
 public PayloadProvider()
 {
     _DocPayload = new StepList <DocPayload>(1024, 1024 * 256, 1024 * 256);
     //_DocPayload = new Dictionary<int, Payload>(); //DocId to payload
 }
 public void DeleteStep(StepViewModel viewModel)
 {
     scene.steps.Remove(viewModel.step);
     StepList.Remove(viewModel);
     window.DataGrid_RowChanged();
 }