Exemplo n.º 1
0
 private void RemoveNozzle(NozzleControl n)
 {
     if (n.NozzleID != 1)
     {
         Nozzles.Remove(n);
     }
 }
Exemplo n.º 2
0
        private void AddNewNozzle()
        {
            NozzleControl n = new NozzleControl
            {
                NozzleID = _nozzles.Count + 1
            };

            if (n.NozzleID == 1)
            {
                n.NozzleOrificeID = Constants._defaultOrificeID;
                n.NozzleSpacing   = 0;
                n.NozzleToYankee  = Constants._defaultNozzletoYankee;
                n.SprayRotation   = Constants._defaultNozzlerotation;
                n.SprayAngle      = Constants._defaultNozzleAngle;
                n.NozzlePressure  = Constants._operatingpressure;
                n.NozzleTypeName  = Constants.StandardNozzle;
                n.NozzleTypes     = NozzleTypes;
            }
            else
            {
                n.NozzleOrificeID = Nozzles[n.NozzleID - 2].NozzleOrificeID;
                if (n.NozzleID > 2)
                {
                    n.NozzleSpacing = Nozzles[n.NozzleID - 2].NozzleSpacing;
                }
                else
                {
                    n.NozzleSpacing = Constants._defaultNozzleSpacing;
                }
                n.NozzleToYankee = Nozzles[n.NozzleID - 2].NozzleToYankee;

                n.SprayRotation  = Nozzles[n.NozzleID - 2].SprayRotation;
                n.SprayAngle     = Nozzles[n.NozzleID - 2].SprayAngle;
                n.NozzlePressure = Nozzles[0].NozzlePressure;
                n.NozzleTypeName = Nozzles[n.NozzleID - 2].NozzleTypeName;
                n.NozzleTypes    = NozzleTypes;
                n.BoomTop        = MaximumNozzleToYankee + Constants._nozzleheight + 20;
            }
            Nozzles.Add(n);

            if (Nozzles.Count > 1)
            {
                Nozzles[Nozzles.Count - 1].NozzleToYankee = MaximumNozzleToYankee;
            }
        }
Exemplo n.º 3
0
//update this for custom nozzles
        private int CalcNozzleLeft(NozzleControl n)
        {
            if (n.NozzleID == 1)
            {
                if (n.NozzleTypeName.Equals(Constants.StandardNozzle))
                {
                    return(Convert.ToInt32((n.NozzleSprayWidth - Constants._nozzlewidth) / 2));
                }
                else
                if (n.NozzleTypeName.Equals(Constants.AsymmetricLeftNozzle) || n.NozzleTypeName.Equals(Constants.AsymmetricRightNozzle))
                {
                    return(Convert.ToInt32((n.NozzleSprayWidth - Constants._nozzlewidth / 2)));
                }
                else
                {
                    //custom nozzle
                    return(Convert.ToInt32((n.NozzleSprayWidth - Constants._nozzlewidth) / 2));
                }
            }
            return(n.NozzleSpacing);
        }
Exemplo n.º 4
0
        private void OpenSelectedShowerFile(string _filename)
        {
            if (!string.IsNullOrEmpty(_filename) && File.Exists(_filename))
            {
                try
                {
                    Shower _shower = DeSerializeShower(_filename);
                    if (_shower != null)
                    {
                        YankeeSpeed       = _shower.YankeeSpeed;
                        YankeeWidth       = _shower.YankeeWidth;
                        YankeeDiameter    = _shower.YankeeDiameter;
                        DwellDistance     = _shower.DwellDistance;
                        OperatingPressure = _shower.OperatingPressure;
                        ShowerTemperature = _shower.ShowerTemperature;
                        CoverageColour    = _shower.CoverageColour;
                        Nozzles.Clear();
                        int ctr = 0;

                        NozzleControl nc;

                        foreach (SerializedNozzle _sernozzle in _shower.Nozzles)
                        {
                            ctr++;
                            nc = new NozzleControl
                            {
                                NozzleID          = ctr,
                                NozzleOrificeID   = _sernozzle.NozzleOrificeID,
                                NozzleSpacing     = _sernozzle.NozzleSpacing,
                                NozzleToYankee    = _sernozzle.NozzleToYankee,
                                SprayRotation     = _sernozzle.SprayRotation,
                                SprayAngle        = _sernozzle.SprayAngle,
                                NozzlePressure    = _sernozzle.NozzlePressure,
                                NozzleTypeName    = _sernozzle.NozzleTypeName,
                                NozzleSprayWidth  = _sernozzle.NozzleSprayWidth,
                                MaximumSprayAngle = _sernozzle.MaximumSprayAngle,
                                NozzleFlow        = _sernozzle.NozzleFlow,
                                SprayPattern      = _sernozzle.SprayPattern,
                                NozzleTypes       = NozzleTypes
                            };
                            Nozzles.Add(nc);
                        }
                        NumberNozzles = ctr;
                        MenuItems     = MRUList.AddFile(MenuItems, _filename, OpenShowerFile);
                    }
                    else
                    {
                        //MenuItems = MRUList.RemoveFile(MenuItems, _filename);
                        MessageBox.Show("The shower file appears to be corrupted and cannot be loaded.", "Unable to load shower file", MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK);
                    }
                }
                catch
                {
                    //MenuItems = MRUList.RemoveFile(MenuItems, _filename);
                    MessageBox.Show("The shower file appears to be corrupted and cannot be loaded.", "Unable to load shower file", MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK);
                }
            }
            else
            {
                MenuItems = MRUList.RemoveFile(MenuItems, _filename);
            }
        }