// GET: Fund/Delete/5
        public ActionResult Delete(int id)
        {
            GLS gl = data.GLS.Find(id);

            if (gl == null)
            {
                return(HttpNotFound());
            }
            return(View(gl));
        }
 public ActionResult Create([Bind(Include = "GLID,GL")] GLS gls)
 {
     try
     {
         data.GLS.Add(gls);
         data.SaveChanges();
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
 public ActionResult Delete(int id, FormCollection collection)
 {
     try
     {
         GLS gl = data.GLS.Find(id);
         data.GLS.Remove(gl);
         data.SaveChanges();
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
Example #4
0
        public override void OnUpdate()
        {
            base.OnUpdate();
            double dElectric_Draw = 10.0 * dW_to_EC;
            double elecAvail      = part.RequestResource("ElectricCharge", dElectric_Draw) / dElectric_Draw;
            bool   bPowered       = (elecAvail > 0.90);

            dIndicated_Deviation = -10.0;
            sStation_ID          = "---";

            if (bPowered)
            {
                cNav_Select = null;
                foreach (Part p in vessel.Parts)
                {
                    //string sMsg1 = "VI: " + p.name;
                    //print(sMsg1);
                    foreach (PartModule m in p.Modules)
                    {
                        //string sMsg2 = "VIm: " + m.name;
                        //print(sMsg2);
                        VHF_NAV_Receiver cNav = m as VHF_NAV_Receiver;
                        if (cNav != null)
                        {
                            cNav_Select = cNav;
                        }
                    }
                }
                if (cNav_Select != null)
                {
                    //string sMsg = "GLS indicator found receiver " + cNav_Select.moduleName;
                    //print(sMsg);
                    GLS cGLS = cNav_Select.getTunedGLS();
                    if (cGLS != null)
                    {
                        dIndicated_Deviation = cGLS.getOffset(cNav_Select.getPosition());
                        sStation_ID          = cGLS.sStation_ID;
                    }
                    else
                    {
                        sStation_ID = "---";
                    }
                }
                else
                {
                    sStation_ID = "---";
                }
            }
        }
Example #5
0
 private void initialize()
 {
     if (cGLS == null)
     {
         cGLS = new GLS();
         cGLS.iStation_ID_Characters    = new int[3];
         cGLS.iStation_ID_Characters[0] = 10; // K
         cGLS.iStation_ID_Characters[1] = 18; // S
         cGLS.iStation_ID_Characters[2] = 15; // P
         cGLS.buildStationID();
         sStation_ID = cGLS.sStation_ID;
     }
     if (cNav_Master == null)
     {
         cNav_Master = new NAVmaster();
     }
 }
Example #6
0
        public double Sumuj(Zamowienie zamowienie)
        {
            IKosztyWysylki kurier = null;

            switch (zamowienie.RodzajTransportu)
            {
            case Przewoznik.DHL:
                kurier = new DHL();
                break;

            case Przewoznik.GLS:
                kurier = new GLS();
                break;

            case Przewoznik.UPC:
                kurier = new UPC();
                break;
            }

            return(kurier.obliczKosztPrzesylki(zamowienie));
        }
Example #7
0
        public override void OnUpdate()
        {
            initialize();

            string ResName = "ElectricCharge";

            double dPowerRequired = 10.0 * dW_to_EC; // 10 W is typical receive power for NAV radio

            double dElectric_Draw = dPowerRequired * TimeWarp.deltaTime;
            double elecAvail      = 0.0;

            if (bOn)
            {
                elecAvail = part.RequestResource(ResName, dElectric_Draw) / dElectric_Draw;
            }
            bPowered = (elecAvail > 0.90);

            if (cRecv.vPosition.updatePositionData(vessel.mainBody, vessel.latitude, vessel.longitude, vessel.altitude))
            {
                cNav_Master.updateReceiver(iReceiver_ID, cRecv);
            }

            //string sMsg = "Recv freq " + cRecv.getFrequency().ToString("000.00");
            //print(sMsg);
            cNav_Master.onReceiverUpdate();
            if (bPowered)
            {
                if (cRecv.isActiveILS())
                {
                    cTuned_GLS = cNav_Master.getStationGLS(iReceiver_ID) as GLS;
                    cTuned_LOC = cNav_Master.getStationLOC(iReceiver_ID) as LOC;
                    cTuned_VOR = null;
                }
                else
                {
                    cTuned_VOR = cNav_Master.getStationVOR(iReceiver_ID) as VOR;
                    cTuned_GLS = null;
                    cTuned_LOC = null;
                }
                cTuned_DME = cNav_Master.getStationDME(iReceiver_ID) as DME;
            }
            else
            {
                cTuned_VOR = null;
                cTuned_LOC = null;
                cTuned_DME = null;
                cTuned_GLS = null;
            }
            if (cTuned_VOR != null)
            {
                if (cTuned_VOR.getFlux(cRecv.vPosition) < 2.0e-9 || !cTuned_VOR.inLineOfSight(cRecv.vPosition))
                {
                    cTuned_VOR = null;
                }
            }
            if (cTuned_LOC != null)
            {
                if (cTuned_LOC.getFlux(cRecv.vPosition) < 2.0e-9 || !cTuned_LOC.inLineOfSight(cRecv.vPosition))
                {
                    cTuned_LOC = null;
                }
            }
            if (cTuned_DME != null)
            {
                if (cTuned_DME.getFlux(cRecv.vPosition) < 2.0e-9 || !cTuned_DME.inLineOfSight(cRecv.vPosition))
                {
                    cTuned_DME = null;
                }
            }
            if (cTuned_GLS != null)
            {
                if (cTuned_GLS.getFlux(cRecv.vPosition) > 2.0e-9 || !cTuned_GLS.inLineOfSight(cRecv.vPosition))
                {
                    cTuned_GLS = null;
                }
            }

            if (cTuned_VOR != null)
            {
                sTuned_Station = cTuned_VOR.sStation_ID;
            }
            else if (cTuned_LOC != null)
            {
                sTuned_Station = cTuned_LOC.sStation_ID;
            }
            else if (cTuned_DME != null)
            {
                sTuned_Station = cTuned_LOC.sStation_ID;
            }
            else if (cTuned_GLS != null)
            {
                sTuned_Station = cTuned_GLS.sStation_ID;
            }
            else
            {
                sTuned_Station = "---";
            }
        }