示例#1
0
 /// <summary>
 /// Check and return task completation status.
 /// </summary>
 /// <param name="gaugeInfo">Reference to device/gauge in use.</param>
 /// <returns>True when task completed, otherwise false.</returns>
 override public bool IsTaskComplete(GaugeInfo gaugeInfo)
 {
     if (!isCompleted)
     {
         if (currentHasStarted)
         {
             if (gaugeInfo.Current < taperCurrent && gaugeInfo.FlagFC == true)
             {
                 isCompleted = true;
             }
             else if (DateTime.Now.Subtract(startTime).TotalMilliseconds >= TerminationHoldOffMilliseconds && gaugeInfo.Current < taperCurrent)
             {
                 isCompleted = false;
             }
             else if (gaugeInfo.Current < taperCurrent && gaugeInfo.FlagFC == false)
             {
                 isCompleted = false;
             }
         }
         else if (DateTime.Now.Subtract(startTime).TotalMilliseconds >= TerminationHoldOffMilliseconds)
         {
             if (gaugeInfo.Current > ChargeStartedCurrentThresholdMilliamps)
             {
                 this.currentHasStarted = true;
             }
         }
     }
     return(isCompleted);
 }
示例#2
0
        /// <summary>
        /// Initialize when main window was loaded.
        /// </summary>
        /// <param name="sender">Not used.</param>
        /// <param name="e">Not used.</param>
        private void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            CfgCycleCellCount.Text           = Properties.Settings.Default.CellCount;
            CfgCycleTaperCurr.Text           = Properties.Settings.Default.TaperCurrent;
            CfgCycleTermVolt.Text            = Properties.Settings.Default.TerminationVoltage;
            CfgCycleChargeRelaxHours.Text    = Properties.Settings.Default.ChargeRelaxHours;
            CfgCycleDischargeRelaxHours.Text = Properties.Settings.Default.DischargeRelaxHours;

            try
            {
                int    BrdsNumber = 0;
                string BrdsName   = "";

                if (board.Connect(out BrdsNumber, out BrdsName) != 0)
                {
                    throw new ArgumentException("EV2300 not found.");
                }

                LogView.AddEntry("EV2300 connected...");
                Console.WriteLine(BrdsName);

                EV23KError err = board.CheckForError();
                gauge = new GaugeInfo(board);

                UpdateGui(null, null);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
示例#3
0
文件: Cycle.cs 项目: kjlopin/bqev23k
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="_taskList">Task list to be cycled through.</param>
 /// <param name="_gauge">Gauge class object.</param>
 public Cycle(List <GenericTask> _taskList, GaugeInfo _gauge)
 {
     taskList = _taskList;
     gauge    = _gauge;
     gauge.ToggleChargerRelay(false);
     gauge.ToggleLoadRelay(false);
     pushLoadStartButton = true;
 }
示例#4
0
 /// <summary>
 /// Check and return task completation status.
 /// </summary>
 /// <param name="gaugeInfo">Reference to device/gauge in use.</param>
 /// <returns>True when task completed, otherwise false.</returns>
 override public bool IsTaskComplete(GaugeInfo gaugeInfo)
 {
     // Check for termination voltage
     if (!isCompleted)
     {
         if (DateTime.Now.Subtract(startTime).TotalMilliseconds >= TerminationHoldOffMilliseconds)
         {
             if (gaugeInfo.Voltage < this.terminateVoltage)
             {
                 isCompleted = true;
             }
         }
     }
     return(isCompleted);
 }
示例#5
0
 /// <summary>
 /// Check and return task completation status.
 /// </summary>
 /// <param name="gaugeInfo">Reference to device/gauge in use.</param>
 /// <returns>True when task completed, otherwise false.</returns>
 override public bool IsTaskComplete(GaugeInfo gaugeInfo)
 {
     if (isInitialized)
     {
         // Complete either by timeout
         if (DateTime.Compare(DateTime.Now, endTime) > 0)
         {
             return(true);
         }
         // or more accurate when VOK and RDIS are cleared (SLUA848, chapter 4.2.2)
         if (gaugeInfo.FlagVOK == false && gaugeInfo.FlagRDIS == false)
         {
             return(true);
         }
     }
     return(false);
 }
示例#6
0
 /// <summary>
 /// Check and return task completation status.
 /// </summary>
 /// <param name="gaugeInfo">Reference to device/gauge in use.</param>
 /// <returns>True when task completed, otherwise false.</returns>
 virtual public bool IsTaskComplete(GaugeInfo gaugeInfo)
 {
     return(true);
 }