Ejemplo n.º 1
0
        public void Load(SettingsXml xml, string section)
        {
            HGAProduct.Clear();
            int  pid = 0;
            bool end = false;

            while (!end)
            {
                pid++;
                var pidname = string.Format("PID{0}", pid.ToString());
                xml.OpenSection(section);
                var name = xml.Read(pidname + "/ProductName", string.Empty);

                if (name != String.Empty)
                {
                    HGAProductType GetPid = new HGAProductType(name);
                    GetPid.ConversionBoardID = xml.Read(pidname + "/ConversionBoardID", 0);
                    GetPid.HGATailType       = (HGAProductTailType)Enum.Parse(typeof(HGAProductTailType),
                                                                              xml.Read(pidname + "/HGAProductTailType", HGAProductTailType.Unknown.ToString()));
                    GetPid.TestProbeType    = xml.Read(pidname + "/TestProbeType", String.Empty);
                    GetPid.RecipeGlobalPath = xml.Read(pidname + "/GlobalPath", String.Empty);
                    HGAProduct.Add(GetPid);
                }
                else
                {
                    end = true;
                }
            }

            xml.CloseSection();
        }
 public void Load(string section, SettingsXml xml)
 {
     xml.OpenSection(section + "/Sort" + SortName);
     MinSpec = xml.Read("MinSpec", 0.00);
     MaxSpec = xml.Read("MaxSpec", 0.00);
     xml.CloseSection();
 }
 public void Load(string section, SettingsXml xml)
 {
     xml.OpenSection(section + "/DetectCondition" + Name);
     RowTopic = xml.Read("RowTopic", string.Empty);
     ColTopic = xml.Read("ColTopic", string.Empty);
     xml.CloseSection();
 }
Ejemplo n.º 4
0
        // Event handlers ------------------------------------------------------

        // Internal methods ----------------------------------------------------

        private void Load(string name, FormPosition pos)
        {
            _xml.OpenSection(name);
            pos.X           = _xml.Read("X", FormPosition.Undefined);
            pos.Y           = _xml.Read("Y", FormPosition.Undefined);
            pos.Width       = _xml.Read("Width", FormPosition.Undefined);
            pos.Height      = _xml.Read("Height", FormPosition.Undefined);
            pos.WindowState = _xml.Read("WindowState", FormPosition.Undefined);
            _xml.CloseSection();
        }
Ejemplo n.º 5
0
        public void Load(string section, SettingsXml xml)
        {
            xml.OpenSection(section + "/" + _name);
            _exposure           = xml.Read("Exposure", 40.0);
            _brightness         = xml.Read("Brightness", 0.5);
            _contrast           = xml.Read("Contrast", 0.5);
            _ringLightIntensity = xml.Read("RingLightIntensity", 0.0);
            _thruLightIntensity = xml.Read("ThruLightIntensity", 0.0);
            xml.CloseSection();

            _imageGraphics.Load(section + "/" + _name, xml);
        }
 public void Load()
 {
     xml.OpenSection("Counter");
     if (!int.TryParse(xml.Read("InputEEDycemCleaningCount", "0"), out inputEEDycemCleaningCount))
     {
         inputEEDycemCleaningCount = 0;
     }
     if (!int.TryParse(xml.Read("OutputEEDycemCleaningCount", "0"), out outputEEDycemCleaningCount))
     {
         outputEEDycemCleaningCount = 0;
     }
     if (!DateTime.TryParse(xml.Read("StartDateTime", DateTime.Now.ToString()), out startDateTime))
     {
         startDateTime = DateTime.Now;
     }
     xml.CloseSection();
 }
Ejemplo n.º 7
0
 public void Load(string section, SettingsXml xml)
 {
     xml.OpenSection(section);
     LastCheckByHourActive       = xml.Read("LastCheckByHourActive", DateTime.Now.ToString());
     LastCheckByPartCountActive  = xml.Read("LastCheckByPartCountActive", 1);
     EnabledResistanceCheck      = xml.Read("EnabledResistanceCheck", false);
     OverallTestResult           = xml.Read("OverallTestResult", false);
     CheckByHourCounter          = xml.Read("CheckByHourCounter", 0.0);
     CheckByPartCounter          = xml.Read("CheckByPartCounter", 0);
     ResistanceCriticalActivated = xml.Read("ResistanceCriticalActivated", false);
     IsRetestProcessRequired     = xml.Read("IsRetestProcessRequired", false);
     CheckType = (ResistanceCheckType)Enum.Parse(typeof(ResistanceCheckType), xml.Read("Type", ResistanceCheckType.Unknown.ToString()));
     xml.CloseSection();
 }
        public void Load()
        {
            LoadUsers();

            string COMPortSettingsFilePath = string.Format("{0}BenchTestTool.config", CommonFunctions.Instance.COMPortSettingsFileDirectory);

            _xml = new SettingsXml(COMPortSettingsFilePath);
            _xml.OpenSection("TestProbe");
            TestProbe.COMPort  = (COMPortList)Enum.Parse(typeof(COMPortList), _xml.Read("COMPort", COMPortList.Unknown.ToString()));
            TestProbe.BaudRate = int.Parse(_xml.Read("BaudRate", "19200"));
            TestProbe.Parity   = (Parity)Enum.Parse(typeof(Parity), _xml.Read("Parity", Parity.None.ToString()));
            TestProbe.DataBits = int.Parse(_xml.Read("DataBits", "8"));
            TestProbe.StopBits = (StopBits)Enum.Parse(typeof(StopBits), _xml.Read("StopBits", StopBits.One.ToString()));
            _xml.CloseSection();

            if (OnSettingsChanged != null)
            {
                OnSettingsChanged(this, null);
            }
        }
Ejemplo n.º 9
0
        public static void LoadHelper(string section, SettingsXml xml, object obj)
        {
            xml.OpenSection(section);
            foreach (PropertyInfo pi in obj.GetType().GetProperties())
            {
                // Loop through all properties and save them into config.
                if (pi.PropertyType == typeof(String))
                {
                    pi.SetValue(obj, xml.Read(pi.Name, (String)pi.GetValue(obj, null)), null);
                }

                if (pi.PropertyType == typeof(Int32))
                {
                    pi.SetValue(obj, xml.Read(pi.Name, (Int32)pi.GetValue(obj, null)), null);
                }

                if (pi.PropertyType == typeof(Double))
                {
                    pi.SetValue(obj, xml.Read(pi.Name, (Double)pi.GetValue(obj, null)), null);
                }

                if (pi.PropertyType == typeof(Boolean))
                {
                    pi.SetValue(obj, xml.Read(pi.Name, (Boolean)pi.GetValue(obj, null)), null);
                }

                if (pi.PropertyType == typeof(MoveProfileBase) && pi.CanWrite)
                {
                    MoveProfileBase mp = new MoveProfileBase();

                    mp.Acceleration = xml.Read(pi.Name + "/" + "Acceleration", 1000);
                    mp.Deceleration = xml.Read(pi.Name + "/" + "Deceleration", 1000);
                    mp.Velocity     = xml.Read(pi.Name + "/" + "Velocity", 50);
                    pi.SetValue(obj, mp, null);
                }
            }
            xml.CloseSection();
        }
        public void Load()
        {
            if (HSTMachine.Workcell.HSTSettings.CalibrationSettingsFilePath == null)
            {
                return;
            }

            if (!File.Exists(HSTMachine.Workcell.HSTSettings.CalibrationSettingsFilePath))
            {
                File.Create(HSTMachine.Workcell.HSTSettings.CalibrationSettingsFilePath).Dispose();
                return;
            }

            _xml = new SettingsXml(HSTMachine.Workcell.HSTSettings.CalibrationSettingsFilePath);
            _xml.OpenSection("Config");

            foreach (PropertyInfo pi in this.GetType().GetProperties())
            {
                if (!pi.CanWrite) // Avoid putting data to read only property such as IsAutoRecipe
                {
                    continue;
                }

                // Loop through all properties and save them into config.
                if (pi.PropertyType == typeof(String))
                {
                    pi.SetValue(this, _xml.Read(pi.Name, (String)pi.GetValue(this, null)), null);
                }

                if (pi.PropertyType == typeof(Int32))
                {
                    pi.SetValue(this, _xml.Read(pi.Name, (Int32)pi.GetValue(this, null)), null);
                }

                if (pi.PropertyType == typeof(Double))
                {
                    pi.SetValue(this, _xml.Read(pi.Name, (Double)pi.GetValue(this, null)), null);
                }

                if (pi.PropertyType == typeof(Boolean))
                {
                    pi.SetValue(this, _xml.Read(pi.Name, (Boolean)pi.GetValue(this, null)), null);
                }

                if (pi.PropertyType.IsEnum == true)
                {
                    pi.SetValue(this, _xml.Read(pi.Name, (int)pi.GetValue(this, null)), null);
                }
            }
            _xml.CloseSection();

            _xml.OpenSection("RFID");
            RFID.RFIDCOMPort  = (COMPortList)Enum.Parse(typeof(COMPortList), _xml.Read("RFIDCOMPort", COMPortList.Unknown.ToString()));
            RFID.RFIDBaudRate = int.Parse(_xml.Read("RFIDBaudRate", "0"));
            RFID.RFIDParity   = (Parity)Enum.Parse(typeof(Parity), _xml.Read("RFIDParity", Parity.None.ToString()));
            RFID.RFIDDataBits = int.Parse(_xml.Read("RFIDDataBits", "0"));
            RFID.RFIDStopBits = (StopBits)Enum.Parse(typeof(StopBits), _xml.Read("RFIDStopBits", StopBits.One.ToString()));

            RFID.RfidWriteCounterLimit = int.Parse(_xml.Read("RfidWriteCounterLimit", "0"));
            _xml.CloseSection();

            _xml.OpenSection("MeasurementTest");
            MeasurementTest.COMPort  = (COMPortList)Enum.Parse(typeof(COMPortList), _xml.Read("COMPort", COMPortList.Unknown.ToString()));
            MeasurementTest.BaudRate = int.Parse(_xml.Read("BaudRate", "19200"));
            MeasurementTest.Parity   = (Parity)Enum.Parse(typeof(Parity), _xml.Read("Parity", Parity.None.ToString()));
            MeasurementTest.DataBits = int.Parse(_xml.Read("DataBits", "8"));
            MeasurementTest.StopBits = (StopBits)Enum.Parse(typeof(StopBits), _xml.Read("StopBits", StopBits.One.ToString()));

            MeasurementTest.CurrentInstalledTestProbeType = _xml.Read("CurrentInstalledTestProbeType", CommonFunctions.UNKNOWN);
            MeasurementTest.TestProbeTypes.Clear();

            for (int i = 0; ; i++)
            {
                string        CurrentTestProbe = "TestProbe" + i;
                TestProbeType TestProbeType    = new TestProbeType(_xml.Read(CurrentTestProbe + "TestProbeName", CommonFunctions.UNKNOWN));
                if (String.Compare(TestProbeType.Name, CommonFunctions.UNKNOWN, true) != 0)
                {
                    MeasurementTest.TestProbeTypes.Add(TestProbeType);
                }
                else
                {
                    break;
                }
            }
            _xml.CloseSection();

            _xml.OpenSection("Camera");
            Vision.InputCamera.Recipe                    = _xml.Read("InputCamera_Recipe", CommonFunctions.UNKNOWN);
            Vision.InputCamera.ImagesOutputPath          = _xml.Read("InputCamera_ImagesOutputPath", CommonFunctions.UNKNOWN);
            Vision.InputCamera.SaveAllImages             = (bool)_xml.Read("InputCamera_SaveAllImages", Convert.ToBoolean(false));
            Vision.InputCamera.SaveImagesLessThanTenHGAs = (bool)_xml.Read("InputCamera_SaveImagesLessThanTenHGAs", Convert.ToBoolean(false));
            Vision.InputCamera.CameraSerialNumber        = _xml.Read("InputCamera_SerialNumber", CommonFunctions.UNKNOWN);
            Vision.InputCamera.TotalDayToStoreImage      = _xml.Read("Input_TotalDayToStoreImage", 7);
            if (Vision.InputCamera.TotalDayToStoreImage == 0)
            {
                Vision.InputCamera.TotalDayToStoreImage = 7;
            }

            Vision.OutputCamera.Recipe                    = _xml.Read("OutputCamera_Recipe", CommonFunctions.UNKNOWN);
            Vision.OutputCamera.ImagesOutputPath          = _xml.Read("OutputCamera_ImagesOutputPath", CommonFunctions.UNKNOWN);
            Vision.OutputCamera.SaveAllImages             = (bool)_xml.Read("OutputCamera_SaveAllImages", Convert.ToBoolean(false));
            Vision.OutputCamera.SaveImagesLessThanTenHGAs = (bool)_xml.Read("OutputCamera_SaveImagesLessThanTenHGAs", Convert.ToBoolean(false));
            Vision.OutputCamera.CameraSerialNumber        = _xml.Read("OutputCamera_SerialNumber", CommonFunctions.UNKNOWN);
            Vision.OutputCamera.TotalDayToStoreImage      = _xml.Read("Output_TotalDayToStoreImage", 7);

            if (Vision.OutputCamera.TotalDayToStoreImage == 0)
            {
                Vision.OutputCamera.TotalDayToStoreImage = 7;
            }
            _xml.CloseSection();

            _xml.OpenSection("SafetyController");
            SafetyController.COMPort  = (COMPortList)Enum.Parse(typeof(COMPortList), _xml.Read("COMPort", COMPortList.Unknown.ToString()));
            SafetyController.BaudRate = int.Parse(_xml.Read("BaudRate", "19200"));
            SafetyController.Parity   = (Parity)Enum.Parse(typeof(Parity), _xml.Read("Parity", Parity.None.ToString()));
            SafetyController.DataBits = int.Parse(_xml.Read("DataBits", "8"));
            SafetyController.StopBits = (StopBits)Enum.Parse(typeof(StopBits), _xml.Read("StopBits", StopBits.One.ToString()));
            _xml.CloseSection();

            _rfidPortSettings.PortName = "" + RFID.RFIDCOMPort;
            _rfidPortSettings.BaudRate = RFID.RFIDBaudRate;
            _rfidPortSettings.Parity   = RFID.RFIDParity;
            _rfidPortSettings.DataBits = RFID.RFIDDataBits;
            _rfidPortSettings.StopBits = RFID.RFIDStopBits;

            _rfidWriteCounterLimit = RFID.RfidWriteCounterLimit;

            _safetyControllerPortSettings.PortName = "" + SafetyController.COMPort;
            _safetyControllerPortSettings.BaudRate = SafetyController.BaudRate;
            _safetyControllerPortSettings.Parity   = SafetyController.Parity;
            _safetyControllerPortSettings.DataBits = SafetyController.DataBits;
            _safetyControllerPortSettings.StopBits = SafetyController.StopBits;


            if (OnSettingsChanged != null)
            {
                OnSettingsChanged(this, null);
            }
        }
Ejemplo n.º 11
0
 public void Load(string section, SettingsXml xml)
 {
     xml.OpenSection(section);
     TriggerByCarrierEnabled          = xml.Read("TrigerByCarrierEnable", false);
     TrigerByCarrierCount             = xml.Read("TrigerByCarrierCount", 1);
     TriggerByCarrierHour             = xml.Read("TriggerByCarrierHour", 0);
     FailurePhase1Min                 = xml.Read("FailurePhase1Min", 0.0);
     FailurePhase2Min                 = xml.Read("FailurePhase2Min", 0.0);
     PerCarrierCounter                = xml.Read("PerCarrierCounter", 0);
     PerHourCounter                   = xml.Read("PerHourCounter", 0);
     TotalCarrierForBuyOff            = xml.Read("TotalCarrierForBuyOff", 1);
     TriggerByErrorCodeEnabled        = xml.Read("TriggerByErrorCodeEnabled", false);
     TriggerByErrorCodePercent        = xml.Read("TriggerByErrorCodePercent", 0.0);
     TriggerByErrorCodePartRunCounter = xml.Read("TriggerByErrorCodePartRunCounter", 0);
     TriggerByErrorCodeFailureCounter = xml.Read("TriggerByErrorCodeFailureCounter", 0);
     ErrorCodeTriggeringActivate      = xml.Read("ErrorCodeTriggeringActivate", false);
     TriggerByErrorCodePartPerPeriod  = xml.Read("TriggerByErrorCodePartPerPeriod", 0);
     DoubleTestDelayMillisec          = xml.Read("DoubleTestDelayTime", 400);
     xml.CloseSection();
 }
Ejemplo n.º 12
0
 public void Load(string section, SettingsXml xml)
 {
     xml.OpenSection(section);
     Enabled                        = xml.Read("Enabled", Enabled);
     EnableAlertMsg                 = xml.Read("EnableAlertMag", EnableAlertMsg);
     YeildTarget                    = xml.Read("YeildTarget", 0.00);
     YeildLimit                     = xml.Read("YeildLimit", 0.00);
     Alpha                          = xml.Read("Alpha", 0.00);
     DefectCounterLimit             = xml.Read("DefectCounterLimit", 0);
     TestRunGroup                   = xml.Read("TestRunGroup", 0);
     TimeToIgnoreAfterRepair        = xml.Read("TimeToIgnoreAfterRepair", 0);
     PartCounterYieldPerShortPeriod = xml.Read("PartCounterYieldPerShortPeriod", 100);
     PartCounterYieldPerLongPeriod  = xml.Read("PartCounterYieldPerLongPeriod", 100);
     DelayForReleaseCarrier         = xml.Read("DelayForReleaseCarrier", 0.0);
     xml.CloseSection();
 }
Ejemplo n.º 13
0
        public void LoadConfigurationSetupRecipe()
        {
            string ConfigurationSetupRecipeFilePath = string.Format("{0}ConfigurationSetupRecipe.rcp", RecipeFileDirectory);

            if (!Directory.Exists(RecipeFileDirectory))
            {
                Directory.CreateDirectory(RecipeFileDirectory);
            }

            if (!File.Exists(ConfigurationSetupRecipeFilePath))
            {
                File.Create(ConfigurationSetupRecipeFilePath).Dispose();
                return;
            }
            else
            {
                Log.Info("Startup", "Retrieving recipe for configuration & setup from {0}.", ConfigurationSetupRecipeFilePath);

                SettingsXml _xml = new SettingsXml(ConfigurationSetupRecipeFilePath);

                _xml.OpenSection("Resistance");
                // BiasCurrent
                ConfigurationSetupRecipe.Ch1BiasCurrent = int.Parse(_xml.Read("BiasCurrentChannel1", "0"));
                ConfigurationSetupRecipe.Ch2BiasCurrent = int.Parse(_xml.Read("BiasCurrentChannel2", "0"));
                ConfigurationSetupRecipe.Ch3BiasCurrent = int.Parse(_xml.Read("BiasCurrentChannel3", "0"));
                ConfigurationSetupRecipe.Ch4BiasCurrent = int.Parse(_xml.Read("BiasCurrentChannel4", "0"));
                ConfigurationSetupRecipe.Ch5BiasCurrent = int.Parse(_xml.Read("BiasCurrentChannel5", "0"));
                ConfigurationSetupRecipe.Ch6BiasCurrent = int.Parse(_xml.Read("BiasCurrentChannel6", "0"));
                ConfigurationSetupRecipe.BiasCurrentSampleCountForAverage = byte.Parse(_xml.Read("ResistanceSampleCount", "0"));
                _xml.CloseSection();

                _xml.OpenSection("Temperature");
                // Temperature
                ConfigurationSetupRecipe.TimeConstant = byte.Parse(_xml.Read("TemperatureTimeConstant", "0"));
                _xml.CloseSection();

                _xml.OpenSection("Capacitance");
                // Capacitance
                ConfigurationSetupRecipe.Frequency   = int.Parse(_xml.Read("Frequency", "0"));
                ConfigurationSetupRecipe.BiasVoltage = int.Parse(_xml.Read("BiasVoltage", "0"));
                ConfigurationSetupRecipe.PeakVoltage = int.Parse(_xml.Read("Peak2PeakVoltage", "0"));
                ConfigurationSetupRecipe.BiasVoltageSampleCountForAverage = byte.Parse(_xml.Read("CapacitanceSampleCount", "0"));
                _xml.CloseSection();

                _xml.OpenSection("EnableHGAChannel");
                // EnableHGAChannel
                ConfigurationSetupRecipe.ResistanceCh1Writer      = Convert.ToByte(_xml.Read("EnableHGAChannel1", "False").Equals("True"));
                ConfigurationSetupRecipe.ResistanceCh2TA          = Convert.ToByte(_xml.Read("EnableHGAChannel2", "False").Equals("True"));
                ConfigurationSetupRecipe.ResistanceCh3WriteHeater = Convert.ToByte(_xml.Read("EnableHGAChannel3", "False").Equals("True"));
                ConfigurationSetupRecipe.ResistanceCh4ReadHeater  = Convert.ToByte(_xml.Read("EnableHGAChannel4", "False").Equals("True"));
                ConfigurationSetupRecipe.ResistanceCh5Read1       = Convert.ToByte(_xml.Read("EnableHGAChannel5", "False").Equals("True"));
                ConfigurationSetupRecipe.ResistanceCh6Read2       = Convert.ToByte(_xml.Read("EnableHGAChannel6", "False").Equals("True"));
                ConfigurationSetupRecipe.CapacitanceCh1           = Convert.ToByte(_xml.Read("EnableHGACapacitance1", "False").Equals("True"));
                ConfigurationSetupRecipe.CapacitanceCh2           = Convert.ToByte(_xml.Read("EnableHGACapacitance2", "False").Equals("True"));
                _xml.CloseSection();

                _xml.OpenSection("EnableHGA");
                // EnableHGA
                ConfigurationSetupRecipe.HGA1  = Convert.ToByte(_xml.Read("EnableHGA1", "False").Equals("True"));
                ConfigurationSetupRecipe.HGA2  = Convert.ToByte(_xml.Read("EnableHGA2", "False").Equals("True"));
                ConfigurationSetupRecipe.HGA3  = Convert.ToByte(_xml.Read("EnableHGA3", "False").Equals("True"));
                ConfigurationSetupRecipe.HGA4  = Convert.ToByte(_xml.Read("EnableHGA4", "False").Equals("True"));
                ConfigurationSetupRecipe.HGA5  = Convert.ToByte(_xml.Read("EnableHGA5", "False").Equals("True"));
                ConfigurationSetupRecipe.HGA6  = Convert.ToByte(_xml.Read("EnableHGA6", "False").Equals("True"));
                ConfigurationSetupRecipe.HGA7  = Convert.ToByte(_xml.Read("EnableHGA7", "False").Equals("True"));
                ConfigurationSetupRecipe.HGA8  = Convert.ToByte(_xml.Read("EnableHGA8", "False").Equals("True"));
                ConfigurationSetupRecipe.HGA9  = Convert.ToByte(_xml.Read("EnableHGA9", "False").Equals("True"));
                ConfigurationSetupRecipe.HGA10 = Convert.ToByte(_xml.Read("EnableHGA10", "False").Equals("True"));
                _xml.CloseSection();

                _xml.OpenSection("ShortCircuitDetection");
                // W+ Pairing (Row 1)
                byte row1 = 0;
                if (_xml.Read("EnableR1C2", "False").Equals("True"))
                {
                    row1 = 2;
                }
                if (_xml.Read("EnableR1C3", "False").Equals("True"))
                {
                    row1 = 3;
                }
                if (_xml.Read("EnableR1C4", "False").Equals("True"))
                {
                    row1 = 4;
                }
                if (_xml.Read("EnableR1C5", "False").Equals("True"))
                {
                    row1 = 5;
                }
                if (_xml.Read("EnableR1C6", "False").Equals("True"))
                {
                    row1 = 6;
                }
                if (_xml.Read("EnableR1C7", "False").Equals("True"))
                {
                    row1 = 7;
                }
                if (_xml.Read("EnableR1C8", "False").Equals("True"))
                {
                    row1 = 8;
                }
                if (_xml.Read("EnableR1C9", "False").Equals("True"))
                {
                    row1 = 9;
                }
                if (_xml.Read("EnableR1C10", "False").Equals("True"))
                {
                    row1 = 10;
                }
                if (_xml.Read("EnableR1C11", "False").Equals("True"))
                {
                    row1 = 11;
                }
                if (_xml.Read("EnableR1C12", "False").Equals("True"))
                {
                    row1 = 12;
                }
                ConfigurationSetupRecipe.WPlusPairing = row1;

                // W- Pairing (Row 2)
                byte row2 = 0;
                if (_xml.Read("EnableR2C1", "False").Equals("True"))
                {
                    row2 = 1;
                }
                if (_xml.Read("EnableR2C3", "False").Equals("True"))
                {
                    row2 = 3;
                }
                if (_xml.Read("EnableR2C4", "False").Equals("True"))
                {
                    row2 = 4;
                }
                if (_xml.Read("EnableR2C5", "False").Equals("True"))
                {
                    row2 = 5;
                }
                if (_xml.Read("EnableR2C6", "False").Equals("True"))
                {
                    row2 = 6;
                }
                if (_xml.Read("EnableR2C7", "False").Equals("True"))
                {
                    row2 = 7;
                }
                if (_xml.Read("EnableR2C8", "False").Equals("True"))
                {
                    row2 = 8;
                }
                if (_xml.Read("EnableR2C9", "False").Equals("True"))
                {
                    row2 = 9;
                }
                if (_xml.Read("EnableR2C10", "False").Equals("True"))
                {
                    row2 = 10;
                }
                if (_xml.Read("EnableR2C11", "False").Equals("True"))
                {
                    row2 = 11;
                }
                if (_xml.Read("EnableR2C12", "False").Equals("True"))
                {
                    row2 = 12;
                }
                ConfigurationSetupRecipe.WMinusPairing = row2;

                // TA+ Pairing (Row 3)
                byte row3 = 0;
                if (_xml.Read("EnableR3C1", "False").Equals("True"))
                {
                    row3 = 1;
                }
                if (_xml.Read("EnableR3C2", "False").Equals("True"))
                {
                    row3 = 2;
                }
                if (_xml.Read("EnableR3C4", "False").Equals("True"))
                {
                    row3 = 4;
                }
                if (_xml.Read("EnableR3C5", "False").Equals("True"))
                {
                    row3 = 5;
                }
                if (_xml.Read("EnableR3C6", "False").Equals("True"))
                {
                    row3 = 6;
                }
                if (_xml.Read("EnableR3C7", "False").Equals("True"))
                {
                    row3 = 7;
                }
                if (_xml.Read("EnableR3C8", "False").Equals("True"))
                {
                    row3 = 8;
                }
                if (_xml.Read("EnableR3C9", "False").Equals("True"))
                {
                    row3 = 9;
                }
                if (_xml.Read("EnableR3C10", "False").Equals("True"))
                {
                    row3 = 10;
                }
                if (_xml.Read("EnableR3C11", "False").Equals("True"))
                {
                    row3 = 11;
                }
                if (_xml.Read("EnableR3C12", "False").Equals("True"))
                {
                    row3 = 12;
                }
                ConfigurationSetupRecipe.TAPlusPairing = row3;

                // TA- Pairing (Row 4)
                byte row4 = 0;
                if (_xml.Read("EnableR4C1", "False").Equals("True"))
                {
                    row4 = 1;
                }
                if (_xml.Read("EnableR4C2", "False").Equals("True"))
                {
                    row4 = 2;
                }
                if (_xml.Read("EnableR4C3", "False").Equals("True"))
                {
                    row4 = 3;
                }
                if (_xml.Read("EnableR4C5", "False").Equals("True"))
                {
                    row4 = 5;
                }
                if (_xml.Read("EnableR4C6", "False").Equals("True"))
                {
                    row4 = 6;
                }
                if (_xml.Read("EnableR4C7", "False").Equals("True"))
                {
                    row4 = 7;
                }
                if (_xml.Read("EnableR4C8", "False").Equals("True"))
                {
                    row4 = 8;
                }
                if (_xml.Read("EnableR4C9", "False").Equals("True"))
                {
                    row4 = 9;
                }
                if (_xml.Read("EnableR4C10", "False").Equals("True"))
                {
                    row4 = 10;
                }
                if (_xml.Read("EnableR4C11", "False").Equals("True"))
                {
                    row4 = 11;
                }
                if (_xml.Read("EnableR4C12", "False").Equals("True"))
                {
                    row4 = 12;
                }
                ConfigurationSetupRecipe.TAMinusPairing = row4;

                // WH+ Pairing (Row 5)
                byte row5 = 0;
                if (_xml.Read("EnableR5C1", "False").Equals("True"))
                {
                    row5 = 1;
                }
                if (_xml.Read("EnableR5C2", "False").Equals("True"))
                {
                    row5 = 2;
                }
                if (_xml.Read("EnableR5C3", "False").Equals("True"))
                {
                    row5 = 3;
                }
                if (_xml.Read("EnableR5C4", "False").Equals("True"))
                {
                    row5 = 4;
                }
                if (_xml.Read("EnableR5C6", "False").Equals("True"))
                {
                    row5 = 6;
                }
                if (_xml.Read("EnableR5C7", "False").Equals("True"))
                {
                    row5 = 7;
                }
                if (_xml.Read("EnableR5C8", "False").Equals("True"))
                {
                    row5 = 8;
                }
                if (_xml.Read("EnableR5C9", "False").Equals("True"))
                {
                    row5 = 9;
                }
                if (_xml.Read("EnableR5C10", "False").Equals("True"))
                {
                    row5 = 10;
                }
                if (_xml.Read("EnableR5C11", "False").Equals("True"))
                {
                    row5 = 11;
                }
                if (_xml.Read("EnableR5C12", "False").Equals("True"))
                {
                    row5 = 12;
                }
                ConfigurationSetupRecipe.WHPlusPairing = row5;

                // WH- Pairing (Row 6)
                byte row6 = 0;
                if (_xml.Read("EnableR6C1", "False").Equals("True"))
                {
                    row6 = 1;
                }
                if (_xml.Read("EnableR6C2", "False").Equals("True"))
                {
                    row6 = 2;
                }
                if (_xml.Read("EnableR6C3", "False").Equals("True"))
                {
                    row6 = 3;
                }
                if (_xml.Read("EnableR6C4", "False").Equals("True"))
                {
                    row6 = 4;
                }
                if (_xml.Read("EnableR6C5", "False").Equals("True"))
                {
                    row6 = 5;
                }
                if (_xml.Read("EnableR6C7", "False").Equals("True"))
                {
                    row6 = 7;
                }
                if (_xml.Read("EnableR6C8", "False").Equals("True"))
                {
                    row6 = 8;
                }
                if (_xml.Read("EnableR6C9", "False").Equals("True"))
                {
                    row6 = 9;
                }
                if (_xml.Read("EnableR6C10", "False").Equals("True"))
                {
                    row6 = 10;
                }
                if (_xml.Read("EnableR6C11", "False").Equals("True"))
                {
                    row6 = 11;
                }
                if (_xml.Read("EnableR6C12", "False").Equals("True"))
                {
                    row6 = 12;
                }
                ConfigurationSetupRecipe.WHMinusPairing = row6;

                // RH+ Pairing (Row 7)
                byte row7 = 0;
                if (_xml.Read("EnableR7C1", "False").Equals("True"))
                {
                    row7 = 1;
                }
                if (_xml.Read("EnableR7C2", "False").Equals("True"))
                {
                    row7 = 2;
                }
                if (_xml.Read("EnableR7C3", "False").Equals("True"))
                {
                    row7 = 3;
                }
                if (_xml.Read("EnableR7C4", "False").Equals("True"))
                {
                    row7 = 4;
                }
                if (_xml.Read("EnableR7C5", "False").Equals("True"))
                {
                    row7 = 5;
                }
                if (_xml.Read("EnableR7C6", "False").Equals("True"))
                {
                    row7 = 6;
                }
                if (_xml.Read("EnableR7C8", "False").Equals("True"))
                {
                    row7 = 8;
                }
                if (_xml.Read("EnableR7C9", "False").Equals("True"))
                {
                    row7 = 9;
                }
                if (_xml.Read("EnableR7C10", "False").Equals("True"))
                {
                    row7 = 10;
                }
                if (_xml.Read("EnableR7C11", "False").Equals("True"))
                {
                    row7 = 11;
                }
                if (_xml.Read("EnableR7C12", "False").Equals("True"))
                {
                    row7 = 12;
                }
                ConfigurationSetupRecipe.RHPlusPairing = row7;

                // RH- Pairing (Row 8)
                byte row8 = 0;
                if (_xml.Read("EnableR8C1", "False").Equals("True"))
                {
                    row8 = 1;
                }
                if (_xml.Read("EnableR8C2", "False").Equals("True"))
                {
                    row8 = 2;
                }
                if (_xml.Read("EnableR8C3", "False").Equals("True"))
                {
                    row8 = 3;
                }
                if (_xml.Read("EnableR8C4", "False").Equals("True"))
                {
                    row8 = 4;
                }
                if (_xml.Read("EnableR8C5", "False").Equals("True"))
                {
                    row8 = 5;
                }
                if (_xml.Read("EnableR8C6", "False").Equals("True"))
                {
                    row8 = 6;
                }
                if (_xml.Read("EnableR8C7", "False").Equals("True"))
                {
                    row8 = 7;
                }
                if (_xml.Read("EnableR8C9", "False").Equals("True"))
                {
                    row8 = 9;
                }
                if (_xml.Read("EnableR8C10", "False").Equals("True"))
                {
                    row8 = 10;
                }
                if (_xml.Read("EnableR8C11", "False").Equals("True"))
                {
                    row8 = 11;
                }
                if (_xml.Read("EnableR8C12", "False").Equals("True"))
                {
                    row8 = 12;
                }
                ConfigurationSetupRecipe.RHMinusPairing = row8;

                // R1+ Pairing (Row 9)
                byte row9 = 0;
                if (_xml.Read("EnableR9C1", "False").Equals("True"))
                {
                    row9 = 1;
                }
                if (_xml.Read("EnableR9C2", "False").Equals("True"))
                {
                    row9 = 2;
                }
                if (_xml.Read("EnableR9C3", "False").Equals("True"))
                {
                    row9 = 3;
                }
                if (_xml.Read("EnableR9C4", "False").Equals("True"))
                {
                    row9 = 4;
                }
                if (_xml.Read("EnableR9C5", "False").Equals("True"))
                {
                    row9 = 5;
                }
                if (_xml.Read("EnableR9C6", "False").Equals("True"))
                {
                    row9 = 6;
                }
                if (_xml.Read("EnableR9C7", "False").Equals("True"))
                {
                    row9 = 7;
                }
                if (_xml.Read("EnableR9C8", "False").Equals("True"))
                {
                    row9 = 8;
                }
                if (_xml.Read("EnableR9C10", "False").Equals("True"))
                {
                    row9 = 10;
                }
                if (_xml.Read("EnableR9C11", "False").Equals("True"))
                {
                    row9 = 11;
                }
                if (_xml.Read("EnableR9C12", "False").Equals("True"))
                {
                    row9 = 12;
                }
                ConfigurationSetupRecipe.R1PlusPairing = row9;

                // R1- Pairing (Row 10)
                byte row10 = 0;
                if (_xml.Read("EnableR10C1", "False").Equals("True"))
                {
                    row10 = 1;
                }
                if (_xml.Read("EnableR10C2", "False").Equals("True"))
                {
                    row10 = 2;
                }
                if (_xml.Read("EnableR10C3", "False").Equals("True"))
                {
                    row10 = 3;
                }
                if (_xml.Read("EnableR10C4", "False").Equals("True"))
                {
                    row10 = 4;
                }
                if (_xml.Read("EnableR10C5", "False").Equals("True"))
                {
                    row10 = 5;
                }
                if (_xml.Read("EnableR10C6", "False").Equals("True"))
                {
                    row10 = 6;
                }
                if (_xml.Read("EnableR10C7", "False").Equals("True"))
                {
                    row10 = 7;
                }
                if (_xml.Read("EnableR10C8", "False").Equals("True"))
                {
                    row10 = 8;
                }
                if (_xml.Read("EnableR10C9", "False").Equals("True"))
                {
                    row10 = 9;
                }
                if (_xml.Read("EnableR10C11", "False").Equals("True"))
                {
                    row10 = 11;
                }
                if (_xml.Read("EnableR10C12", "False").Equals("True"))
                {
                    row10 = 12;
                }
                ConfigurationSetupRecipe.R1MinusPairing = row10;

                // R2+ Pairing (Row 11)
                byte row11 = 0;
                if (_xml.Read("EnableR11C1", "False").Equals("True"))
                {
                    row11 = 1;
                }
                if (_xml.Read("EnableR11C2", "False").Equals("True"))
                {
                    row11 = 2;
                }
                if (_xml.Read("EnableR11C3", "False").Equals("True"))
                {
                    row11 = 3;
                }
                if (_xml.Read("EnableR11C4", "False").Equals("True"))
                {
                    row11 = 4;
                }
                if (_xml.Read("EnableR11C5", "False").Equals("True"))
                {
                    row11 = 5;
                }
                if (_xml.Read("EnableR11C6", "False").Equals("True"))
                {
                    row11 = 6;
                }
                if (_xml.Read("EnableR11C7", "False").Equals("True"))
                {
                    row11 = 7;
                }
                if (_xml.Read("EnableR11C8", "False").Equals("True"))
                {
                    row11 = 8;
                }
                if (_xml.Read("EnableR11C9", "False").Equals("True"))
                {
                    row11 = 9;
                }
                if (_xml.Read("EnableR11C10", "False").Equals("True"))
                {
                    row11 = 10;
                }
                if (_xml.Read("EnableR11C12", "False").Equals("True"))
                {
                    row11 = 12;
                }
                ConfigurationSetupRecipe.R2PlusPairing = row11;

                // R2- Pairing (Row 12)
                byte row12 = 0;
                if (_xml.Read("EnableR12C1", "False").Equals("True"))
                {
                    row12 = 1;
                }
                if (_xml.Read("EnableR12C2", "False").Equals("True"))
                {
                    row12 = 2;
                }
                if (_xml.Read("EnableR12C3", "False").Equals("True"))
                {
                    row12 = 3;
                }
                if (_xml.Read("EnableR12C4", "False").Equals("True"))
                {
                    row12 = 4;
                }
                if (_xml.Read("EnableR12C5", "False").Equals("True"))
                {
                    row12 = 5;
                }
                if (_xml.Read("EnableR12C6", "False").Equals("True"))
                {
                    row12 = 6;
                }
                if (_xml.Read("EnableR12C7", "False").Equals("True"))
                {
                    row12 = 7;
                }
                if (_xml.Read("EnableR12C8", "False").Equals("True"))
                {
                    row12 = 8;
                }
                if (_xml.Read("EnableR12C9", "False").Equals("True"))
                {
                    row12 = 9;
                }
                if (_xml.Read("EnableR12C10", "False").Equals("True"))
                {
                    row12 = 10;
                }
                if (_xml.Read("EnableR12C11", "False").Equals("True"))
                {
                    row12 = 11;
                }
                ConfigurationSetupRecipe.R2MinusPairing = row12;

                _xml.CloseSection();
            }
        }
Ejemplo n.º 14
0
        public void LoadFunctionalTestsRecipe()
        {
            string FunctionalTestsRecipeFilePath = string.Format("{0}FunctionalTestsRecipe.rcp", RecipeFileDirectory);

            if (!Directory.Exists(RecipeFileDirectory))
            {
                Directory.CreateDirectory(RecipeFileDirectory);
            }

            if (!File.Exists(FunctionalTestsRecipeFilePath))
            {
                File.Create(FunctionalTestsRecipeFilePath).Dispose();
                return;
            }
            else
            {
                Log.Info("Startup", "Retrieving recipe for functional tests from {0}.", FunctionalTestsRecipeFilePath);

                SettingsXml _xml = new SettingsXml(FunctionalTestsRecipeFilePath);

                _xml.OpenSection("ZeroOhm");
                // 0Ohm
                FunctionalTestsRecipe.Ch1WriterResistance0Ohm = int.Parse(_xml.Read("Ch1WriterResistance0Ohm", "0"));
                FunctionalTestsRecipe.Ch2TAResistance0Ohm     = int.Parse(_xml.Read("Ch2TAResistance0Ohm", "0"));
                FunctionalTestsRecipe.Ch3WHResistance0Ohm     = int.Parse(_xml.Read("Ch3WHResistance0Ohm", "0"));
                FunctionalTestsRecipe.Ch4RHResistance0Ohm     = int.Parse(_xml.Read("Ch4RHResistance0Ohm", "0"));
                FunctionalTestsRecipe.Ch5R1Resistance0Ohm     = int.Parse(_xml.Read("Ch5R1Resistance0Ohm", "0"));
                FunctionalTestsRecipe.Ch6R2Resistance0Ohm     = int.Parse(_xml.Read("Ch6R2Resistance0Ohm", "0"));
                _xml.CloseSection();

                _xml.OpenSection("TenOhm");
                // 10Ohm
                FunctionalTestsRecipe.Ch1WriterResistance10Ohm = int.Parse(_xml.Read("Ch1WriterResistance10Ohm", "0"));
                FunctionalTestsRecipe.Ch2TAResistance10Ohm     = int.Parse(_xml.Read("Ch2TAResistance10Ohm", "0"));
                FunctionalTestsRecipe.Ch3WHResistance10Ohm     = int.Parse(_xml.Read("Ch3WHResistance10Ohm", "0"));
                FunctionalTestsRecipe.Ch4RHResistance10Ohm     = int.Parse(_xml.Read("Ch4RHResistance10Ohm", "0"));
                FunctionalTestsRecipe.Ch5R1Resistance10Ohm     = int.Parse(_xml.Read("Ch5R1Resistance10Ohm", "0"));
                FunctionalTestsRecipe.Ch6R2Resistance10Ohm     = int.Parse(_xml.Read("Ch6R2Resistance10Ohm", "0"));
                _xml.CloseSection();

                _xml.OpenSection("OneHundredOhm");
                // 100Ohm
                FunctionalTestsRecipe.Ch1WriterResistance100Ohm = int.Parse(_xml.Read("Ch1WriterResistance100Ohm", "0"));
                FunctionalTestsRecipe.Ch2TAResistance100Ohm     = int.Parse(_xml.Read("Ch2TAResistance100Ohm", "0"));
                FunctionalTestsRecipe.Ch3WHResistance100Ohm     = int.Parse(_xml.Read("Ch3WHResistance100Ohm", "0"));
                FunctionalTestsRecipe.Ch4RHResistance100Ohm     = int.Parse(_xml.Read("Ch4RHResistance100Ohm", "0"));
                FunctionalTestsRecipe.Ch5R1Resistance100Ohm     = int.Parse(_xml.Read("Ch5R1Resistance100Ohm", "0"));
                FunctionalTestsRecipe.Ch6R2Resistance100Ohm     = int.Parse(_xml.Read("Ch6R2Resistance100Ohm", "0"));
                _xml.CloseSection();

                _xml.OpenSection("FiveHundredOhm");
                // 500Ohm
                FunctionalTestsRecipe.Ch1WriterResistance500Ohm = int.Parse(_xml.Read("Ch1WriterResistance500Ohm", "0"));
                FunctionalTestsRecipe.Ch2TAResistance500Ohm     = int.Parse(_xml.Read("Ch2TAResistance500Ohm", "0"));
                FunctionalTestsRecipe.Ch3WHResistance500Ohm     = int.Parse(_xml.Read("Ch3WHResistance500Ohm", "0"));
                FunctionalTestsRecipe.Ch4RHResistance500Ohm     = int.Parse(_xml.Read("Ch4RHResistance500Ohm", "0"));
                FunctionalTestsRecipe.Ch5R1Resistance500Ohm     = int.Parse(_xml.Read("Ch5R1Resistance500Ohm", "0"));
                FunctionalTestsRecipe.Ch6R2Resistance500Ohm     = int.Parse(_xml.Read("Ch6R2Resistance500Ohm", "0"));
                _xml.CloseSection();

                _xml.OpenSection("OneThousandOhm");
                // 1000Ohm
                FunctionalTestsRecipe.Ch1WriterResistance1000Ohm = int.Parse(_xml.Read("Ch1WriterResistance1000Ohm", "0"));
                FunctionalTestsRecipe.Ch2TAResistance1000Ohm     = int.Parse(_xml.Read("Ch2TAResistance1000Ohm", "0"));
                FunctionalTestsRecipe.Ch3WHResistance1000Ohm     = int.Parse(_xml.Read("Ch3WHResistance1000Ohm", "0"));
                FunctionalTestsRecipe.Ch4RHResistance1000Ohm     = int.Parse(_xml.Read("Ch4RHResistance1000Ohm", "0"));
                FunctionalTestsRecipe.Ch5R1Resistance1000Ohm     = int.Parse(_xml.Read("Ch5R1Resistance1000Ohm", "0"));
                FunctionalTestsRecipe.Ch6R2Resistance1000Ohm     = int.Parse(_xml.Read("Ch6R2Resistance1000Ohm", "0"));
                _xml.CloseSection();

                _xml.OpenSection("TenThousandOhm");
                // 10000Ohm
                FunctionalTestsRecipe.Ch1WriterResistance10000Ohm = int.Parse(_xml.Read("Ch1WriterResistance10000Ohm", "0"));
                FunctionalTestsRecipe.Ch2TAResistance10000Ohm     = int.Parse(_xml.Read("Ch2TAResistance10000Ohm", "0"));
                FunctionalTestsRecipe.Ch3WHResistance10000Ohm     = int.Parse(_xml.Read("Ch3WHResistance10000Ohm", "0"));
                FunctionalTestsRecipe.Ch4RHResistance10000Ohm     = int.Parse(_xml.Read("Ch4RHResistance10000Ohm", "0"));
                FunctionalTestsRecipe.Ch5R1Resistance10000Ohm     = int.Parse(_xml.Read("Ch5R1Resistance10000Ohm", "0"));
                FunctionalTestsRecipe.Ch6R2Resistance10000Ohm     = int.Parse(_xml.Read("Ch6R2Resistance10000Ohm", "0"));
                _xml.CloseSection();

                _xml.OpenSection("Capacitance");
                // Capacitance
                FunctionalTestsRecipe.Capacitance100pF = int.Parse(_xml.Read("Capacitance100pF", "0"));
                FunctionalTestsRecipe.Capacitance270pF = int.Parse(_xml.Read("Capacitance270pF", "0"));
                FunctionalTestsRecipe.Capacitance470pF = int.Parse(_xml.Read("Capacitance470pF", "0"));
                FunctionalTestsRecipe.Capacitance680pF = int.Parse(_xml.Read("Capacitance680pF", "0"));
                FunctionalTestsRecipe.Capacitance820pF = int.Parse(_xml.Read("Capacitance820pF", "0"));
                FunctionalTestsRecipe.Capacitance10nF  = int.Parse(_xml.Read("Capacitance10nF", "0"));
                _xml.CloseSection();

                _xml.OpenSection("Temperature");
                // Temperature
                FunctionalTestsRecipe.Ch1Temperature = int.Parse(_xml.Read("Ch1Temperature", "0"));
                FunctionalTestsRecipe.Ch2Temperature = int.Parse(_xml.Read("Ch2Temperature", "0"));
                FunctionalTestsRecipe.Ch3Temperature = int.Parse(_xml.Read("Ch3Temperature", "0"));
                _xml.CloseSection();
            }
        }
Ejemplo n.º 15
0
        public void Load()
        {
            if (this.HSTSettingsFilePath == null)
            {
                return;
            }

            if (!File.Exists(this.HSTSettingsFilePath))
            {
                File.Create(this.HSTSettingsFilePath).Dispose();
                return;
            }

            LoadUsers();

            _xml = new SettingsXml(this.HSTSettingsFilePath);
            _xml.OpenSection("Config");

            foreach (PropertyInfo pi in this.GetType().GetProperties())
            {
                if (!pi.CanWrite) // Avoid putting data to read only property such as IsAutoRecipe
                {
                    continue;
                }

                // Loop through all properties and save them into config.
                if (pi.PropertyType == typeof(String))
                {
                    pi.SetValue(this, _xml.Read(pi.Name, (String)pi.GetValue(this, null)), null);
                }

                if (pi.PropertyType == typeof(Int32))
                {
                    pi.SetValue(this, _xml.Read(pi.Name, (Int32)pi.GetValue(this, null)), null);
                }

                if (pi.PropertyType == typeof(Double))
                {
                    pi.SetValue(this, _xml.Read(pi.Name, (Double)pi.GetValue(this, null)), null);
                }

                if (pi.PropertyType == typeof(Boolean))
                {
                    pi.SetValue(this, _xml.Read(pi.Name, (Boolean)pi.GetValue(this, null)), null);
                }

                if (pi.PropertyType.IsEnum == true)
                {
                    pi.SetValue(this, _xml.Read(pi.Name, (int)pi.GetValue(this, null)), null);
                }
            }

            OperatorGID = _xml.Read("OperatorGID", CommonFunctions.UNKNOWN);
            _xml.CloseSection();

            _xml.OpenSection("Install");
            Install.EquipmentID                  = _xml.Read("EquipmentID", CommonFunctions.UNKNOWN);
            Install.LocationID                   = _xml.Read("LocationID", CommonFunctions.UNKNOWN);
            Install.CellID                       = _xml.Read("CellID", CommonFunctions.UNKNOWN);
            Install.Factory                      = (FactoryList)Enum.Parse(typeof(FactoryList), _xml.Read("Factory", FactoryList.Unknown.ToString()));
            Install.AudibleAlarmEnabled          = _xml.Read("AudibleAlarmEnabled", false);
            Install.DataLoggingFileSavingEnabled = _xml.Read("DataLoggingFileSavingEnabled", true);
            Install.ProcessStepCheckingEnabled   = _xml.Read("ProcessStepCheckingEnabled", false);
            Install.DataLoggingForRFIDAndSeatrackRecordUpdateEnabled = _xml.Read("DataLoggingForRFIDAndSeatrackRecordUpdateEnabled", false);
            Install.SeatrackRecordUpdateEnabled  = _xml.Read("SeatrackRecordUpdateEnabled", false);
            Install.ClearImproperShutDownMessage = _xml.Read("ClearImproperShutDownMessage", false);
            Install.EnableDebugLog            = _xml.Read("EnableDebugLog", false);
            Install.EnableRunTestScriptButton = _xml.Read("EnableRunTestScriptButton", false);
            Install.TestScript               = _xml.Read("TestScript", CommonFunctions.UNKNOWN);
            Install.LogIOChangeState         = _xml.Read("LogIOChangeState", true);
            Install.HGADetectionUsingVision  = _xml.Read("HGADetectionUsingVision", true);
            Install.EnableVision             = _xml.Read("EnableVision", true);
            Install.OperationMode            = (OperationMode)Enum.Parse(typeof(OperationMode), _xml.Read("OperationMode", OperationMode.Auto.ToString()));
            Install.EnabledUserAccessControl = _xml.Read("EnabledUserAccessControl", true);
            Install.DataRecordDisplayCounter = _xml.Read("DataRecordDisplayCounter", 500);
            Install.ANCGraphCounterMaximum   = _xml.Read("ANCGraphCounterMaximum", 3000);
            // Disable Simulation if Vision is enabled
            if (Install.EnableVision == true)
            {
                if (Install.OperationMode == OperationMode.Simulation)
                {
                    Install.OperationMode = OperationMode.Auto;
                }
            }
            Install.ConveyorCongestionToleranceTimeLimit = _xml.Read("ConveyorCongestionToleranceTimeLimit", 0);
            Install.MeasurementTestTimeOutLimit          = _xml.Read("MeasurementTestTimeOutLimit", 0);
            Install.HGAPurgingDurationInms                  = _xml.Read("HGAPurgingDurationInms", 0);
            Install.TICFailHGAsInBoatLimit                  = _xml.Read("TICFailHGAsInBoatLimit", 0);
            Install.TICConsecutiveFailBoatsLimit            = _xml.Read("TICConsecutiveFailBoatsLimit", 0);
            Install.TICFailHGAsTotalLimit                   = _xml.Read("TICFailHGAsTotalLimit", 0);
            Install.TICErrorCountingTimeInterval            = _xml.Read("TICErrorCountingTimeInterval", 0);
            Install.ConsecutiveFailBoatsFailPickupByInputEE = _xml.Read("ConsecutiveFailBoatsFailPickupByInputEE", 0);
            Install.FlattenerDeployBeforePrecisorVaccumON   = _xml.Read("FlattenerDeployBeforePrecisorVaccumON", true);
            Install.FlattenerDeployDuration                 = _xml.Read("FlattenerDeployDuration", 50);
            Install.EnableFlattenerAsPrecisor               = _xml.Read("EnableFlattener", true);
            Install.EnableFlattenerAsInput                  = _xml.Read("EnableFlattenerAsInput", true);
            Install.EnableMaintenanceSpeedForManualMove     = _xml.Read("EnableMaintenanceSpeedForManualMove", true);
            Install.RFIDUpdateOption = (RFIDUpdateOption)Enum.Parse(typeof(RFIDUpdateOption), _xml.Read("RFIDUpdateOption", RFIDUpdateOption.UpdateALL.ToString()));
            Install.InputEETouchingOnDycemDuration       = _xml.Read("InputEETouchingOnDycemDuration", 1);
            Install.OutputEETouchingOnDycemDuration      = _xml.Read("OutputEETouchingOnDycemDuration", 1);
            Install.TotalNumberOfInputEETouchingOnDycem  = _xml.Read("TotalNumberOfInputEETouchingOnDycem", 1);
            Install.TotalNumberOfOutputEETouchingOnDycem = _xml.Read("TotalNumberOfOutputEETouchingOnDycem", 1);
            Install.CapacitanceTestSamplingSize          = _xml.Read("CapacitanceTestSamplingSize", 0);
            Install.EnabledTDFFileSystem     = _xml.Read("EnabledTDFSystem", false);
            Install.EnabledSaveTDFFileOnly   = _xml.Read("EnabledSaveTDFFileOnly", false);
            Install.EnabledSaveTDFBackupFile = _xml.Read("EnabledSaveTDFBackupFile", false);
            _xml.CloseSection();

            _xml.OpenSection("Directories");
            Directory.WorkorderLocalPath    = _xml.Read("LocalRecipePath", CommonFunctions.UNKNOWN);
            Directory.WorkorderGlobalPath   = _xml.Read("GlobalRecipePath", CommonFunctions.UNKNOWN);
            Directory.LogFilePath           = _xml.Read("LogFilePath", "C:\\Seagate\\HGA.HST\\Log");
            Directory.ErrorHandlingPath     = _xml.Read("ErrorHandlingPath", CommonFunctions.UNKNOWN);
            Directory.TSRRecipLocalPath     = _xml.Read("WorkOrderPath", CommonFunctions.UNKNOWN);
            Directory.DataPath              = _xml.Read("DataPath", "C:\\Seagate\\HGA.HST\\Data");
            Directory.TSRRecipeGlobalPath   = _xml.Read("ServerDirectoryForWorkOrder", CommonFunctions.UNKNOWN);
            Directory.IOChangeStatePath     = _xml.Read("IOChangeStatePath", CommonFunctions.UNKNOWN);
            Directory.McConfigGlobalPath    = _xml.Read("McConfigGlobalPath", CommonFunctions.UNKNOWN);
            Directory.MachineRobotPointPath = _xml.Read("MachineRobotPointPath", CommonFunctions.UNKNOWN);
            if (Directory.McConfigGlobalPath != CommonFunctions.UNKNOWN)
            {
                var    split      = Directory.McConfigGlobalPath.Split('\\');
                string product    = string.Empty;
                string globalPath = string.Empty;

                if (split.Length > 1)
                {
                    globalPath = System.IO.Path.Combine(@"" + split[0] + "\\" + split[1] + "\\" + split[2] + "\\");
                }
                Directory.SpacialUserGlobalPath = System.IO.Path.Combine(@"" + globalPath + "Spacial_User" + "\\");
            }

            if (Directory.WorkorderLocalPath == CommonFunctions.UNKNOWN)
            {
                Directory.WorkorderLocalPath = "C:\\Seagate\\HGA.HST\\Recipes";
            }
            if (Directory.WorkorderGlobalPath == CommonFunctions.UNKNOWN)
            {
                Directory.WorkorderGlobalPath = "N:\\HGAWorkOrder\\Released";
            }
            if (Directory.LogFilePath == CommonFunctions.UNKNOWN)
            {
                Directory.LogFilePath = "C:\\Seagate\\HGA.HST\\Log";
            }
            if (Directory.DataPath == CommonFunctions.UNKNOWN)
            {
                Directory.DataPath = "C:\\Seagate\\HGA.HST\\Data";
            }
            if (Directory.SpacialUserGlobalPath == CommonFunctions.UNKNOWN)
            {
                Directory.SpacialUserGlobalPath = "C:\\Seagate\\HGA.HST\\";
            }

            _xml.CloseSection();

            _xml.OpenSection("SimulatedPart");
            SimulatedPart.Carriers.Clear();

            for (int i = 0; ; i++)
            {
                string          CurrentCarrierLabel = "Carrier" + i;
                CarrierSettings CurrentCarrier      = new CarrierSettings();
                CurrentCarrier.CarrierID         = _xml.Read(CurrentCarrierLabel + "CarrierID", CommonFunctions.UNKNOWN);
                CurrentCarrier.Name              = _xml.Read(CurrentCarrierLabel + "Name", CommonFunctions.UNKNOWN);
                CurrentCarrier.ImageFileName     = _xml.Read(CurrentCarrierLabel + "ImageFileName", CommonFunctions.UNKNOWN);
                CurrentCarrier.RFIDFileName      = _xml.Read(CurrentCarrierLabel + "RFIDFileName", CommonFunctions.UNKNOWN);
                CurrentCarrier.IsPassThroughMode = _xml.Read(CurrentCarrierLabel + "IsPassThroughMode", false);

                CurrentCarrier.Hga1.Hga_Status  = (HGAStatus)Enum.Parse(typeof(HGAStatus), _xml.Read(CurrentCarrierLabel + "HGA1Status", CommonFunctions.UNKNOWN));
                CurrentCarrier.Hga2.Hga_Status  = (HGAStatus)Enum.Parse(typeof(HGAStatus), _xml.Read(CurrentCarrierLabel + "HGA2Status", CommonFunctions.UNKNOWN));
                CurrentCarrier.Hga3.Hga_Status  = (HGAStatus)Enum.Parse(typeof(HGAStatus), _xml.Read(CurrentCarrierLabel + "HGA3Status", CommonFunctions.UNKNOWN));
                CurrentCarrier.Hga4.Hga_Status  = (HGAStatus)Enum.Parse(typeof(HGAStatus), _xml.Read(CurrentCarrierLabel + "HGA4Status", CommonFunctions.UNKNOWN));
                CurrentCarrier.Hga5.Hga_Status  = (HGAStatus)Enum.Parse(typeof(HGAStatus), _xml.Read(CurrentCarrierLabel + "HGA5Status", CommonFunctions.UNKNOWN));
                CurrentCarrier.Hga6.Hga_Status  = (HGAStatus)Enum.Parse(typeof(HGAStatus), _xml.Read(CurrentCarrierLabel + "HGA6Status", CommonFunctions.UNKNOWN));
                CurrentCarrier.Hga7.Hga_Status  = (HGAStatus)Enum.Parse(typeof(HGAStatus), _xml.Read(CurrentCarrierLabel + "HGA7Status", CommonFunctions.UNKNOWN));
                CurrentCarrier.Hga8.Hga_Status  = (HGAStatus)Enum.Parse(typeof(HGAStatus), _xml.Read(CurrentCarrierLabel + "HGA8Status", CommonFunctions.UNKNOWN));
                CurrentCarrier.Hga9.Hga_Status  = (HGAStatus)Enum.Parse(typeof(HGAStatus), _xml.Read(CurrentCarrierLabel + "HGA9Status", CommonFunctions.UNKNOWN));
                CurrentCarrier.Hga10.Hga_Status = (HGAStatus)Enum.Parse(typeof(HGAStatus), _xml.Read(CurrentCarrierLabel + "HGA10Status", CommonFunctions.UNKNOWN));

                if (String.Compare(CurrentCarrier.Name, CommonFunctions.UNKNOWN, true) != 0)
                {
                    SimulatedPart.Carriers.Add(CurrentCarrier);
                }
                else
                {
                    break;
                }
            }

            _xml.CloseSection();

            _xml.OpenSection("Bypass");
            Install.BypassInputAndOutputEEsPickAndPlace = _xml.Read("BypassInputAndOutputEEsPickAndPlace", false);
            Install.BypassMeasurementTestAtTestProbe    = _xml.Read("BypassMeasurementTestAtTestProbe", false);
            Install.BypassRFIDReadAtInput = _xml.Read("BypassRFIDReadAtInput", false);
            Install.BypassRFIDAndSeatrackWriteAtOutput = _xml.Read("BypassRFIDAndSeatrackWriteAtOutput", false);
            Install.BypassVisionAtInputTurnStation     = _xml.Read("BypassVisionAtInputTurnStation", false);
            Install.BypassVisionAtOutput = _xml.Read("BypassVisionAtOutput", false);
            Install.WorkOrderFilePath    = _xml.Read("WorkOrderFilePath", CommonFunctions.UNKNOWN);
            _xml.CloseSection();

            _xml.OpenSection("DryRun");
            Install.DryRunWithoutBoat = _xml.Read("DryRunWithoutBoat", false);
            _xml.CloseSection();

            _configPerformance.Load("PerformanceConfig", _xml);

            _SamplingData.Load("SamplingData", _xml);
            _ancsetting.Load("Ancsetting", _xml);
            _triggeringConfig.Load("TriggeringConfig", _xml);
            _resistanceCheckingConfig.Load("ResistanceChecking", _xml);
            _cccParameterSetting.Load("CCCParameterSetting", _xml);
            _cccCrdlParameterSetting.Load("CccCrdlParameterSetting", _xml);
            _hstCCCCounter.Load("TicCounter", _xml);
            _hstCCCCounter.CCCCounterTicMc1.CCCCounterForHst.uTICMachineName = _ancsetting.uTICMachineName1;
            _hstCCCCounter.CCCCounterTicMc2.CCCCounterForHst.uTICMachineName = _ancsetting.uTICMachineName2;


            //End Bypass hstCCCCounter
            //---------------------------------------------------------------------
            _hstCCCCounter.CCCCounterAllMc.CCCCounterForHst.TicFailCounter                  = int.Parse(_ancsetting.All_TicFailCounter.ToString());
            _hstCCCCounter.CCCCounterAllMc.CCCCounterForHst.HstFailCounter                  = int.Parse(_ancsetting.All_HstFailCounter.ToString());
            _hstCCCCounter.CCCCounterAllMc.CCCCounterForHst.TicGoodPartCounter              = int.Parse(_ancsetting.All_TicGoodPartCounter.ToString());
            _hstCCCCounter.CCCCounterAllMc.CCCCounterForHst.HstGoodPartCounter              = int.Parse(_ancsetting.All_HstGoodPartCounter.ToString());
            _hstCCCCounter.CCCCounterAllMc.CCCCounterForHst.AdaptivePartRunCounter          = int.Parse(_ancsetting.All_AdaptivePartRunCounter.ToString());
            _hstCCCCounter.CCCCounterAllMc.CCCCounterForHst.AdaptiveDefectCounter           = int.Parse(_ancsetting.All_AdaptiveDefectCounter.ToString());
            _hstCCCCounter.CCCCounterAllMc.CCCCounterForHst.LastSaveLogTime                 = DateTime.ParseExact(_ancsetting.All_LastSaveLogTime.ToString("dd-MMM-yy:HH:mm:ss"), "dd-MMM-yy:HH:mm:ss", null);
            _hstCCCCounter.CCCCounterAllMc.CCCCounterForHst.MCDownTriggering                = int.Parse(_ancsetting.All_MCDownTriggering.ToString());
            _hstCCCCounter.CCCCounterAllMc.CCCCounterForHst.TicHighPercentTriggeringCounter = int.Parse(_ancsetting.All_TicHighPercentTriggeringCounter.ToString());
            _hstCCCCounter.CCCCounterAllMc.CCCCounterForHst.HstHighPercentTriggeringCounter = int.Parse(_ancsetting.All_HstHighPercentTriggeringCounter.ToString());
            _hstCCCCounter.CCCCounterAllMc.CCCCounterForHst.InternalTriggerCounter          = int.Parse(_ancsetting.All_InternalTriggerCounter.ToString());

            _hstCCCCounter.CCCCounterTicMc1.CCCCounterForHst.TicFailCounter                  = int.Parse(_ancsetting.MC1_TicFailCounter.ToString());
            _hstCCCCounter.CCCCounterTicMc1.CCCCounterForHst.HstFailCounter                  = int.Parse(_ancsetting.MC1_HstFailCounter.ToString());
            _hstCCCCounter.CCCCounterTicMc1.CCCCounterForHst.TicGoodPartCounter              = int.Parse(_ancsetting.MC1_TicGoodPartCounter.ToString());
            _hstCCCCounter.CCCCounterTicMc1.CCCCounterForHst.HstGoodPartCounter              = int.Parse(_ancsetting.MC1_HstGoodPartCounter.ToString());
            _hstCCCCounter.CCCCounterTicMc1.CCCCounterForHst.AdaptivePartRunCounter          = int.Parse(_ancsetting.MC1_AdaptivePartRunCounter.ToString());
            _hstCCCCounter.CCCCounterTicMc1.CCCCounterForHst.AdaptiveDefectCounter           = int.Parse(_ancsetting.MC1_AdaptiveDefectCounter.ToString());
            _hstCCCCounter.CCCCounterTicMc1.CCCCounterForHst.LastSaveLogTime                 = DateTime.ParseExact(_ancsetting.MC1_LastSaveLogTime.ToString("dd-MMM-yy:HH:mm:ss"), "dd-MMM-yy:HH:mm:ss", null);
            _hstCCCCounter.CCCCounterTicMc1.CCCCounterForHst.MCDownTriggering                = int.Parse(_ancsetting.MC1_MCDownTriggering.ToString());
            _hstCCCCounter.CCCCounterTicMc1.CCCCounterForHst.TicHighPercentTriggeringCounter = int.Parse(_ancsetting.MC1_TicHighPercentTriggeringCounter.ToString());
            _hstCCCCounter.CCCCounterTicMc1.CCCCounterForHst.HstHighPercentTriggeringCounter = int.Parse(_ancsetting.MC1_HstHighPercentTriggeringCounter.ToString());
            _hstCCCCounter.CCCCounterTicMc1.CCCCounterForHst.InternalTriggerCounter          = int.Parse(_ancsetting.MC1_InternalTriggerCounter.ToString());

            _hstCCCCounter.CCCCounterTicMc2.CCCCounterForHst.TicFailCounter                  = int.Parse(_ancsetting.MC2_TicFailCounter.ToString());
            _hstCCCCounter.CCCCounterTicMc2.CCCCounterForHst.HstFailCounter                  = int.Parse(_ancsetting.MC2_HstFailCounter.ToString());
            _hstCCCCounter.CCCCounterTicMc2.CCCCounterForHst.TicGoodPartCounter              = int.Parse(_ancsetting.MC2_TicGoodPartCounter.ToString());
            _hstCCCCounter.CCCCounterTicMc2.CCCCounterForHst.HstGoodPartCounter              = int.Parse(_ancsetting.MC2_HstGoodPartCounter.ToString());
            _hstCCCCounter.CCCCounterTicMc2.CCCCounterForHst.AdaptivePartRunCounter          = int.Parse(_ancsetting.MC2_AdaptivePartRunCounter.ToString());
            _hstCCCCounter.CCCCounterTicMc2.CCCCounterForHst.AdaptiveDefectCounter           = int.Parse(_ancsetting.MC2_AdaptiveDefectCounter.ToString());
            _hstCCCCounter.CCCCounterTicMc2.CCCCounterForHst.LastSaveLogTime                 = DateTime.ParseExact(_ancsetting.MC2_LastSaveLogTime.ToString("dd-MMM-yy:HH:mm:ss"), "dd-MMM-yy:HH:mm:ss", null);
            _hstCCCCounter.CCCCounterTicMc2.CCCCounterForHst.MCDownTriggering                = int.Parse(_ancsetting.MC2_MCDownTriggering.ToString());
            _hstCCCCounter.CCCCounterTicMc2.CCCCounterForHst.TicHighPercentTriggeringCounter = int.Parse(_ancsetting.MC2_TicHighPercentTriggeringCounter.ToString());
            _hstCCCCounter.CCCCounterTicMc2.CCCCounterForHst.HstHighPercentTriggeringCounter = int.Parse(_ancsetting.MC2_HstHighPercentTriggeringCounter.ToString());
            _hstCCCCounter.CCCCounterTicMc2.CCCCounterForHst.InternalTriggerCounter          = int.Parse(_ancsetting.MC2_InternalTriggerCounter.ToString());

            //---------------------------------------------------------------------
            //End of Bypass hstCCCCounter
            if (OnSettingsChanged != null)
            {
                OnSettingsChanged(this, null);
            }
        }
Ejemplo n.º 16
0
        public void LoadSelectedFile()
        {
            string FilePath = string.Empty;

            using (OpenFileDialog ofd = new OpenFileDialog())
            {
                ofd.FileName = FilePath;
                ofd.Filter   = "Config File (*.config)|*.config|All files|*.*";

                if (ofd.ShowDialog() != DialogResult.OK)
                {
                    return;
                }

                if (String.IsNullOrEmpty(ofd.FileName))
                {
                    return;
                }

                FilePath = ofd.FileName;
            }

            _xml = new SettingsXml(FilePath);
            _xml.OpenSection("Config");

            foreach (PropertyInfo pi in this.GetType().GetProperties())
            {
                if (!pi.CanWrite) // Avoid putting data to read only property such as IsAutoRecipe
                {
                    continue;
                }

                // Loop through all properties and save them into config.
                if (pi.PropertyType == typeof(String))
                {
                    pi.SetValue(this, _xml.Read(pi.Name, (String)pi.GetValue(this, null)), null);
                }

                if (pi.PropertyType == typeof(Int32))
                {
                    pi.SetValue(this, _xml.Read(pi.Name, (Int32)pi.GetValue(this, null)), null);
                }

                if (pi.PropertyType == typeof(Double))
                {
                    pi.SetValue(this, _xml.Read(pi.Name, (Double)pi.GetValue(this, null)), null);
                }

                if (pi.PropertyType == typeof(Boolean))
                {
                    pi.SetValue(this, _xml.Read(pi.Name, (Boolean)pi.GetValue(this, null)), null);
                }

                if (pi.PropertyType.IsEnum == true)
                {
                    pi.SetValue(this, _xml.Read(pi.Name, (int)pi.GetValue(this, null)), null);
                }
            }

            _xml.CloseSection();

            _xml.OpenSection("MoveProfile/InputEEZ/");
            MoveProfile.InputEEZ.Acceleration   = int.Parse(_xml.Read("Acceleration", "0"));
            MoveProfile.InputEEZ.Deceleration   = int.Parse(_xml.Read("Deceleration", "0"));
            MoveProfile.InputEEZ.Velocity       = int.Parse(_xml.Read("Velocity", "0"));
            MoveProfile.InputEEZ.SettlingWindow = int.Parse(_xml.Read("SettlingWindow", "0"));
            _xml.CloseSection();

            _xml.OpenSection("MoveProfile/PrecisorX/");
            MoveProfile.PrecisorX.Acceleration   = int.Parse(_xml.Read("Acceleration", "0"));
            MoveProfile.PrecisorX.Deceleration   = int.Parse(_xml.Read("Deceleration", "0"));
            MoveProfile.PrecisorX.Velocity       = int.Parse(_xml.Read("Velocity", "0"));
            MoveProfile.PrecisorX.SettlingWindow = int.Parse(_xml.Read("SettlingWindow", "0"));
            _xml.CloseSection();

            _xml.OpenSection("MoveProfile/PrecisorY/");
            MoveProfile.PrecisorY.Acceleration   = int.Parse(_xml.Read("Acceleration", "0"));
            MoveProfile.PrecisorY.Deceleration   = int.Parse(_xml.Read("Deceleration", "0"));
            MoveProfile.PrecisorY.Velocity       = int.Parse(_xml.Read("Velocity", "0"));
            MoveProfile.PrecisorY.SettlingWindow = int.Parse(_xml.Read("SettlingWindow", "0"));
            _xml.CloseSection();

            _xml.OpenSection("MoveProfile/PrecisorTheta/");
            MoveProfile.PrecisorTheta.Acceleration   = int.Parse(_xml.Read("Acceleration", "0"));
            MoveProfile.PrecisorTheta.Deceleration   = int.Parse(_xml.Read("Deceleration", "0"));
            MoveProfile.PrecisorTheta.Velocity       = int.Parse(_xml.Read("Velocity", "0"));
            MoveProfile.PrecisorTheta.SettlingWindow = int.Parse(_xml.Read("SettlingWindow", "0"));
            _xml.CloseSection();

            _xml.OpenSection("MoveProfile/TestProbeZ/");
            MoveProfile.TestProbeZ.Acceleration   = int.Parse(_xml.Read("Acceleration", "0"));
            MoveProfile.TestProbeZ.Deceleration   = int.Parse(_xml.Read("Deceleration", "0"));
            MoveProfile.TestProbeZ.Velocity       = int.Parse(_xml.Read("Velocity", "0"));
            MoveProfile.TestProbeZ.SettlingWindow = int.Parse(_xml.Read("SettlingWindow", "0"));
            _xml.CloseSection();

            _xml.OpenSection("MoveProfile/OutputEEZ/");
            MoveProfile.OutputEEZ.Acceleration   = int.Parse(_xml.Read("Acceleration", "0"));
            MoveProfile.OutputEEZ.Deceleration   = int.Parse(_xml.Read("Deceleration", "0"));
            MoveProfile.OutputEEZ.Velocity       = int.Parse(_xml.Read("Velocity", "0"));
            MoveProfile.OutputEEZ.SettlingWindow = int.Parse(_xml.Read("SettlingWindow", "0"));
            _xml.CloseSection();

            _xml.OpenSection("DelayTimer");
            Delay.VacuumOnDelay  = int.Parse(_xml.Read("VacuumOnDelay", "0"));
            Delay.VacuumOffDelay = int.Parse(_xml.Read("VacuumOffDelay", "0"));
            Delay.VacuumOffAtPrecisorBeforeOutputEEPick =
                int.Parse(_xml.Read("VacuumOffAtPrecisorBeforeOutputEEPick", "500"));
            _xml.CloseSection();

            if (OnSettingsChanged != null)
            {
                OnSettingsChanged(this, null);
            }
        }
        public void Load(string section, SettingsXml xml)
        {
            xml.OpenSection(section + "/Marker");
            _markerType      = (MarkerType)xml.Read("markerType", 0);
            _markerWidth     = xml.Read("markerWidth", _defaultMarkerWidth);
            _markerHeight    = xml.Read("markerHeight", _defatulMarkerHeight);
            _xyAxesHatchSize = (double)xml.Read("XYAxesHatchSize", _defaultHatchSize);
            _xyAxesHatchInc  = (double)xml.Read("XYAxesHatchInc", _defaultHatchIncrement);
            _showCrossHair   = (bool)xml.Read("ShowCrossHair", false);
            _showAxes        = (bool)xml.Read("ShowAxes", false);
            xml.CloseSection();

            xml.OpenSection(section + "/Measurement");
            _distMeasureLineStartX = (double)xml.Read("DistMeasureLineStartX", _defaultLineStartX);
            _distMeasureLineStartY = (double)xml.Read("DistMeasureLineStartY", _defaultLineStartY);
            _distMeasureLineEndX   = (double)xml.Read("DistMeasureLineEndX", _defaultLineEndX);
            _distMeasureLineEndY   = (double)xml.Read("DistMeasureLineEndY", _defaultLineEndY);
            _showMeasurementLine   = (bool)xml.Read("ShowMeasurementLine", false);
            xml.CloseSection();
        }
Ejemplo n.º 18
0
        public void Load()
        {
            if (this.GompertzSettingFilePath == null)
            {
                return;
            }

            if (!File.Exists(this.GompertzSettingFilePath))
            {
                File.Create(this.GompertzSettingFilePath).Dispose();
                return;
            }



            _xml = new SettingsXml(this.GompertzSettingFilePath);
            _xml.OpenSection("Settings");

            foreach (PropertyInfo pi in this.GetType().GetProperties())
            {
                if (!pi.CanWrite) // Avoid putting data to read only property such as IsAutoRecipe
                {
                    continue;
                }

                // Loop through all properties and save them into config.
                if (pi.PropertyType == typeof(String))
                {
                    pi.SetValue(this, _xml.Read(pi.Name, (String)pi.GetValue(this, null)), null);
                }

                if (pi.PropertyType == typeof(Int32))
                {
                    pi.SetValue(this, _xml.Read(pi.Name, (Int32)pi.GetValue(this, null)), null);
                }

                if (pi.PropertyType == typeof(Double))
                {
                    pi.SetValue(this, _xml.Read(pi.Name, (Double)pi.GetValue(this, null)), null);
                }

                if (pi.PropertyType == typeof(Boolean))
                {
                    pi.SetValue(this, _xml.Read(pi.Name, (Boolean)pi.GetValue(this, null)), null);
                }

                if (pi.PropertyType.IsEnum == true)
                {
                    pi.SetValue(this, _xml.Read(pi.Name, (int)pi.GetValue(this, null)), null);
                }
            }

            //    SSEInitial = _xml.Read("SSEInitial",0.15);
            //    RSQInitial = _xml.Read("RSQInitial",96);
            amin = _xml.Read("amin", 0.01);
            amax = _xml.Read("amax", 0.4);
            bmin = _xml.Read("bmin", 2.0);
            bmax = _xml.Read("bmax", 7.0);
            cmin = _xml.Read("cmin", 0.3);
            cmax = _xml.Read("cmax", 2.0);
            dmin = _xml.Read("dmin", 9.0);
            dmax = _xml.Read("dmax", 16.0);
            //    randomscale = _xml.Read("randomscale",4);
            //    weight = _xml.Read("weight",1);
            //    adaptiveSearch_A = _xml.Read("adaptiveSearch_A",1);
            //    adaptiveSearch_B = _xml.Read("adaptiveSearch_B",5);
            //    adaptiveSearch_C = _xml.Read("adaptiveSearch_C",5);
            //    adaptiveSearch_D = _xml.Read("adaptiveSearch_D",5);
            //    HardLimit_RSQ = _xml.Read("HardLimit_RSQ",99);
            //    HardLimit_SSE = _xml.Read("HardLimit_SSE",0.06);
            //    MaxTest = _xml.Read("MaxTest",200);
            Step = _xml.Read("Step", 0.0001);
            //    Iteration = _xml.Read("Iteration",1500);
            UseGompertz = _xml.Read("UseGompertz", true);
            //    TestTimePerHGA = _xml.Read("TestTimePerHGA",2);
            GompertzCalMethod = _xml.Read("GompertzCalculationMethod", "Random") == "Random"? GompertzCalculationMethod.Random : GompertzCalculationMethod.Fix;
            Split             = _xml.Read("Split", 10);
            // _xml.Write("GompertzCalculationMethod", GompertzCalculationMethod.ToString());
            _xml.CloseSection();
        }
Ejemplo n.º 19
0
        public void Load()
        {
            xml.OpenSection("Counter");
            if (!int.TryParse(xml.Read("ProcessedHGACount", "0"), out processedHGACount))
            {
                processedHGACount = 0;
            }
            if (!double.TryParse(xml.Read("CycleTime", "0.0"), out cycleTime))
            {
                cycleTime = 0;
            }
            if (!int.TryParse(xml.Read("UPH", "0"), out uph))
            {
                uph = 0;
            }
            if (!int.TryParse(xml.Read("UPH2", "0"), out uph2))
            {
                uph2 = 0;
            }
            if (!DateTime.TryParse(xml.Read("StartDateTime", DateTime.Now.ToString()), out startDateTime))
            {
                startDateTime = DateTime.Now;
            }
            if (!int.TryParse(xml.Read("SamplingCounter", "0"), out _samplingCounter))
            {
                _samplingCounter = 0;
            }
            if (!DateTime.TryParse(xml.Read("LastSamplingReset", DateTime.Now.ToString()), out _lastSamplingCounterReset))
            {
                _lastSamplingCounterReset = DateTime.Now;
            }
            CarrierTriggeringData.Load("CarrierTriggeringData", xml);

            if (!int.TryParse(xml.Read("LastActiveSamplingPartCount", "0"), out _lastActiveSamplingPartCount))
            {
                _lastActiveSamplingPartCount = processedHGACount;
            }
            if (!int.TryParse(xml.Read("WRBridgeRunningPercentage", "0.0"), out _wrBridgeRunningPercentage))
            {
                _wrBridgeRunningPercentage = 0;
            }
            if (!double.TryParse(xml.Read("LastWRBridgePercentage", "0.0"), out _lastWRBridgePercentage))
            {
                _lastWRBridgePercentage = 0.0;
            }
            if (!int.TryParse(xml.Read("WriterBridgePartRunCounter", "0"), out _writerBridgePartRunCounter))
            {
                _writerBridgePartRunCounter = 0;
            }
            xml.CloseSection();
        }
Ejemplo n.º 20
0
        public void Load()
        {
            if (HSTMachine.Workcell.HSTSettings.SetupSettingsFilePath == null)
            {
                return;
            }

            if (!File.Exists(HSTMachine.Workcell.HSTSettings.SetupSettingsFilePath))
            {
                File.Create(HSTMachine.Workcell.HSTSettings.SetupSettingsFilePath).Dispose();
                return;
            }

            _xml = new SettingsXml(HSTMachine.Workcell.HSTSettings.SetupSettingsFilePath);
            _xml.OpenSection("Config");

            foreach (PropertyInfo pi in this.GetType().GetProperties())
            {
                if (!pi.CanWrite) // Avoid putting data to read only property such as IsAutoRecipe
                {
                    continue;
                }

                // Loop through all properties and save them into config.
                if (pi.PropertyType == typeof(String))
                {
                    pi.SetValue(this, _xml.Read(pi.Name, (String)pi.GetValue(this, null)), null);
                }

                if (pi.PropertyType == typeof(Int32))
                {
                    pi.SetValue(this, _xml.Read(pi.Name, (Int32)pi.GetValue(this, null)), null);
                }

                if (pi.PropertyType == typeof(Double))
                {
                    pi.SetValue(this, _xml.Read(pi.Name, (Double)pi.GetValue(this, null)), null);
                }

                if (pi.PropertyType == typeof(Boolean))
                {
                    pi.SetValue(this, _xml.Read(pi.Name, (Boolean)pi.GetValue(this, null)), null);
                }

                if (pi.PropertyType.IsEnum == true)
                {
                    pi.SetValue(this, _xml.Read(pi.Name, (int)pi.GetValue(this, null)), null);
                }
            }

            //EquipmentType = _xml.Read("EquipmentType", "ZCU");
            _xml.CloseSection();

            _xml.OpenSection("MoveProfile/InputEEZ/");
            MoveProfile.InputEEZ.Acceleration = int.Parse(_xml.Read("Acceleration", "0"));
            MoveProfile.InputEEZ.Deceleration = int.Parse(_xml.Read("Deceleration", "0"));
            MoveProfile.InputEEZ.Velocity     = int.Parse(_xml.Read("Velocity", "0"));
            _xml.CloseSection();

            _xml.OpenSection("MoveProfile/PrecisorX/");
            MoveProfile.PrecisorX.Acceleration = int.Parse(_xml.Read("Acceleration", "0"));
            MoveProfile.PrecisorX.Deceleration = int.Parse(_xml.Read("Deceleration", "0"));
            MoveProfile.PrecisorX.Velocity     = int.Parse(_xml.Read("Velocity", "0"));
            _xml.CloseSection();

            _xml.OpenSection("MoveProfile/PrecisorY/");
            MoveProfile.PrecisorY.Acceleration = int.Parse(_xml.Read("Acceleration", "0"));
            MoveProfile.PrecisorY.Deceleration = int.Parse(_xml.Read("Deceleration", "0"));
            MoveProfile.PrecisorY.Velocity     = int.Parse(_xml.Read("Velocity", "0"));
            _xml.CloseSection();

            _xml.OpenSection("MoveProfile/PrecisorTheta/");
            MoveProfile.PrecisorTheta.Acceleration = int.Parse(_xml.Read("Acceleration", "0"));
            MoveProfile.PrecisorTheta.Deceleration = int.Parse(_xml.Read("Deceleration", "0"));
            MoveProfile.PrecisorTheta.Velocity     = int.Parse(_xml.Read("Velocity", "0"));
            _xml.CloseSection();

            _xml.OpenSection("MoveProfile/TestProbeZ/");
            MoveProfile.TestProbeZ.Acceleration = int.Parse(_xml.Read("Acceleration", "0"));
            MoveProfile.TestProbeZ.Deceleration = int.Parse(_xml.Read("Deceleration", "0"));
            MoveProfile.TestProbeZ.Velocity     = int.Parse(_xml.Read("Velocity", "0"));
            _xml.CloseSection();

            _xml.OpenSection("MoveProfile/OutputEEZ/");
            MoveProfile.OutputEEZ.Acceleration = int.Parse(_xml.Read("Acceleration", "0"));
            MoveProfile.OutputEEZ.Deceleration = int.Parse(_xml.Read("Deceleration", "0"));
            MoveProfile.OutputEEZ.Velocity     = int.Parse(_xml.Read("Velocity", "0"));
            _xml.CloseSection();

            _xml.OpenSection("DelayTimer");
            Delay.VacuumOnDelay  = int.Parse(_xml.Read("VacuumOnDelay", "0"));
            Delay.VacuumOffDelay = int.Parse(_xml.Read("VacuumOffDelay", "0"));
            _xml.CloseSection();

            if (OnSettingsChanged != null)
            {
                OnSettingsChanged(this, null);
            }
        }
Ejemplo n.º 21
0
 public void Load(string section, SettingsXml xml)
 {
     xml.OpenSection(section);
     _lastActiveDate              = xml.Read("LastActiveDate", string.Empty);
     _counterBeforeTrig           = xml.Read("CounterBeforeTrig", 0);
     _counterAfterTrig            = xml.Read("CounterAfterTriggering", 0);
     _testPassCounter             = xml.Read("TestPassCounter", 0);
     _testFailCounter             = xml.Read("TestFailCounter", 0);
     _errorCumulative             = xml.Read("ErrorCumulative", 0.00);
     _totalPartRunCounter         = xml.Read("TotalPartRunCounter", 0);
     _buyOffProcessFinished       = xml.Read("BuyOffProcessFinished", true);
     _buyOffProcessStarted        = xml.Read("BuyOffProcessStarted", false);
     _criticalTriggeringActivated = xml.Read("CriticalTriggeringActivated", false);
     _samplingOverPercentageTriggeringActivated = xml.Read("SamplingTriggeringOverPercentage", false);
     xml.CloseSection();
 }
Ejemplo n.º 22
0
 public void Load(string section, SettingsXml xml)
 {
     xml.OpenSection(section);
     TicFailCounter                  = xml.Read("TicFailCounter", 0);
     HstFailCounter                  = xml.Read("HstFailCounter", 0);
     TicDefactCounter                = xml.Read("TicDefactCounter", 0);
     HstDefactCounter                = xml.Read("HstDefactCounter", 0);
     TicGoodPartCounter              = xml.Read("TicGoodPartCounter", 0);
     HstGoodPartCounter              = xml.Read("HstGoodPartCounter", 0);
     AdaptivePartRunCounter          = xml.Read("AdaptivePartRunCounter", 0);
     AdaptiveDefectCounter           = xml.Read("AdaptiveDefectCounter", 0);
     LastSaveLogTime                 = DateTime.ParseExact(xml.Read("LastSaveLogTime", (System.DateTime.Today.AddDays(-1)).ToString("dd-MMM-yy:HH:mm:ss")), "dd-MMM-yy:HH:mm:ss", null);
     MCDownTriggering                = xml.Read("MCDownTriggering", 0);
     TicHighPercentTriggeringCounter = 0;
     HstHighPercentTriggeringCounter = 0;
     InternalTriggerCounter          = xml.Read("InternalTriggerCounter", 0);
     uTICMachineName                 = xml.Read("uTICMachineName", "");
     xml.CloseSection();
 }
Ejemplo n.º 23
0
        // Methods -------------------------------------------------------------

        public void Load()
        {
            LastRunRecipeName = _xml.Read("LastRunRecipeName", String.Empty);
            AxesProfile.Load("MoveProfile", _xml);
            DelayTimer.Load("DelayTimer", _xml);
        }