Class PlanClient
Inheritance
System.Object
PlanClient
Implements
System.IDisposable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: TM.dll
Syntax
public class PlanClient : Client, IDisposable
Constructors
|
Improve this Doc
View Source
PlanClient()
Declaration
Fields
|
Improve this Doc
View Source
This
Declaration
public static PlanClient This
Field Value
Properties
|
Improve this Doc
View Source
IsFinished
True - plan processing is finished
Declaration
public bool IsFinished { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
IsPlanLoaded
Declaration
public bool IsPlanLoaded { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
IsProcessing
True - plan processing is ON
Declaration
public bool IsProcessing { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
IsReady
True - server is ready
Declaration
public bool IsReady { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Plan
Loaded plan data
Declaration
public List<Spot> Plan { get; set; }
Property Value
Type |
Description |
System.Collections.Generic.List<Spot> |
The plan. |
|
Improve this Doc
View Source
PlanResults
Results of plan processing
Declaration
public List<SpotResult> PlanResults { get; set; }
Property Value
Type |
Description |
System.Collections.Generic.List<SpotResult> |
The plan results. |
|
Improve this Doc
View Source
PlanState
Gets the processing state of the server.
Declaration
public EPlanState PlanState { get; protected set; }
Property Value
Type |
Description |
EPlanState |
The state of processing on the server. |
|
Improve this Doc
View Source
SpotsPassed
Gets the number of spots processed.
Declaration
public uint SpotsPassed { get; }
Property Value
Type |
Description |
System.UInt32 |
The spots passed. |
|
Improve this Doc
View Source
SpotsTotal
Gets the number of spots total in plan.
Declaration
public uint SpotsTotal { get; }
Property Value
Type |
Description |
System.UInt32 |
The spots total. |
Methods
|
Improve this Doc
View Source
AskServerState()
SendCommand(EPlanCommand.GETSTATE); to the server.
Declaration
public bool AskServerState()
Returns
Type |
Description |
System.Boolean |
true if OK, false otherwise. |
|
Improve this Doc
View Source
Clear()
Clears the plan data
Declaration
public virtual bool Clear()
Returns
Type |
Description |
System.Boolean |
true if OK, false otherwise. |
|
Improve this Doc
View Source
ClearPlan()
Clear plan loaded locally
Declaration
|
Improve this Doc
View Source
Disconnect()
Override Disconnect from server
Declaration
public override bool Disconnect()
Returns
Type |
Description |
System.Boolean |
|
Overrides
|
Improve this Doc
View Source
Dump()
Dumps the plan results.
Declaration
public virtual void Dump()
|
Improve this Doc
View Source
Dump(List<Spot>)
Dumps the plan data.
Declaration
public static void Dump(List<Spot> plan)
Parameters
Type |
Name |
Description |
System.Collections.Generic.List<Spot> |
plan |
The plan data. |
|
Improve this Doc
View Source
Dump(List<SpotResult>)
Dumps the plan results.
Declaration
public static void Dump(List<SpotResult> results)
Parameters
Type |
Name |
Description |
System.Collections.Generic.List<SpotResult> |
results |
The results. |
|
Improve this Doc
View Source
Execute(String, String, Int32)
LoadPlan(file) - loads the specified file with plan data.
SendPlan() - sends plan to the server specified by ip nad port
StartPlan() - starts plan processing on the server
while (ProcessingIsOn) - waits for results of processing
when results of plan processing received from server, fills PlanResults list
if (ServerState == EPlanState.FINISHED) - execute PlanFinished() event
Declaration
public virtual List<SpotFull> Execute(string file, string ip = null, int port = 0)
Parameters
Type |
Name |
Description |
System.String |
file |
The file with plan data. |
System.String |
ip |
The server IP. |
System.Int32 |
port |
The port. |
Returns
Type |
Description |
System.Collections.Generic.List<SpotFull> |
Dictionary<System.Int32, SpotFull>. |
|
Improve this Doc
View Source
Load(String)
Reads the file and loads the plan data.
Declaration
public virtual List<Spot> Load(string file)
Parameters
Type |
Name |
Description |
System.String |
file |
The file with plan data. |
Returns
Type |
Description |
System.Collections.Generic.List<Spot> |
BufferChunk. The raw array of bytes |
Exceptions
Type |
Condition |
System.IO.FileNotFoundException |
|
ReadPlanException |
|
System.IO.FileNotFoundException |
|
|
Improve this Doc
View Source
LoadPlan(String)
Load plan from file
Declaration
public static List<Spot> LoadPlan(string file)
Parameters
Type |
Name |
Description |
System.String |
file |
|
Returns
Type |
Description |
System.Collections.Generic.List<Spot> |
|
|
Improve this Doc
View Source
Pause()
Pauses the plan processing on server.
Declaration
public virtual bool Pause()
Returns
Type |
Description |
System.Boolean |
true if OK, false otherwise. |
|
Improve this Doc
View Source
ProcessData(BufferChunk, Int32)
Override Client.ProcessData - to process incoming data from server
Declaration
public override void ProcessData(BufferChunk data, int bytesRead)
Parameters
Type |
Name |
Description |
BufferChunk |
data |
The data. |
System.Int32 |
bytesRead |
The bytes read. |
Overrides
|
Improve this Doc
View Source
ProcessState(StateData)
Override Client.ProcessState - to process server changed state
Declaration
public override void ProcessState(StateData data)
Parameters
Overrides
|
Improve this Doc
View Source
Reset()
Declaration
public override void Reset()
Overrides
|
Improve this Doc
View Source
Send()
Sends the loaded plan to server.
Declaration
public virtual bool Send()
Returns
Type |
Description |
System.Boolean |
true if OK, false otherwise. |
|
Improve this Doc
View Source
Send(List<Spot>, UInt32)
Sends the plan to server.
Declaration
public virtual bool Send(List<Spot> spots, uint nblocks = 10U)
Parameters
Type |
Name |
Description |
System.Collections.Generic.List<Spot> |
spots |
The spots. |
System.UInt32 |
nblocks |
The nblocks. |
Returns
Type |
Description |
System.Boolean |
true if OK, false otherwise. |
Exceptions
|
Improve this Doc
View Source
Send(Object[])
Sends the plan as array of PSObjects to remote server
Declaration
public virtual bool Send(object[] arr)
Parameters
Type |
Name |
Description |
System.Object[] |
arr |
The array of PSObjects. |
Returns
Type |
Description |
System.Boolean |
true if success, false otherwise. |
|
Improve this Doc
View Source
SendCommand(EPlanCommand, EServerType)
Sends the EPlanCommand to server.
public enum EPlanCommand
{
[Description("запрос на статус сервера")]
GETSTATE = 1,
[Description("запрос на очистку плана ")]
CLEARPLAN = 2,
[Description("запрос на старт плана ")]
STARTPLAN = 3,
[Description("запрос на паузу")]
PAUSEPLAN = 4,
[Description("запрос на останов")]
STOPPLAN = 5
}
Declaration
public virtual bool SendCommand(EPlanCommand cmd, EServerType server_type = EServerType.MCS)
Parameters
Returns
Type |
Description |
System.Boolean |
true on success, false otherwise. |
Exceptions
|
Improve this Doc
View Source
Start()
Starts the plan processing on remote server.
Declaration
public virtual bool Start()
Returns
Type |
Description |
System.Boolean |
true if OK, false otherwise. |
|
Improve this Doc
View Source
Stop()
Stops the plan processing on remote server.
Declaration
public virtual bool Stop()
Returns
Type |
Description |
System.Boolean |
true if OK, false otherwise. |
Events
|
Improve this Doc
View Source
PlanCleared
Occurs when [plan cleared].
Declaration
public event ClientHandler PlanCleared
Event Type
Type |
Description |
ClientHandler |
|
|
Improve this Doc
View Source
PlanFinished
Occurs when [plan processing is finished].
Declaration
public event ClientHandler PlanFinished
Event Type
Type |
Description |
ClientHandler |
|
|
Improve this Doc
View Source
PlanInProcess
Occurs when [plan is being processed].
Declaration
public event StateHandler PlanInProcess
Event Type
Type |
Description |
StateHandler |
|
|
Improve this Doc
View Source
PlanLoaded
Occurs when [plan loaded].
Declaration
public event ClientHandler PlanLoaded
Event Type
Type |
Description |
ClientHandler |
|
|
Improve this Doc
View Source
PlanPaused
Occurs when [plan paused].
Declaration
public event ClientHandler PlanPaused
Event Type
Type |
Description |
ClientHandler |
|
|
Improve this Doc
View Source
PlanResultsProcessed
Occurs when part of [plan results processed and received].
Declaration
public event PlanResultsHandler PlanResultsProcessed
Event Type
|
Improve this Doc
View Source
PlanStarted
Occurs when [plan started].
Declaration
public event ClientHandler PlanStarted
Event Type
Type |
Description |
ClientHandler |
|
|
Improve this Doc
View Source
PlanStopped
Occurs when [plan stopped].
Declaration
public event ClientHandler PlanStopped
Event Type
Type |
Description |
ClientHandler |
|
Implements
System.IDisposable