Exemple #1
0
        public void OnStageStarted(object set, StageInfoEventArgs sea)
        {
            lock (resLock)
            {
                BatterySet bat = (BatterySet)set;

                if (Results.Count == 0)
                {
                    Results.Add(new ResultsPoint()
                    {
                        CycleNo = bat.CurrentCycle
                    });
                    return;
                }

                ResultsPoint point = Results.Last();
                if (point.CycleNo < bat.CurrentCycle)
                {
                    Results.Add(new ResultsPoint()
                    {
                        CycleNo = bat.CurrentCycle
                    });
                }
            }
        }
Exemple #2
0
        public void OnStageCompleted(object set, StageInfoEventArgs sea)
        {
            BatterySet   bat   = (BatterySet)set;
            ResultsPoint point = Results[bat.CurrentCycle - 1];

            ExperimentStageBase stage = sea.Stage;

            switch (bat.TypeOfBattery)
            {
            case BatteryType.SingleBattery:
            {
                if (stage is ChargeStage)
                {
                    point.ChargeDurationSingle = stage.Duration;
                    point.ChargeVolumeSingle   = stage.TotalCharge;
                }

                if (stage is DischargeStage)
                {
                    point.DischargeDurationSingle = stage.Duration;
                    point.DischargeVolumeSingle   = stage.TotalCharge;
                }
            }
            break;

            case BatteryType.BatteryUsingCNM:
            {
                if (stage is ChargeStage)
                {
                    point.ChargeDurationCNM = stage.Duration;
                    point.ChargeVolumeCNM   = stage.TotalCharge;
                }

                if (stage is DischargeStage)
                {
                    point.DischargeDurationCNM = stage.Duration;
                    point.DischargeVolumeCNM   = stage.TotalCharge;
                }
            }
            break;

            default:
                break;
            }

            Save("ToLoad2.csv");
        }