public override void TextChange()
 {
     #region 總電表
     TimeSpan timeSpan = DateTime.Now.Subtract(ChangeViewTime);
     if (timeSpan.TotalSeconds > 10 && Form1.LockFlag)
     {
         if (MasterMeters.Count > ViewIndex)
         {
             ViewIndex++;
             MasterMetenavigationFrame.SelectedPageIndex = ViewIndex;
             ChangeViewTime = DateTime.Now;
         }
         else
         {
             ViewIndex = 0;
             MasterMetenavigationFrame.SelectedPageIndex = ViewIndex;
             ChangeViewTime = DateTime.Now;
         }
     }
     else if (timeSpan.TotalSeconds > 10 && !Form1.LockFlag)
     {
         ChangeViewTime = DateTime.Now;
     }
     #endregion
     if (ElectricConfigs != null)
     {
         MasterMeterIndex = 0;
         foreach (var item in ElectricConfigs)
         {
             if (item.TotalMeterFlag)
             {
                 MasterMeters[MasterMeterIndex].ElectricConfig = item;
                 MasterMeterIndex++;
             }
         }
         if (MasterMetenavigationFrame.SelectedPageIndex != -1)
         {
             MasterMeters[MasterMetenavigationFrame.SelectedPageIndex].AbsProtocols = AbsProtocols;
             MasterMeters[MasterMetenavigationFrame.SelectedPageIndex].TextChange();
         }
         #region 分電表
         ChargingPileUserControl.AbsProtocols    = AbsProtocols;
         ChargingPileUserControl.ElectricConfigs = ElectricConfigs;
         ChargingPileUserControl.TextChange();
         #endregion
     }
     else
     {
         Log.Error("無電表資訊,請檢查資料");
     }
 }
 public ChargingPileView(List <ElectricConfig> electricConfigs, SqlMethod sqlMethod, Form1 form1, List <GatewayConfig> gatewayConfigs)
 {
     InitializeComponent();
     Form1 = form1;
     if (electricConfigs != null)
     {
         foreach (var item in electricConfigs)
         {
             if (item.TotalMeterFlag)//總電表
             {
                 if (Form1.ConnectionFlag)
                 {
                     MasterMeterUserControl masterMeter = new MasterMeterUserControl(item, sqlMethod, form1, gatewayConfigs)
                     {
                         SqlMethod = sqlMethod
                     };
                     MasterMeters.Add(masterMeter);
                     MasterMetenavigationFrame.AddPage(masterMeter);
                 }
                 else
                 {
                     MasterMeterUserControl masterMeter = new MasterMeterUserControl(item, sqlMethod, form1, gatewayConfigs)
                     {
                         SqlMethod = sqlMethod, ElectricConfigs = electricConfigs
                     };
                     MasterMeters.Add(masterMeter);
                     MasterMetenavigationFrame.AddPage(masterMeter);
                 }
             }
         }
         ChargingPileUserControl = new ChargingPileUserControl(electricConfigs, sqlMethod, form1, gatewayConfigs)
         {
             SqlMethod = sqlMethod, GatewayConfigs = GatewayConfigs
         };
         ChargingPilepanelControl.Controls.Add(ChargingPileUserControl);
         ChangeViewTime = DateTime.Now;
     }
     else
     {
         Log.Error("無電表資訊,請檢查資料");
     }
 }