public override enExperimentStatus Configure(string resultsFilePath) { if ((Settings.Channel != null) && (transducerChannels.ContainsKey(Settings.Channel))) { //ITransducer transducer = HWStore[Settings.Channel.Split('.').First()] as ITransducer; ResultsFilePath = resultsFilePath; ResultsFileName = "SingleValueExperiment - " + Name + ".dat"; channel = transducerChannels[Settings.Channel]; string headerString = "Experiment: SingleValueExperiment - " + Name + "\r\n"; headerString += "Channel: " + Settings.Channel + "\r\n"; headerString += "Name: " + channel.Name + "\r\n"; string unit = (channel.Prefix == enuPrefix.none) ? channel.Unit : channel.Prefix + channel.Unit; headerString += "Unit: " + unit + "\r\n"; writeHeader(headerString, new string[] { channel.Name + " [" + unit + "]" }); status = enExperimentStatus.Idle; return(status); } log.Add("No Transducer Channel Selected or Invalid Configuration", "Error"); return(enExperimentStatus.Error); }
public override enExperimentStatus Configure(IExperiment parent, string resultsFilePath) { this.parent = parent; ResultsFilePath = resultsFilePath; ResultsFileName = "SetSingleValue - " + Name + ".dat"; activeChannels = new List <TransducerChannel>(); foreach (string chan in Settings.Channels) { if ((chan != null) && (chan != "NONE") && (transducerChannels.ContainsKey(chan))) { //ITransducer transducer = HWStore[Settings.Channel.Split('.').First()] as ITransducer; TransducerChannel channel = transducerChannels[chan]; activeChannels.Add(channel); } } if (activeChannels.Count == 0) { log.Add("No transducer channel selected or invalid configuration", "Error"); return(enExperimentStatus.Error); } status = enExperimentStatus.Idle; return(status); }
public override enExperimentStatus Configure(IExperiment parent, string resultsFilePath) { FBC = new FeedbackController(log); FBC.Settings = Settings.FeedbackController; FBC.FBPositionUpdated += FBC_FBPositionUpdated; if (!FBC.Initialize().HasFlag(enuFeedbackStatusFlags.Ready)) { return(enExperimentStatus.Error); } this.parent = parent; ResultsFilePath = resultsFilePath; string cords = ""; ExperimentContainer container = parent as ExperimentContainer; this.parent = parent; if (container != null) { cords = container.ChildIndexer(); if (cords != "") { cords = " " + cords; } } ResultsFileName = "AutoapproachExperiment - " + Name + cords + ".dat"; TransducerChannel signalChan = FBC.Settings.TransducerChannels[FBC.Settings.Channel]; string headerString = "Experiment: AutoapproachExperiment - " + Name + "\r\n"; string unit = (signalChan.Prefix == enuPrefix.none) ? signalChan.Unit : signalChan.Prefix + signalChan.Unit; string[] dataColumnHeaders = new string[] { "Z-Position [µm]", signalChan.Name + " [" + unit + "]" }; headerString += "Positioner: " + FBC.Settings.Positioner + "\r\n"; headerString += "Sensor: " + FBC.Settings.Channel + "\r\n"; writeHeader(headerString, dataColumnHeaders.ToArray(), settingsObj: Settings, positionColumns: false, timeColumn: true); // Init ResultData experimentData = new Generic2DExperimentData(); experimentData.axisNames.Add(new string[] { "Z-Position", signalChan.Name }); experimentData.axisUnits.Add(new string[] { "µm", unit }); experimentData.data.Add(new double[2][]); signalData = new List <double>(128); positionData = new List <double>(128); experimentData.datasetNames.Add("Autoapproach"); experimentData_PA = new Generic2DExperimentData(); experimentData_PA.axisNames.Add(new string[] { "Time", signalChan.Name }); experimentData_PA.axisUnits.Add(new string[] { "s", unit }); experimentData_PA.data.Add(new double[2][]); signalData_PA = new List <double>(128); timeData_PA = new List <double>(128); experimentData_PA.datasetNames.Add("Post approach"); status = enExperimentStatus.Idle; return(status); }
public override enExperimentStatus Configure(IExperiment parent, string resultsFilePath) { this.parent = parent; ResultsFilePath = resultsFilePath; ResultsFileName = "SingleValueExperiment - " + Name + ".dat"; activeChannels = new List <TransducerChannel>(); string headerString = "Experiment: SingleValueExperiment - " + Name + "\r\n"; List <string> dataColumnHeaders = new List <string>(); int i = 0; int j = 0; // Add Columns for realtive position if parent is a Scan if (parent != null) { dataColumnHeaders.Add("∆X [µm]"); dataColumnHeaders.Add("∆Y [µm]"); dataColumnHeaders.Add("∆Z [µm]"); } foreach (string chan in Settings.Channels) { if ((chan != null) && (chan != "NONE") && (transducerChannels.ContainsKey(chan))) { i++; //ITransducer transducer = HWStore[Settings.Channel.Split('.').First()] as ITransducer; TransducerChannel channel = transducerChannels[chan]; activeChannels.Add(channel); channel.Averaging = Settings.ChannelsAvging[j]; headerString += "Channel [" + i + "]: " + chan + "\r\n"; headerString += "Channel [" + i + "] Name: " + channel.Name + "\r\n"; string unit = (channel.Prefix == enuPrefix.none) ? channel.Unit : channel.Prefix + channel.Unit; headerString += "Channel [" + i + "] Unit: " + unit + "\r\n"; dataColumnHeaders.Add(channel.Name + " [" + unit + "]"); } j++; } writeHeader(headerString, dataColumnHeaders.ToArray(), null, true, true); if (activeChannels.Count == 0) { log.Add("No Transducer Channel Selected or Invalid Configuration", "Error"); return(enExperimentStatus.Error); } status = enExperimentStatus.Idle; return(status); }
public override enExperimentStatus Configure(IExperiment parent, string resultsFilePath) { this.parent = parent; ResultsFilePath = resultsFilePath; ResultsFileName = "TimeTraceExperiment - " + Name + ".dat"; activeChannels = new List <TransducerChannel>(); string headerString = "Experiment: TimeTraceExperiment - " + Name + "\r\n"; List <string> dataColumnHeaders = new List <string>(); int i = 0; dataColumnHeaders.Add("Time [s]"); foreach (string chan in Settings.InputChannelSettings.Channels) { if ((chan != null) && (chan != "NONE") && (transducerChannels.ContainsKey(chan))) { i++; //ITransducer transducer = HWStore[Settings.Channel.Split('.').First()] as ITransducer; TransducerChannel channel = transducerChannels[chan]; activeChannels.Add(channel); headerString += "Channel [" + i + "]: " + chan + "\r\n"; headerString += "Channel [" + i + "] Name: " + channel.Name + "\r\n"; string unit = (channel.Prefix == enuPrefix.none) ? channel.Unit : channel.Prefix + channel.Unit; headerString += "Channel [" + i + "] Unit: " + unit + "\r\n"; dataColumnHeaders.Add(channel.Name + " [" + unit + "]"); } } writeHeader(headerString, dataColumnHeaders.ToArray(), positionColumns: false); if (activeChannels.Count == 0) { log.Add("No Transducer Channel Selected or Invalid Configuration", "Error"); return(enExperimentStatus.Error); } status = enExperimentStatus.Idle; return(status); }
private void ExecuteSetSingleValue() { double[] values = Settings.Values; for (int i = 0; i < Settings.Channels.Count(); i++) { string chan = Settings.Channels[i]; if ((chan != null) && (chan != "NONE")) { TransducerChannel channel = transducerChannels[chan]; channel.SetValue(values[i]); } } status = enExperimentStatus.Idle; NotifyExperimentEndedNow(new ExperimentEndedEventArgs(enExperimentStatus.Completed, null)); }