Definition at line 17 of file SDK.cs.
◆ SDK()
◆ CloseSession()
| int BioImager.SDK.CloseSession |
( |
int | sessionID | ) |
|
Definition at line 349 of file SDK.cs.
350 {
352 }
static int PriorScientificSDK_CloseSession(int sessionID)
◆ Cmd()
| int BioImager.SDK.Cmd |
( |
int | session, |
|
|
string | usertx, |
|
|
ref string | userrx, |
|
|
bool | displayError = true ) |
Definition at line 354 of file SDK.cs.
355 {
356 int ret;
357
358 StringBuilder tx = new StringBuilder();
359 StringBuilder rx = new StringBuilder();
360
361 tx.Append(usertx);
363
364 if (ret == Prior.PRIOR_OK)
365 {
366 userrx = rx.ToString();
367 }
368 else
369 {
370 if (displayError)
371 {
372 MessageBox.Show("Sent " + usertx + "\rSDK error: " + ret.ToString() );
373 }
374 }
375
376 return ret;
377 }
static int PriorScientificSDK_cmd(int session, StringBuilder tx, StringBuilder rx)
◆ GetNosePiece()
| int BioImager.SDK.GetNosePiece |
( |
| ) |
|
Definition at line 235 of file SDK.cs.
236 {
237 if ((err = priorSDK.
Cmd(sessionID,
"controller.nosepiece.position.get", ref userRx)) != Prior.PRIOR_OK)
238 {
239 throw new Exception(err.ToString());
240 }
241 return int.Parse(userRx);
242 }
int Cmd(int session, string usertx, ref string userrx, bool displayError=true)
◆ GetNosePiecePositions()
| int BioImager.SDK.GetNosePiecePositions |
( |
| ) |
|
Definition at line 243 of file SDK.cs.
244 {
245 if ((err = priorSDK.
Cmd(sessionID,
"controller.nosepiece.no-of-positions.get", ref userRx)) != Prior.PRIOR_OK)
246 {
247 throw new Exception(err.ToString());
248 }
249 return int.Parse(userRx);
250 }
◆ GetPosition()
| PointD BioImager.SDK.GetPosition |
( |
| ) |
|
Definition at line 156 of file SDK.cs.
157 {
158 if ((err = priorSDK.
Cmd(sessionID,
"controller.stage.position.get", ref userRx)) != Prior.PRIOR_OK)
159 {
161 }
162 string[] sts = userRx.Split(' ');
163 double dx = double.Parse(sts[0]);
164 double yx = double.Parse(sts[1]);
166 }
◆ GetPosition3D()
| Point3D BioImager.SDK.GetPosition3D |
( |
| ) |
|
Definition at line 191 of file SDK.cs.
192 {
193 if ((err = priorSDK.
Cmd(sessionID,
"controller.stage.position.get", ref userRx)) != Prior.PRIOR_OK)
194 {
195 throw new Exception(err.ToString());
196 }
197 string[] sts = userRx.Split(' ');
198 double dx = double.Parse(sts[0]);
199 double yx = double.Parse(sts[1]);
200 if ((err = priorSDK.
Cmd(sessionID,
"controller.z.position.get", ref userRx)) != Prior.PRIOR_OK)
201 {
202 throw new Exception(err.ToString());
203 }
204 double zx = double.Parse(userRx);
205 return new Point3D(dx, yx, zx);
206 }
◆ GetVersion()
| int BioImager.SDK.GetVersion |
( |
StringBuilder | version | ) |
|
Definition at line 334 of file SDK.cs.
335 {
337 }
static int PriorScientificSDK_Version(StringBuilder version)
◆ GetZ()
| double BioImager.SDK.GetZ |
( |
| ) |
|
Definition at line 217 of file SDK.cs.
218 {
219 if ((err = priorSDK.
Cmd(sessionID,
"controller.z.position.get", ref userRx)) != Prior.PRIOR_OK)
220 {
221 throw new Exception(err.ToString());
222 }
223 return double.Parse(userRx);
224 }
◆ Initialise()
| int BioImager.SDK.Initialise |
( |
| ) |
|
Definition at line 339 of file SDK.cs.
340 {
342 }
static int PriorScientificSDK_Initialise()
◆ InitialiseStage()
| int BioImager.SDK.InitialiseStage |
( |
| ) |
|
Definition at line 119 of file SDK.cs.
120 {
121
122
123
124
125 if ((err = priorSDK.
Cmd(sessionID,
"controller.stage.move-at-velocity " +
126 (-10000).ToString() + " " + (-10000).ToString(), ref userRx)) != Prior.PRIOR_OK)
127 {
128 return 1;
129 }
130
132
133
134 if ((err = priorSDK.
Cmd(sessionID,
"controller.stage.position.set 0 0", ref userRx)) != Prior.PRIOR_OK)
135 {
136 return 1;
137 }
139
140 if ((err = priorSDK.
Cmd(sessionID,
"controller.stage.goto-position 1000 1000", ref userRx)) != Prior.PRIOR_OK)
141 {
142 return 1;
143 }
144
145 return 0;
146 }
void waitUntilStageIdle()
◆ nosePieceBusy()
| int BioImager.SDK.nosePieceBusy |
( |
| ) |
|
Definition at line 270 of file SDK.cs.
271 {
272 if ((err = priorSDK.
Cmd(sessionID,
"controller.nosepiece.busy.get", ref userRx)) != Prior.PRIOR_OK)
273 {
274 return 0;
275 }
276 else
277 return Convert.ToInt32(userRx);
278 }
◆ OpenSession()
| int BioImager.SDK.OpenSession |
( |
| ) |
|
Definition at line 344 of file SDK.cs.
345 {
347 }
static int PriorScientificSDK_OpenNewSession()
◆ PriorScientificSDK_CloseSession()
| static int BioImager.SDK.PriorScientificSDK_CloseSession |
( |
int | sessionID | ) |
|
◆ PriorScientificSDK_cmd()
| static int BioImager.SDK.PriorScientificSDK_cmd |
( |
int | session, |
|
|
StringBuilder | tx, |
|
|
StringBuilder | rx ) |
◆ PriorScientificSDK_Initialise()
| static int BioImager.SDK.PriorScientificSDK_Initialise |
( |
| ) |
|
◆ PriorScientificSDK_OpenNewSession()
| static int BioImager.SDK.PriorScientificSDK_OpenNewSession |
( |
| ) |
|
◆ PriorScientificSDK_Version()
| static int BioImager.SDK.PriorScientificSDK_Version |
( |
StringBuilder | version | ) |
|
◆ SetNosePiece()
| bool BioImager.SDK.SetNosePiece |
( |
int | d | ) |
|
Definition at line 225 of file SDK.cs.
226 {
228 if ((err = priorSDK.
Cmd(sessionID,
"controller.nosepiece.position.set " + d, ref userRx)) != Prior.PRIOR_OK)
229 {
230 throw new Exception(err.ToString());
231 }
233 return true;
234 }
void waitUntilNosePieceIdle()
◆ SetObjective()
| bool BioImager.SDK.SetObjective |
( |
int | p | ) |
|
Definition at line 181 of file SDK.cs.
182 {
184 if ((err = priorSDK.
Cmd(sessionID,
"controller.nosepiece.goto-position " + p, ref userRx)) != Prior.PRIOR_OK)
185 {
186 return false;
187 }
189 return true;
190 }
◆ SetPosition() [1/2]
| bool BioImager.SDK.SetPosition |
( |
Point3D | p | ) |
|
Definition at line 167 of file SDK.cs.
168 {
169 if ((err = priorSDK.
Cmd(sessionID,
"controller.stage.position.set " + p.X +
" " + p.Y, ref userRx)) != Prior.PRIOR_OK)
170 {
171 return false;
172 }
174 if ((err = priorSDK.
Cmd(sessionID,
"controller.z.position.set " + p.Z, ref userRx)) != Prior.PRIOR_OK)
175 {
176 throw new Exception(err.ToString());
177 }
179 return true;
180 }
◆ SetPosition() [2/2]
| bool BioImager.SDK.SetPosition |
( |
PointD | p | ) |
|
Definition at line 147 of file SDK.cs.
148 {
149 if ((err = priorSDK.
Cmd(sessionID,
"controller.stage.position.set "+ p.X +
" " + p.Y, ref userRx)) != Prior.PRIOR_OK)
150 {
151 return false;
152 }
154 return true;
155 }
◆ SetZ()
| bool BioImager.SDK.SetZ |
( |
double | d | ) |
|
Definition at line 207 of file SDK.cs.
208 {
210 if ((err = priorSDK.
Cmd(sessionID,
"controller.z.position.set " + d, ref userRx)) != Prior.PRIOR_OK)
211 {
212 throw new Exception(err.ToString());
213 }
215 return true;
216 }
◆ shutterClose()
| bool BioImager.SDK.shutterClose |
( |
| ) |
|
Definition at line 288 of file SDK.cs.
289 {
290 if ((err = priorSDK.
Cmd(sessionID,
"controller.shutter.close", ref userRx)) != Prior.PRIOR_OK)
291 {
292 return false;
293 }
294 else
295 return true;
296 }
◆ shutterOpen()
| bool BioImager.SDK.shutterOpen |
( |
| ) |
|
Definition at line 279 of file SDK.cs.
280 {
281 if ((err = priorSDK.
Cmd(sessionID,
"controller.shutter.open", ref userRx)) != Prior.PRIOR_OK)
282 {
283 return false;
284 }
285 else
286 return true;
287 }
◆ shutterPosition()
| int BioImager.SDK.shutterPosition |
( |
| ) |
|
Definition at line 297 of file SDK.cs.
298 {
299 if ((err = priorSDK.
Cmd(sessionID,
"controller.shutter.state.get", ref userRx)) != Prior.PRIOR_OK)
300 {
301 return 0;
302 }
303 else
304 return int.Parse(userRx);
305 }
◆ stageBusy()
| int BioImager.SDK.stageBusy |
( |
| ) |
|
Definition at line 251 of file SDK.cs.
252 {
253 if ((err = priorSDK.
Cmd(sessionID,
"controller.stage.busy.get", ref userRx)) != Prior.PRIOR_OK)
254 {
255 return 0;
256 }
257 else
258 return Convert.ToInt32(userRx);
259 }
◆ waitUntilNosePieceIdle()
| void BioImager.SDK.waitUntilNosePieceIdle |
( |
| ) |
|
Definition at line 324 of file SDK.cs.
325 {
326 do
327 {
329 Thread.Sleep(100);
330 }
332 }
System.Windows.Forms.Application Application
◆ waitUntilStageIdle()
| void BioImager.SDK.waitUntilStageIdle |
( |
| ) |
|
Definition at line 306 of file SDK.cs.
307 {
308 do
309 {
311 Thread.Sleep(100);
312 }
314 }
◆ waitUntilZIdle()
| void BioImager.SDK.waitUntilZIdle |
( |
| ) |
|
Definition at line 315 of file SDK.cs.
316 {
317 do
318 {
320 Thread.Sleep(100);
321 }
322 while (
zBusy() != 0);
323 }
◆ zBusy()
| int BioImager.SDK.zBusy |
( |
| ) |
|
Definition at line 261 of file SDK.cs.
262 {
263 if ((err = priorSDK.
Cmd(sessionID,
"controller.z.busy.get", ref userRx)) != Prior.PRIOR_OK)
264 {
265 return 0;
266 }
267 else
268 return Convert.ToInt32(userRx);
269 }
The documentation for this class was generated from the following file: