/// <summary>
 /// Reset button click resets info and unchecks all data
 /// This also reloads the report_config.json file in case there are any changes
 /// //Allows for real-time update of report lists for medications and conditions
 /// </summary>
 public void ResetClick()
 {
     //Reset all values and gets the data from the report config file again in case there was a change
     //Allows for real-time update of report lists for medications and conditions
     AdditionalCommentsForReportBox = "";
     ConditionList.Clear();
     MedicationList.Clear();
     reportModel = jSONService?.GetReportModelFromFile(reportFilePath);
     if (reportModel == null)
     {
         return;
     }
     GetListOfMedicationsConditionsFromModel();
 }
Exemplo n.º 2
0
        public override void RecoverySerialObject()
        {
            var r = new BacktestingResource();

            if (TestStrategySerial != null)
            {
                var s = TestStrategySerial.CreateInstance(BacktestingResource.CommonResource.StrategyPrototypeList.Cast <ISerialSupport>().ToList());
                if (s != null)
                {
                    TestStrategy = s as IStrategy;
                }
            }
            if (DataSourceSerial != null)
            {
                var s = DataSourceSerial.CreateInstance(BacktestingResource.CommonResource.DataSourcePrototypeList.Cast <ISerialSupport>().ToList());
                if (s != null)
                {
                    CurrentDataSource = s as IDataSource;
                }
            }
            if (TradeGateSerial != null)
            {
                var s = TradeGateSerial.CreateInstance(BacktestingResource.CommonResource.TradeGatePrototypeList.Cast <ISerialSupport>().ToList());
                if (s != null)
                {
                    CurrentTradeGate = s as ITradeGate;
                }
            }
            if (RiskPolicySerial != null)
            {
                var s = RiskPolicySerial.CreateInstance(BacktestingResource.CommonResource.RiskControlPrototypeList.Cast <ISerialSupport>().ToList());
                if (s != null)
                {
                    RiskPolicy = s as IRiskControl;
                }
            }
            ConditionList.Clear();
            ConditionSerialList.ForEach(v =>
            {
                var i = v.CreateInstance(BacktestingResource.CommonResource.ConditionPrototypeList.Cast <ISerialSupport>().ToList());
                if (i != null)
                {
                    ConditionList.Add(i as ICondition);
                }
            });
        }
Exemplo n.º 3
0
        public int SetConditionInfo(string s)
        {
            var l = CommonLib.CommonProc.ConvertStringToObject <List <SerialInfo> >(s);

            if (l == null || l.Count == 0)
            {
                return(0);
            }
            ConditionList.Clear();
            l.ForEach(v =>
            {
                var i = v.CreateInstance(BacktestingResource.CommonResource.ConditionPrototypeList.Cast <ISerialSupport>().ToList());
                if (i != null)
                {
                    ConditionList.Add(i as ICondition);
                }
            });
            return(l.Count);
        }
Exemplo n.º 4
0
        public override void RecoverySerialObject()
        {
            ConditionList.Clear();
            ConditionSerialList.ForEach(v =>
            {
                var i = v.CreateInstance(BacktestingResource.CommonResource.ConditionPrototypeList.Cast <ISerialSupport>().ToList());
                if (i != null)
                {
                    ConditionList.Add(i as ICondition);
                }
            });

            PredicateList.Clear();
            PredicateSerialList.ForEach(v =>
            {
                var i = v.CreateInstance(BacktestingResource.CommonResource.ConditionPrototypeList.Cast <ISerialSupport>().ToList());
                if (i != null)
                {
                    PredicateList.Add(i as ICondition);
                }
            });
        }
Exemplo n.º 5
0
        public override void LoadInfo()
        {
            if (TargetProject == null)
            {
                return;
            }

            ConditionList.Clear();
            TargetProject.ConditionList.ForEach(v => ConditionList.Add(new ConditionViewModel()
            {
                TargetObject = v
            }));
            InstrumentList.Clear();
            TargetProject.InstrumentList.ForEach(v => InstrumentList.Add(v));
            CurrentStrategy   = TargetProject.TestStrategy;
            CurrentTradeGate  = TargetProject.CurrentTradeGate;
            CurrentDataSource = TargetProject.CurrentDataSource;
            IsChanged         = false;
            if (TargetSummaryVM != null)
            {
                TargetSummaryVM.Refresh();
            }
        }
Exemplo n.º 6
0
        public override void LoadInfo()
        {
            if (TargetProject == null)
            {
                return;
            }
            ConditionList.Clear();
            TargetProject.ConditionList.ForEach(v => ConditionList.Add(new ConditionViewModel()
            {
                TargetObject = v
            }));
            PredicateList.Clear();
            TargetProject.PredicateList.ForEach(v => PredicateList.Add(new ConditionViewModel()
            {
                TargetObject = v
            }));

            InstrumentList.Clear();
            TargetProject.InstrumentList.ForEach(v => InstrumentList.Add(v));
            ResultList.Clear();
            TargetProject.ResultList.ForEach(v => ResultList.Add(new InstrumentViewModel()
            {
                TargetObject = v, GetCurrentDataSource = () => { return(CurrentDataSource); }
            }));
            TargetProject.BlockList.ForEach(v => BlockList.Add(new InstrumentViewModel()
            {
                TargetObject = v, GetCurrentDataSource = () => { return(CurrentDataSource); }
            }));
            CurrentDataSource = TargetProject.CurrentDataSource;

            IsChanged = false;
            if (TargetSummaryVM != null)
            {
                TargetSummaryVM.Refresh();
            }
        }
Exemplo n.º 7
0
 public void Clear()
 {
     ConditionList.Clear();
 }