示例#1
0
 public abayModel(string locationID = "abay") : base(locationID)
 {
     Skip1      = new Mine_skip(locationID);
     Skip2      = new Mine_skip(locationID);
     BeltPos1   = new Mine_konv(locationID);
     BeltPos9   = new Mine_konv(locationID);
     BeltBoiler = new Mine_konv(locationID);
     Sklad      = new Mine_sklad(locationID);
     Vagon      = new Mine_vagon(locationID);
     Crusher    = new Mine_crusher(locationID);
     RockUtil   = new Mine_rockUtil(locationID);
     Kotel      = new Mine_Kotel(locationID);
 }
示例#2
0
 public sar1Model(string locationID = "sar1") : base(locationID)
 {
     Skip1        = new Mine_skip(locationID);
     Skip2        = new Mine_skip(locationID);
     BeltToVagon1 = new Mine_konv(locationID);
     BeltToVagon2 = new Mine_konv(locationID);
     BeltToBoiler = new Mine_konv(locationID);
     Sklad        = new Mine_sklad(locationID);
     Vagon        = new Mine_vagon(locationID);
     Crusher      = new Mine_crusher(locationID);
     RockUtil     = new Mine_rockUtil(locationID);
     Kotel        = new Mine_Kotel(locationID);
 }
示例#3
0
 public sar3Model(string locationID = "sar3") : base(locationID)
 {
     Skip            = new Mine_skip(locationID);
     BeltToTech1     = new Mine_konv(locationID);
     BeltToTech2     = new Mine_konv(locationID);
     BeltToBoiler    = new Mine_konv(locationID);
     Sklad           = new Mine_sklad(locationID);
     VagonObogatitel = new Mine_vagon(locationID);
     VagonSaburkhan  = new Mine_vagon(locationID);
     Crusher         = new Mine_crusher(locationID);
     RockUtil        = new Mine_rockUtil(locationID);
     Kotel           = new Mine_Kotel(locationID);
 }
示例#4
0
        /// <summary>
        /// Скиповой подьем
        /// </summary>
        /// <param name="skipID"></param>
        /// <returns></returns>
        public Mine_skip GetSkipModel(int skipID)
        {
            var skip = _cdbService.FindEquipmentById <Skip>(skipID);

            if (skip == null)
            {
                return(new Mine_skip("Unknown"));
            }

            var model = new Mine_skip(skip.LocationID);

            model.SkipID   = skipID;
            model.SkipName = GetEquipNameOnCurrentLanguate(skip);
            model.MineName = GetLocationNameOnCurrentLanguate(skip.LocationID);

            model.SkipTransfers             = _cdbService.GetTransfersFirst <SkipTransfer>(skipID, fromDate, toDate).AsEnumerable();//
            model.TotalSkipsPerTimeInterval = model.SkipTransfers.Sum(s => int.Parse(s.LiftingID));


            model.TotalTonnsPerTimeInterval = model.SkipTransfers.Select(t => t.SkipWeight * int.Parse(t.LiftingID)).Sum();
            model.LastSkipLiftingTime       = model.SkipTransfers.Any() ? model.SkipTransfers.First().TransferTimeStamp : new DateTime?();

            var fromShiftDate = _cdbService.GetStartShiftTime(skip.LocationID);
            var toShiftDate   = _cdbService.GetEndShiftTime(skip.LocationID, fromShiftDate);

            var shiftskiptransfers = _cdbService.GetTransfersFirst <SkipTransfer>(skipID, fromShiftDate, toShiftDate).Select(t => new
            {
                LiftingID    = t.LiftingID,
                SkipWeight   = t.SkipWeight,
                OperatorName = t.OperatorName
            }).AsEnumerable();

            model.TotalSkipsPerThisShift = shiftskiptransfers.Sum(s => int.Parse(s.LiftingID));
            model.TotalTonnsPerThisShift = shiftskiptransfers.Select(t => t.SkipWeight * int.Parse(t.LiftingID)).Sum();

            model.HasManualValues = model
                                    .SkipTransfers
                                    .Where(v => v.OperatorName != ProjectConstants.SystemPlarformOperatorName)
                                    .Any()
                                    ||
                                    shiftskiptransfers
                                    .Where(v => v.OperatorName != ProjectConstants.SystemPlarformOperatorName)
                                    .Any();
            return(model);
        }