/// <summary>
        /// Creates xml string from the general settings to send to QTM
        ///</summary>
        /// <param name="generalSettings">generl settings to generate string from</param>
        /// <param name="setProcessingActions">if string should include processing actions or not</param>
        /// <returns>generated xml string from settings</returns>
        public static string SetGeneralSettings(SettingsGeneral generalSettings, bool setProcessingActions = false)
        {
            StringWriter xmlString = new StringWriter();
            XmlWriterSettings settings = new XmlWriterSettings();
            settings.OmitXmlDeclaration = true;
            settings.ConformanceLevel = ConformanceLevel.Fragment;
            XmlWriter xmlWriter = XmlWriter.Create(xmlString, settings);

            xmlWriter.WriteStartElement("QTM_Settings");
            {
                xmlWriter.WriteStartElement("General");
                {
                    xmlWriter.WriteElementString("Frequency", generalSettings.captureFrequency.ToString());
                    xmlWriter.WriteElementString("Capture_Time", generalSettings.captureTime.ToString("0.000"));
                    xmlWriter.WriteElementString("Start_On_ExternalTrigger", generalSettings.startOnExternalTrigger.ToString());
                    if (setProcessingActions)
                    {
                        xmlWriter.WriteStartElement("Processing_Actions");
                        switch (generalSettings.processingActions.TrackingActions)
                        {
                            case SettingsTrackingProcessingActions.ProcessingTracking2D:
                                xmlWriter.WriteElementString("Tracking", "2D");
                                break;
                            case SettingsTrackingProcessingActions.ProcessingTracking3D:
                                xmlWriter.WriteElementString("Tracking", "3D");
                                break;
                            default:
                                xmlWriter.WriteElementString("Tracking", "False");
                                break;
                        }

                        xmlWriter.WriteElementString("TwinSystemMerge", generalSettings.processingActions.TwinSystemMerge.ToString());
                        xmlWriter.WriteElementString("SplineFill", generalSettings.processingActions.SplineFill.ToString());
                        xmlWriter.WriteElementString("AIM", generalSettings.processingActions.Aim.ToString());
                        xmlWriter.WriteElementString("Track6DOF", generalSettings.processingActions.Track6DOF.ToString());
                        xmlWriter.WriteElementString("ForceData", generalSettings.processingActions.ForceData.ToString());
                        xmlWriter.WriteElementString("ExportTSV", generalSettings.processingActions.ExportTSV.ToString());
                        xmlWriter.WriteElementString("ExportC3D", generalSettings.processingActions.ExportC3D.ToString());
                        xmlWriter.WriteElementString("ExportMatlabFile", generalSettings.processingActions.ExportMatlab.ToString());
                        xmlWriter.WriteEndElement();

                    }
                }
                xmlWriter.WriteEndElement();
            }
            xmlWriter.WriteEndElement();

            return xmlString.ToString();
        }
 /// <summary>
 /// Get general settings from QTM Server and saves data in protocol
 ///</summary>
 /// <returns>returns true if settings was retrieved</returns>
 public bool GetGeneralSettings()
 {
     if (SendCommand("GetParameters general"))
     {
         string xmlString = mPacket.GetXMLString();
         mGeneralSettings = ReadGeneralSettings(xmlString);
         if (mGeneralSettings != null)
             return true;
     }
     return false;
 }