Ejemplo n.º 1
0
        public void UpdateJumpVerWei(double jgbWei, List <ElecCalsWorkCondition> anWeathComm)
        {
            foreach (var nameWd in WireWorkConditionNames)
            {
                var wea   = JmWireData.WeatherParas.WeathComm.Where(item => item.Name == nameWd).FirstOrDefault();
                var anWea = anWeathComm.Where(item => item.Name == nameWd).FirstOrDefault();

                var iceThick = Math.Max(wea == null ? 0 : wea.IceThickness, anWea == null ? 0 : anWea.IceThickness);

                double rslt = JumpVerWei(JumpStr.Weight, JumpStr.PieceNum, JumpStr.LNum, JumpStr.GoldPieceNum, JumpStr.SuTubleLen, JumpStr.SoftLineLen, JumpStr.JGBNum, iceThick,
                                         JmWireData.Wei, JmWireData.Dia, jgbWei, JmWireData.DevideNum, JumpStr.SuTubleWei, JumpStr.SuTubleDia, out string str);

                int index = LoadList.FindIndex(item => item.GKName == nameWd);
                if (index < 0)
                {
                    LoadList.Add(new LoadThrDe()
                    {
                        GKName        = nameWd,
                        JumpVerWei    = rslt,
                        JumpVerWeiStr = str,
                    });
                }
                else
                {
                    LoadList[index].JumpVerWei    = rslt;
                    LoadList[index].JumpVerWeiStr = str;
                }
            }
        }
Ejemplo n.º 2
0
        public virtual void UpdateLoStr(double secInc, double constrError, double isntallError, double extendPara)
        {
            foreach (var nameWd in WireWorkConditionNames)
            {
                double rslt;
                string str;

                if (nameWd != "安装情况")
                {
                    rslt = LoStr(out str, secInc, WireData.DevideNum, WireData.YLTableXls[nameWd], WireData.Sec, constrError);
                }
                else
                {
                    rslt = LoStr(out str, secInc, WireData.DevideNum, WireData.YLTableXls[nameWd], WireData.Sec, isntallError, extendPara);
                }

                int index = LoadList.FindIndex(item => item.GKName == nameWd);
                if (index < 0)
                {
                    LoadList.Add(new LoadThrDe()
                    {
                        GKName   = nameWd,
                        LoStr    = rslt,
                        LoStrStr = str,
                    });
                }
                else
                {
                    LoadList[index].LoStr    = rslt;
                    LoadList[index].LoStrStr = str;
                }
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Método invocado para iniciar el hilo que carga una entidad
        /// </summary>
        /// <param name="control">El componente que invocó al evento</param>
        /// <param name="saver">El delegado que realiza la carga</param>
        /// <param name="session">La clave de sesión</param>
        /// <param name="loadRelations">Indica si se deben cargar las relaciones de las entidades</param>
        /// <param name="onFinished">método invocado cuando finaliza el proceso</param>
        static public void Load(UserControl1 control, LoadList loader, string session, bool loadRelations, OnFinished onFinished)
        {
            LoaderParameters loaderParams = new LoaderParameters(control, loader, session, loadRelations, onFinished);
            Thread           thread       = new Thread(new ParameterizedThreadStart(DoLoad));

            thread.Start(loaderParams);
        }
Ejemplo n.º 4
0
        public void UpdateVerWei(double weiInc, int numJGB, double weiJGB, int numFZ, double weiFZ)
        {
            foreach (var nameWd in WireWorkConditionNames)
            {
                var    wea      = WireData.WeatherParas.WeathComm.Where(item => item.Name == nameWd).FirstOrDefault();
                double iceThick = wea == null ? 0 : wea.IceThickness;

                var    laod    = LoadList.Where(item => item.GKName == nameWd).FirstOrDefault();
                double verSpan = laod == null ? 0 : laod.VetiSpan;

                double rslt = VerWei(weiInc, WireData.DevideNum, WireData.BzDic[nameWd].VerHezai, verSpan, StrLoad[nameWd].VerLoad, numJGB, weiJGB, weiFZ, iceThick,
                                     numFZ, HangStr.DampLength, WireData.bGrd, out string str);

                int index = LoadList.FindIndex(item => item.GKName == nameWd);
                if (index < 0)
                {
                    LoadList.Add(new LoadThrDe()
                    {
                        GKName    = nameWd,
                        VerWei    = rslt,
                        VerWeiStr = str,
                    });
                }
                else
                {
                    LoadList[index].VerWei    = rslt;
                    LoadList[index].VerWeiStr = str;
                }
            }
        }
Ejemplo n.º 5
0
 protected void SetLoadList(List <Load> loadList)
 {
     LoadList.Clear();
     foreach (Load load in loadList)
     {
         LoadList.Add(load);
     }
 }
Ejemplo n.º 6
0
        public void TestLoadAll()
        {
            var testListList = LoadList.LoadAll();
            var testList     = testListList.Find(list => list.Id == 1);

            Assert.IsNotNull(testListList);
            Assert.IsNotNull(testList);
        }
Ejemplo n.º 7
0
        private void btn_AddInQueue_Click(object sender, EventArgs e)
        {
            if (LoadList == null || !LoadList.Any())
            {
                MessageBox.Show(@"Список файлов пуст");
            }

            _soundQueueConsumer.AddInQueue(LoadList);
        }
 /// <summary>
 /// Constructor de clase.
 /// </summary>
 /// <param name="control">Una referencia al control que contiene este componente.</param>
 /// <param name="manager">El componente que muestra la lista de entidades.</param>
 /// <param name="editor">El componente que permite añadir o modificar una entidad.</param>
 /// <param name="firstElement">El componente que debe enfocarse cuando se muestra el editor.</param>
 /// <param name="loader">Un método para cargar las entidades en un hilo separado.</param>
 /// <param name="saver">Un método para guardar una entidad en un hilo separado.</param>
 /// <param name="remover">Un método para eliminar una entidad en un hilo separado.</param>
 protected ControllerBase(UserControl1 control, FrameworkElement manager, FrameworkElement editor,
                          FrameworkElement firstElement, LoadList loader, SaveEntity saver,
                          RemoveEntity remover)
 {
     this.control      = control;
     this.manager      = manager;
     this.editor       = editor;
     this.firstElement = firstElement;
     this.loader       = loader;
     this.saver        = saver;
     this.remover      = remover;
 }
Ejemplo n.º 9
0
        public override void CheckLoStr(List <LoadThrDe> anLoads, ElecCalsCommRes commPara)
        {
            foreach (var nameWd in WireWorkConditionNames)
            {
                int index = LoadList.FindIndex(item => item.GKName == nameWd);
                if (index < 0)
                {
                    continue;
                }
                double loStr = LoadList[index].LoStr;

                var    loadAn  = anLoads.Where(item => item.GKName == nameWd).FirstOrDefault();
                double loStrAd = loadAn == null ? 0 : loadAn.LoStr;

                if (loStr > loStrAd)
                {
                    LoadList[index].LoStrCheckStr = Math.Round(loStr, 0).ToString();
                }
                else
                {
                    double loStrCheck;
                    if (nameWd == "安装情况")
                    {
                        if (WireData.bGrd == 0)
                        {
                            loStrCheck = Math.Round(loStr / commPara.InstMaxPara / commPara.IndExMaxPara * commPara.InstMinPara * commPara.IndExMinPara, 0);
                        }
                        else
                        {
                            loStrCheck = Math.Round(loStr / commPara.InstMaxPara / commPara.GrdExMaxPara * commPara.InstMinPara * commPara.GrdExMinPara, 0);
                        }
                    }
                    else
                    {
                        loStrCheck = Math.Round(loStr / commPara.BuildMaxPara * commPara.BuildMinPara);
                    }
                    LoadList[index].LoStrCheckStr = Math.Round(loStr, 0).ToString() + "/(" + loStrCheck.ToString() + ")";
                }

                if (nameWd == "断线" || nameWd == "不均匀冰I" || nameWd == "不均匀冰II" || nameWd == "断线(导线+5mm)" || nameWd == "不均匀冰I(导线+5mm)" || nameWd == "不均匀冰II(导线+5mm)")
                {
                    if (loStr > loStrAd)
                    {
                        LoadList[index].LoStrCheck2 = Math.Round(loStr, 0);
                    }
                    else
                    {
                        LoadList[index].LoStrCheck2 = Math.Round(loStr / commPara.BuildMaxPara * commPara.BuildMinPara);
                    }
                }
            }
        }
Ejemplo n.º 10
0
        protected double UnbaIceTensionMax(double secInc, double effectPara, double safePara)
        {
            if (WireData.CommParas.UnbaMaxPara == 1)
            {
                return(Math.Round(secInc * WireData.Fore * effectPara / WireData.CommParas.GraAcc / safePara * WireData.DevideNum, 2));
            }
            else
            {
                var    load  = LoadList.Where(item => item.GKName == "最大覆冰").FirstOrDefault();
                double loStr = load == null ? 0 : load.LoStr;

                var    loadGrdIce  = LoadList.Where(item => item.GKName == "地线覆冰").FirstOrDefault();
                double loStrGrdIce = loadGrdIce == null ? 0 : loadGrdIce.LoStr;

                return(WireData.bGrd == 0 ? loStr : (WireData.CommParas.GrdIceUnbaPara == 1 ? loStr : loStrGrdIce));
            }
        }
Ejemplo n.º 11
0
        protected double BreakTensionMax(double secInc, double effectPara, double safePara)
        {
            if (WireData.CommParas.BreakMaxPara == 1)
            {
                return(Math.Round(secInc * WireData.Fore * effectPara / WireData.CommParas.GraAcc / safePara * WireData.DevideNum, 2));
            }
            else
            {
                var    load  = LoadList.Where(item => item.GKName == "覆冰无风").FirstOrDefault();
                double loStr = load == null ? 0 : load.LoStr;

                var    loadAdd5  = LoadList.Where(item => item.GKName == "覆冰无风+5").FirstOrDefault();
                double loStrAdd5 = loadAdd5 == null ? 0 : loadAdd5.LoStr;

                return(WireData.bGrd == 0 ? loStr : (WireData.CommParas.GrdIceUnbaPara == 1 ? loStr : loStrAdd5));
            }
        }
Ejemplo n.º 12
0
 public override bool TakeLoad(Load load)
 {
     if (base.TakeLoad(load))
     {
         if (load.IsEncoded)
         {
             Random random       = new Random();
             int    randomNumber = random.Next(1, 100);
             if (randomNumber > 10)
             {
                 LoadList.Remove(load);
             }
         }
         return(true);
     }
     return(false);
 }
Ejemplo n.º 13
0
 public virtual bool TakeLoad(Load load)
 {
     if (GetLoadsWeight() + load.Weight > CarryingCapacity)
     {
         return(false);
     }
     else
     {
         if (load is SpoiledLoad)
         {
             double lostCapacity = BatteryCapacity * 0.005;
             BatteryCapacity -= lostCapacity;
         }
         LoadList.Add(load);
         return(true);
     }
 }
Ejemplo n.º 14
0
        /// <summary>
        /// Respond to radio button selection (list filters), displaying the appropriate records.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SelectListItems(object sender, RoutedEventArgs e)
        {
            if (AllRadioButton.IsChecked.HasValue && AllRadioButton.IsChecked.Value)
            {
                LoadList.SelectAll();
            }
            else if (ActiveRadioButton.IsChecked.HasValue && ActiveRadioButton.IsChecked.Value)
            {
                LoadList.SelectedItems.Clear();
                foreach (WorkItemImportListEntry item in LoadList.Items)
                {
                    if (IsConsideredActive(item.Status))
                    {
                        LoadList.SelectedItems.Add(item);
                    }
                }
            }
            else if (ClosedRadioButton.IsChecked.HasValue && ClosedRadioButton.IsChecked.Value)
            {
                LoadList.SelectedItems.Clear();
                foreach (WorkItemImportListEntry item in LoadList.Items)
                {
                    if (IsConsideredActive(item.Status) == false)
                    {
                        LoadList.SelectedItems.Add(item);
                    }
                }
            }
            else if (SelectedOnlyRadioButton.IsChecked.HasValue && SelectedOnlyRadioButton.IsChecked.Value)
            {
                // Do nothing here
            }

            // TODO: This should be in XAML
            if (LoadList.SelectedItems.Count == 0)
            {
                ImportButton.IsEnabled = false;
            }
            else
            {
                ImportButton.IsEnabled = true;
            }
        }
Ejemplo n.º 15
0
 public AddTrussDialog(ProjectTruss projectTrussToEdit, IEnumerable <TypeOfLoad> loadList) : this(loadList)
 {
     UnitForceCheckBox.IsEnabled = false;
     this.Title                  = "Редактировать ферму";
     TextBoxName.IsEnabled       = false;
     FavTruss.Span               = projectTrussToEdit.Truss.Span;
     FavTruss.Slope              = projectTrussToEdit.Truss.Slope;
     FavTruss.PanelAmount        = projectTrussToEdit.Truss.PanelAmount;
     FavTruss.SupportHeight      = projectTrussToEdit.Truss.SupportDepth;
     LoadListCB.SelectedItem     = LoadList.First(x => x.LoadId == projectTrussToEdit.Truss.LoadId);
     UnitForceCheckBox.IsChecked = projectTrussToEdit.Truss.UnitForce;
     NewProjectTruss             = projectTrussToEdit;
     if (projectTrussToEdit.Truss.UnitForce)
     {
         TextBoxSpan.IsEnabled        = false;
         TextBoxSlope.IsEnabled       = false;
         TextBoxHeight.IsEnabled      = false;
         TextBoxPanelAmount.IsEnabled = false;
         LoadListCB.IsEnabled         = false;
     }
 }
        protected double UnbaIceTensionIceCover100()
        {
            LoadThrDe loadItem;

            if (WireData.bGrd == 0)
            {
                loadItem = LoadList.Where(item => item.GKName == "不均匀冰满冰").FirstOrDefault();
            }
            else
            {
                if (WireData.CommParas.GrdIceUnbaPara == 1)
                {
                    loadItem = LoadList.Where(item => item.GKName == "不均匀冰满冰").FirstOrDefault();
                }
                else
                {
                    loadItem = LoadList.Where(item => item.GKName == "不均匀冰满冰(导线+5mm)").FirstOrDefault();
                }
            }
            return(loadItem == null ? 0 : Math.Round(loadItem.LoStr, 0));
        }
Ejemplo n.º 17
0
        /// <summary>
        /// Pulls all the groups/rooms from the bridge
        /// </summary>
        public void ProcRooms(String jsondata)
        {
            try
            {
                JObject jData = JObject.Parse(jsondata);
                HueBridge.HueGroups.Clear();
                foreach (var group in jData)
                {
                    string   load;
                    JArray   LoadList;
                    string[] loads;
                    string   id   = group.Key;
                    string   name = (string)jData[group.Key]["name"];
                    if (jData[group.Key]["lights"].HasValues)
                    {
                        load     = (string)jData[group.Key]["lights"][0];
                        LoadList = (JArray)jData[group.Key]["lights"];
                        loads    = LoadList.ToObject <string[]>();
                    }
                    else
                    {
                        load  = "0";
                        loads = null;
                    }

                    string type  = (string)jData[group.Key]["type"];
                    bool   on    = (bool)jData[group.Key]["action"]["on"];
                    uint   bri   = (uint)jData[group.Key]["action"]["bri"];
                    string alert = (string)jData[group.Key]["action"]["alert"];
                    HueBridge.HueGroups.Add(new HueGroup(id, name, type, on, bri, alert, load, loads));
                }
                GroupNum = (ushort)HueBridge.HueGroups.Count;
                CrestronConsole.PrintLine("{0} Rooms discovered", GroupNum);
                HueBridge.GetBridgeInfo("scenes");
            }
            catch (Exception e)
            {
                CrestronConsole.PrintLine("Error getting rooms: {0}", e);
            }
        }
        public override void UpdateHorFor(double diaInc)
        {
            foreach (var nameWd in WireWorkConditionNames)
            {
                double rslt = HorFor(diaInc, WireData.DevideNum, SpaceStr.HorSpan, HangStr.DampLength, WireData.BzDic[nameWd].WindHezai, StrLoad[nameWd].WindLoad, out string str);

                int index = LoadList.FindIndex(item => item.GKName == nameWd);
                if (index < 0)
                {
                    LoadList.Add(new LoadThrDe()
                    {
                        GKName    = nameWd,
                        HorFor    = rslt,
                        HorForStr = str,
                    });
                }
                else
                {
                    LoadList[index].HorFor    = rslt;
                    LoadList[index].HorForStr = str;
                }
            }
        }
Ejemplo n.º 19
0
        public void UpdateJumpHorFor()
        {
            foreach (var nameWd in WireWorkConditionNames)
            {
                double rslt = JumpHorFor(JumpStrLoad[nameWd].JumpStrWindLoad, JumpStrLoad[nameWd].JumpWindLoad, JumpStrLoad[nameWd].SuTubleWindLoad, JmWireData.DevideNum, out string str);

                int index = LoadList.FindIndex(item => item.GKName == nameWd);
                if (index < 0)
                {
                    LoadList.Add(new LoadThrDe()
                    {
                        GKName        = nameWd,
                        JumpHorFor    = rslt,
                        JumpHorForStr = str,
                    });
                }
                else
                {
                    LoadList[index].JumpHorFor    = rslt;
                    LoadList[index].JumpHorForStr = str;
                }
            }
        }
Ejemplo n.º 20
0
        /// <summary>
        /// 计算垂直档距
        /// </summary>
        ///
        public void UpdateVertialSpan()
        {
            foreach (var nameWd in WireWorkConditionNames)
            {
                //这儿比载excel中用的是孤立档应力,用的是普通档应力
                double rslt = VerticalSpan(SpaceStr.Span, SpaceStr.SubHei, WireData.YLTableXls[nameWd], WireData.BzDic[nameWd].BiZai, out string str);

                int index = LoadList.FindIndex(item => item.GKName == nameWd);
                if (index < 0)
                {
                    LoadList.Add(new LoadThrDe()
                    {
                        GKName      = nameWd,
                        VetiSpan    = rslt,
                        VetiSpanStr = str,
                    });
                }
                else
                {
                    LoadList[index].VetiSpan    = rslt;
                    LoadList[index].VetiSpanStr = str;
                }
            }
        }
Ejemplo n.º 21
0
 public void LoadInformation()
 {
     ListOfLoads = new LoadList();
 }
Ejemplo n.º 22
0
 private void MainView_Load(object sender, EventArgs e)
 {
     LoadList?.Invoke(sender, e);
 }
Ejemplo n.º 23
0
 /// <summary>
 /// Creates an instance of the class.
 /// </summary>
 public Step()
 {
     m_loads = new LoadList(this);
 }