Chronos Plugins 5.9.0
This documentation covers the plugin interfaces definitions and an example implementation.
Loading...
Searching...
No Matches
SampleListWorkerInterfaces.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3using System.Diagnostics.CodeAnalysis;
4using System.Runtime.InteropServices;
5
7{
11 [Guid("DE0FADCC-3542-45C9-BA28-7361B217E199")]
12 public interface IWorkWithSampleLists
13 {
21 {
22 get;
23 }
24
31 System.Drawing.Icon ButtonIcon
32 {
33 get;
34 }
35
44 void DoYourJob();
45 }
46
51 [Guid("9464FC41-CED6-4492-9587-C175755CCB45")]
62
66 [SuppressMessage("ReSharper", "InconsistentNaming")]
67 public class RunSampleListEventArgs : EventArgs
68 {
75 public string SampleListFile;
79 public bool StartAndWaitForEnd = true;
86 public bool OptimizationRun = false;
94 public bool ExtendLastPlanner = false;
99 public bool SwitchToSchedulesView = true;
103 public bool JustStartQueue = false;
107 public bool RespectSelection = true;
115 public int InsertAtJobIndex = -1;
116 }
117
126 public delegate Exception RunSampleListHandler(object sender, RunSampleListEventArgs args);
127
131 [Guid("4B615093-B9BD-4FE1-807E-7FAC56132B8F")]
139
146 [Guid("DDFAE9D1-1991-45DC-BAC9-22D2EA165753")]
154
158 public interface ISampleListAccessor
159 {
160
164 string DefaultMethodPath { get; }
165
169 string DefaultSampleListPath { get; }
170
175 void Save(string filename);
176
181 void Load(string filename);
182
186 IEnumerable<ISampleListLine> Lines { get; }
187
198 ISampleListLine Insert(int index = -1);
199
207 void RemoveAt(int index);
208
217
221 void EndUpdate();
222
226 void Clear();
232 IList<string> LoadSilently(string filename);
233
238 void Load(string[] filenames);
246 IList<string> LoadSilently(string[] filenames);
251 bool IsFocused { get; set; }
255 string Name { get; }
256
261 bool Close();
266
270 bool Equals(ISampleListAccessor someAccessor);
271 }
272
276 public interface ISampleListManager
277 {
281 IReadOnlyList<ISampleListAccessor> Lists { get; }
282
288 ISampleListAccessor CreateNew(string filename = "");
289
294
295 }
296
300 public interface ISampleListLine
301 {
305 string Method { get; set; }
306
310 Dictionary<string, ICellAccessor> Cells { get; }
311
315 bool IsSelected { get; }
316 }
317
321 public interface ICellAccessor
322 {
329 object Value { get; set; }
334 }
335}
Classes and interfaces that are meant for plugins. The classes and interfaces below this namespace ar...
delegate Exception RunSampleListHandler(object sender, RunSampleListEventArgs args)
Runs the given sample list.
Some hopefully useful information about a queued planner.
Definition Core.cs:84
Information about a column defined in a method.
For plugins that want to manipulate or run sample lists.
System.Drawing.Icon ButtonIcon
Shown in the button, preferred size 22x22.
void DoYourJob()
Will be triggered when the user clicks on the button. The button will be disabled until you return fr...
For automatic generation of sample lists and running the resulting schedules.
RunSampleListHandler RunSampleList
Trigger this event to actually create and run a schedule.
Parameters for sample list loading and schedule creation.
bool ExtendLastPlanner
Set this to true if you want to extend the last queued planner (or the one given in InjectIntoPlanner...
bool JustStartQueue
Ignore the other parameters, just start the schedule queue as it is.
bool StartAndWaitForEnd
If false, the schedule is just created and appended to the queue.
bool RespectSelection
Run only samples from the selected lines.
bool OptimizationRun
Try to optimize the task run times.
int InsertAtJobIndex
The zero based index for the job list where the new samples should be inserted. If -1,...
IPlannerInfo InjectIntoPlanner
Enables injection of jobs into a specific planner instead of only the last of the queue (see ExtendLa...
bool SwitchToSchedulesView
Use this to suppress the default behavior of switching to the schedules view when a schedule is start...
string SampleListFile
Full path to a sample list file which should be executed.
Implement this interface in your sample list worker class if you need access to the content of cells.
ISampleListAccessor SampleList
Provides a sample list access helper.
From Chronos 5.2 on, there can be multiple sample lists at once.
ISampleListManager SampleListsManager
You get access to the management functions here.
Provides basic sample list information and lets you iterate over all lines.
void Load(string filename)
Load from a file.
IList< string > LoadSilently(string filename)
Like Load, but does not show message boxes when there are problems.
void BeginUpdate()
Blocks all GUI updates to speed up batch operations.
bool Equals(ISampleListAccessor someAccessor)
overloading equals function
void Save(string filename)
Save to a file.
bool IsFocused
Read: Find out if this list is currently on top and visible to the user. Write: Try to make the list ...
string DefaultSampleListPath
User's default sample list path or null.
void RemoveAt(int index)
Removes a line from the list at the specified index.
void Load(string[] filenames)
Loads multiple files in one go, concatenating them.
string DefaultMethodPath
User's default method path or null.
bool Close()
Try to close this list, asking the user in case there are unsaved changes.
IEnumerable< ISampleListLine > Lines
Gives access to all currently available lines.
void CloseSilently()
Close this list, discarding any unsaved changes.
void Clear()
Removes all lines from the sample list, except the one empty line always present in a new list.
ISampleListLine Insert(int index=-1)
Inserts a new line into the sample list.
IList< string > LoadSilently(string[] filenames)
Same as LoadSilently(string), just for multiple files.
Access to all sample lists, adding of new sample lists.
ISampleListAccessor CreateNew(string filename="")
Creates a new sample list, appending it to the Lists available.
ISampleListAccessor FocusedList
The currently topmost/focused list.
IReadOnlyList< ISampleListAccessor > Lists
From Chronos 5.2 on, there can be multiple sample list opened at the same time.
string Method
The only fixed column: Analysis Method. The content of this property determines which other columns a...
Dictionary< string, ICellAccessor > Cells
Gives access to any cell by specifying the column name.
bool IsSelected
Is the line currently marked as selected in the sample list grid?
object Value
Tries to set the cell's value from the given object.
IColumnInfo Column
Information about the column this cell belongs to.