public MinStatistics(IEnumerable <Replicate> replicates) { Replicates = replicates.ToArray(); OriginalFileSize = Replicates.Select(r => r.OriginalFileSize).Sum(); var processedFileSize = Replicates.Select(r => r.ProcessedFileSize).Sum(); PercentComplete = (int)(100 * processedFileSize / OriginalFileSize); }
private void ReplicatePropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { if (e.PropertyName == "DeleteRequested") { var parameter = sender as DeletableParameter; if (parameter != null) { using (Replicates.AcquireLock()) { Replicates.Remove(parameter); parameter.PropertyChanged -= ReplicatePropertyChanged; } } RaisePropertyChanged("HasReplicates"); } RaisePropertyChanged("CommandSyntax"); }
public override XDocument GetCommand() { var doc = new XDocument(); var root = new XElement("PauseSamples"); doc.Add(root); using (Replicates.AcquireLock()) { foreach (DeletableParameter replicate in Replicates) { var replicateElement = replicate.GetElementAttributeForm(replicate.TagName); root.Add(replicateElement); } } return(doc); }
private void OnAddReplicate() { var replicate = new DeletableParameter() { TagName = "Replicate" }; using (Replicates.AcquireLock()) { Replicates.Add(replicate); replicate.PropertyChanged += ReplicatePropertyChanged; replicate.AddParameter("Mass", "The replicate mass.", "1.0"); replicate.AddParameter("Comments", "The replicate comments.", ""); replicate.AddParameter("Location", "The replicate location when using a shuttle loader automation system. This parameter is optional.", ""); } RaisePropertyChanged("HasReplicates"); RaisePropertyChanged("CommandSyntax"); }
private void OnAddReplicate() { var replicate = new DeletableParameter() { TagName = "Replicate" }; using (Replicates.AcquireLock()) { Replicates.Add(replicate); replicate.PropertyChanged += ReplicatePropertyChanged; replicate.AddParameter("SetKey", "The unique key that identifies the set containing the replicate whose paused state is being modified. Leading zeros may be omitted.", "0"); replicate.AddParameter("Tag", "The identifier of the replicate within the set whose paused state is being modified.", "0"); replicate.AddParameter("Paused", "Indicates if the replicate is to be paused or not. Valid values are \"ManuallyPaused\" and \"NotPaused\".", "ManuallyPaused"); } RaisePropertyChanged("HasReplicates"); RaisePropertyChanged("CommandSyntax"); }
public override XDocument GetCommand() { var doc = new XDocument(); var root = new XElement("AddSamples"); doc.Add(root); if (AddToNewSet) { using (NewSetParameters.AcquireLock()) { var setElement = new XElement("Set"); root.Add(setElement); foreach (var setParameter in NewSetParameters) { var element = new XElement("Field") { Value = setParameter.AsString }; element.SetAttributeValue("Id", setParameter.Name); setElement.Add(element); } } } else { using (ExistingSetParameters.AcquireLock()) { foreach (var existingParameter in ExistingSetParameters) { var element = new XElement(existingParameter.Name) { Value = existingParameter.AsString }; root.Add(element); } } } using (Replicates.AcquireLock()) { var replicatesElement = new XElement("Replicates"); root.Add(replicatesElement); foreach (var replicate in Replicates) { var replicateElement = new XElement("Replicate"); replicatesElement.Add(replicateElement); using (replicate.Parameters.AcquireLock()) { foreach (var repParameter in replicate.Parameters) { var element = new XElement("Field") { Value = repParameter.AsString }; element.SetAttributeValue("Id", repParameter.Name); replicateElement.Add(element); } } } } return(doc); }