Chronos Plugins 5.4.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")]
53 {
61 }
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;
93 public bool ExtendLastPlanner = false;
98 public bool SwitchToSchedulesView = true;
102 public bool JustStartQueue = false;
106 public bool RespectSelection = true;
107 }
108
117 public delegate Exception RunSampleListHandler(object sender, RunSampleListEventArgs args);
118
122 [Guid("4B615093-B9BD-4FE1-807E-7FAC56132B8F")]
124 {
129 }
130
137 [Guid("DDFAE9D1-1991-45DC-BAC9-22D2EA165753")]
139 {
144 }
145
149 public interface ISampleListAccessor
150 {
151
155 string DefaultMethodPath { get; }
156
160 string DefaultSampleListPath { get; }
161
166 void Save(string filename);
167
172 void Load(string filename);
173
177 IEnumerable<ISampleListLine> Lines { get; }
178
189 ISampleListLine Insert(int index = -1);
190
198 void RemoveAt(int index);
199
208
212 void EndUpdate();
213
217 void Clear();
223 IList<string> LoadSilently(string filename);
224
229 void Load(string[] filenames);
237 IList<string> LoadSilently(string[] filenames);
242 bool IsFocused { get; set; }
246 string Name { get; }
247
252 bool Close();
257
261 bool Equals(ISampleListAccessor someAccessor);
262 }
263
267 public interface ISampleListManager
268 {
272 IReadOnlyList<ISampleListAccessor> Lists { get; }
273
279 ISampleListAccessor CreateNew(string filename = "");
280
285
286 }
287
291 public interface ISampleListLine
292 {
296 string Method { get; set; }
297
301 Dictionary<string, ICellAccessor> Cells { get; }
302 }
303
307 public interface ICellAccessor
308 {
315 object Value { get; set; }
320 }
321}
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.
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...
string ButtonCaption
Shown on the sample list page.
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 if possible instead of creating a new ...
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.
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.
object Value
Tries to set the cell's value from the given object.
IColumnInfo Column
Information about the column this cell belongs to.