NDEVR
API Documentation
PolarisScanner.h
1#pragma once
2#if !OPTECH_RT_API
3#include <IPlsControlCallback.h>
4#include "GPSInterface/Headers/GPSSensor.h"
5#include "Hardware/Headers/Scanner3D.h"
6#include "Hardware/Headers/Connection.h"
7#include "Widgets/Headers/PhysicalCameraView.h"
8#include "Design/Headers/PolarPointFilter.h"
9#include "Base/Headers/Time.h"
10#include "Base/Headers/TimeSpan.h"
11#include "Base/Headers/Pointer.hpp"
12#include "Base/Headers/Thread.h"
13#include "Base/Headers/INIInterface.h"
14#include <Rt_Types.h>
15class ScannerDriver;
16namespace OPTECH_POLARIS_API
17{
18 class IPolarisControl;
19}
20namespace NDEVR
21{
22 class FileRequest;
24 class Log;
25 class OptechMotor;
26 class Battery;
28 class OptechRangeSensor;
30 class SocketIOChannel;
31 class OptechBase;
32
33
34
41 class PolarisScanner : public OPTECH_POLARIS_API::IPlsControlCallback, public Scanner3D, public INIInterface
42 {
44 enum PowerSource
45 {
46 e_plugged_in
47 , e_battery_1
48 , e_battery_2
49 };
50 public:
56 PolarisScanner(Connection* connection, DesignObjectLookup* manager, ProgressInfo* log, QObject* parent = nullptr);
57 virtual ~PolarisScanner();
58 virtual TimeSpan getScanTime(const ScanSetupSettings& settings) const override;
59 virtual String scannerType() const override;
60 virtual void standardUpdate();
61 virtual Motor* headMotor(uint01 axis) const override;
62 virtual void startScan(const ScanSetupSettings& settings) override;
63 virtual void stopScan() override;
64 virtual void pauseScan() override;
65 virtual void resumeScan() override;
66 virtual void createScanner() override;
67 virtual bool isValid() const override;
68 virtual bool canDeploy() const override { return false; };
69 void updateCamera();
70 virtual void recordPoint(bool record_to_cloud = true, bool record_to_mesh = true) override;
71 void startScanProcess();
72 virtual void orientHead(const Vector<3, Angle>& head_orientation) override;
73 virtual bool supportsContinuousScan() const override { return false; }
74 virtual bool executeManualCommand(const String& command) override;
75 virtual bool scanModeSupported(ScanMode scan_mode) const override;
76 virtual Bounds<2, Angle> scanBounds() const;
77 void requestDisconnect(bool disconnect) { m_request_disconnect = disconnect; }
78 virtual void setScannerState(ScannerState scanner_state) override;
79 virtual PositionSensor* positionSensor() const override;
80 virtual RangeSensor* rangeSensor() const override { return m_range_sensor; }
81 ScannerState scannerState() const override;
82 Bounds<2, Angle> maxScanBounds(ScanMode mode) const override;
83 virtual Connection* connection() const override { return m_connection; };
84 [[nodiscard]] virtual Buffer<Battery*> batteries() const;
85 [[nodiscard]] virtual Buffer<TemperatureSensor*> temperatureSensors() const;
86 [[nodiscard]] virtual OrientationSensor* orientationSensor() const;
87 [[nodiscard]] virtual TimeSpan scanTimeRemaining() const;
88 [[nodiscard]] virtual fltp04 getScanPercent() const;
89 int processPoints(std::vector<Optech::RtLidar::LidarPoint>& lidarPointsArray);
90 int processPoints(Optech::RtLidar::LidarPoint* points, uint04 size);
91 static OPTECH_POLARIS_API::SPlsScanROI Convert(const ScanSetupSettings& setting);
92 protected:
93 void updateModel();
94 void recordPoint(const PolarScanRecord<fltp04>& record, bool record_to_cloud = true, bool record_to_mesh = true) override;
95 virtual FileRequest scanModelFile() const override;
96 virtual Matrix<fltp08> scanModelFileTransform() const;
97 virtual void update() override;
98 void parkDevice() override;
99 TimeSpan updateInterval() const override;
100 Matrix<fltp08> laserTransform(const Vector<3, Angle>& head_angle) const override;
101 virtual Matrix<fltp08> scanTransform() const;
102 virtual INIFactory getINI() override;
103 void disconnect();
104 protected:
105 //virtual void AddClientCallback(IPls) override;
106
109 virtual void OnCommConnected(unsigned int ip, unsigned int port) override;
110 virtual void OnCommDrop(unsigned int ip, unsigned int port) override;
111 virtual void OnCommError(unsigned int ip, unsigned int port) override;
112 virtual void OnCommZeroLength(unsigned int ip, unsigned int port) override;
113
114 //Gets SCADA and SBL (Single Board Lidar) FPGA firmware versions
115 //Rev8
116 // Parameter Type Notes
117 // sbl_ver : uint - sbl fpga firmware build version
118 // os_ver : string - linux OS build version
119 // scada_ver : string - scada firmware build version
120 // obui_ver : string - OBUI build version
121 /*Rev9
122 Parameter Type Notes
123 sbl_fpga_ver : uint SBL FPGA firmware version (*.mcs file)
124 linux_os_ver : string Linux OS build version (kernel and root file system)
125 sbl_driver_ver: uint SBL Linux driver kernel module (sbldrv.ko file)
126 scada_sw_ver : string SCADA embedded control software version (polaris file)
127 uiapi_ver : string on-board API version (libuiapi.so file)
128 obui_ver : string on-board UI build version (Polaris.jar file)
129 */
130 //virtual void OnGetSoftwareVersions(const unsigned int sblBuildNumber, const SPlsString ver[3]) override;
131 virtual void OnGetSoftwareVersions(const OPTECH_POLARIS_API::PlsSoftwareVersion* softwareVersion) override;
132
133 // Gets system serial number
134 virtual void OnGetSystemSerial(const int serial_num) override;
135
136 // Gets Processor system time,
137 // feedback: time in 16 bytes, Windows SYSTEMTIME data structure
138 virtual void OnGetSystemTime(const SYSTEMTIME time) override;
139
140 // Sets Processor system time and save to hardware clock
141 // feedback: status int 0 – successful, -1 – error
142 virtual void OnSetSystemTime(const int status) override {};
143
144 // Updates SCADA firmware. The new file(s) must be in
145 // /home/polaris/public directory in order for the update to occur
146 // feedback: status int 0 – successful, -1 – error
147 virtual void OnUpdateSoftwareAndFirmware(const int status) override;
148
149 // Updates linux OS related files
150 // feedback: status int 0 – successful, -1 – error
151 virtual void OnUpdateCalAndConfig(const int status) override {};
152
153 // Queries current system state
154 // feedback: state, int, system state: 0 – idle, 1 – survey, 2 - paused
155 virtual void OnGetSystemState(const int system_state) override;
156
157 // Gets battery constant data. feedback:
158 // max_error int maximum error
159 // fcp int full charge capacity
160 // ccount int cycle count
161 // manu int manufacture date
162 // sn int serial number
163 virtual void OnGetBatteryStatic(const OPTECH_POLARIS_API::SPlsBatteryConst batter_static) override;
164
165 // Gets battery dynamic data like temperature, voltage, current, capacity and remaining
166 // feedback:
167 // temp int temperature
168 // volt int voltage
169 // curr int current
170 // cap int remaining capacity
171 // ave int average time to empty
172 virtual void OnGetBatteryDynamic(const OPTECH_POLARIS_API::SPlsBatteryDynamic battery_dynamic) override;
173
174 // Gets disk's total and free spaces
175 // feedback:
176 // total_capacity float disk total capacity in Mbytes
177 // free_space float disk remaining/available space in Mbytes
178 virtual void OnGetDiskInfo(const float capacity, const float free_space) override;
179
180 // Get instrument Model Number
181 // feedback:
182 // modelNumber int model number : 0-unknown, 1-TLS-250, 2-TLS-750, 3-TLS1600
183 virtual void OnGetModelNumber(const int modelNumber) override;
184
185 virtual void OnSetExternalCameraTrigger(const int status) override;
186
188 // feedback: position, int, position in encoder counts
189 virtual void OnGetPanPosition(const float pan) override;
190 // feedback: status int 0 – successful, -1 – error
191 virtual void OnSetPanPosition(const int status) override;
192
194 // Starts camera image acquisition.
195 // feedback: status int 0 – successful, -1 – error
196 virtual void OnStartCamera(const int status) override;
197
198 // Stop camera live video
199 // feedback: status int 0 – successful, -1 – error
200 virtual void OnStopCamera(const int status) override;
201
203 // feedback:
204 // gdop double Geometric Dilution Of Precision
205 // pdop double Position Dilution Of Precision
206 // gps_sat int number of GPS satellites
207 // glonass_sat int number of GLONASS satellites
208 virtual void OnGetGpsStatus(const OPTECH_POLARIS_API::SPlsGpsStatus gps_status) override;
209
210 // Get GPS position (ECEF).
211 // feedback:
212 // x_coord double x coordinate
213 // y_coord double y coordinate
214 // z_coord double z coordinate
215 virtual void OnGetGpsPositionECEF(const OPTECH_POLARIS_API::SPlsPositionD gps_position) override;
216
217 // Gets GPS position (geodetic)
218 // feedback:
219 // latitude string latitude
220 // longitude string longitude
221 // altitude string altitude
222 virtual void OnGetGpsPositionGeodetic(const OPTECH_POLARIS_API::SPlsPosGeodeticF) override;
223
224 // Gets current compass reading
225 // heading float compass value , 0 - 360
226 // x int x raw reading
227 // y int y raw reading
228 // z int z raw reading
229 virtual void OnGetCompass(const OPTECH_POLARIS_API::SPlsCompass compass_read) override;
230
231 // Gets current inclinometer reading
232 // x_incli int x inclinometer reading in counts
233 // y_incli int y inclinometer reading in counts
234 // temperature int temperature sensor reading in counts
235 virtual void OnGetInclinometer(const OPTECH_POLARIS_API::SPlsInclinometer incli_read) override;
236
237 // Gets wireless radio mode whether on or off
238 // feedback:
239 // mode: int, 0 – disabled (radio off) 1 – enabled (radio on) -1 - unknown
240 virtual void OnGetWirelessRadioMode(const int wireless_mode) override {};
241
242 // Enables or disables wireless radio, 0 – disable 1 – enable wireless
243 // feedback: status int 0 – successful, -1 – error
244 virtual void OnSetWirelessRadioMode(const int status) override {};
245
246 // Gets Ethernet mode whether DHCP client or server
247 // feedback: mode, int, 0 – DHCP server 1 – DHCP client
248 virtual void OnGetEthernetMode(const int eth_mode) override {};
249
250 //Sets Ethernet as DHCP server or DHCP client, 0 – DHCP server, 1 – DHCP client
251 // feedback: setting status, int, 0 – successful, -1 – error
252 virtual void OnSetEthernetMode(const int status) override {};
253
254 //Gets the rasterized view of a scan
255 // feedback: image, byte array, raster view of scan in jpeg format
256 virtual void OnGetScanRasterView(const unsigned char* rasterData, const int dataBufferSize) override;
257
258 //Gets the rasterized view of all the scans in the survey
259 // feedback: image, byte array, raster view of scan in jpeg format
260 // virtual void OnGetSurveyRasterView(const unsigned char* image_buf, const int bufSize) override; // removed as the control API must not implement this message
261
262 //Gets a single camera image associated with a scan.
263 // index, int, image index
264 // feedback: image, byte array, actual image in jpg format
265 virtual void OnGetScanCameraImage(const int image_index, const unsigned char* image_buf, const int bufSize) override {};
266
267 //Gets a list of surveys in the current project context
268 // feedback: nitems, int, total number of items in the list
269 // list string concatenated names of stored surveys
270 // feedback:
271 // num_names, number of names in the array
272 // array_names, string array, names of surveys. each string is 260 bytes.
273 virtual void OnListSurveys(const int num_names, const OPTECH_POLARIS_API::SPlsFileName* array_names) override {};
274
275 //Deletes all files (image, scan data, etc) associated with a survey
276 // feedback: status int 0 – successful, -1 – error
277 virtual void OnDeleteSurvey(const int status) override {};
278
279 //to copy survey data to an external USB storage.
280 // feedback: status int 0 – successful, -1 – error
281 virtual void OnExportSurvey(const int status) override {};
282
283 //to add a new scan task with the specified parameters
284 // feedback: status int 0 – successful, -1 – error
285 virtual void OnAddScanRoi(const int roiIndex, const int status) override {};
286
287 // Sets a flag to indicate whether camera image(s) from the internal,
288 // external or both cameras should be collected for the current survey
289 // feedback: status int 0 – successful, -1 – error
290 virtual void OnSetSurveyCamFlag(const int status) override;
291
292 // estimates scan time based on selected scan parameters
293 // feedback: estimate survey time in seconds, zero if there is no ROI
294 virtual void OnGetSurveyTimeEstimate(const int seconds) override;
295
296 // Sets occupy point for a survey
297 // feedback: status int 0 – successful, -1 – error
298 virtual void OnSetSurveyOccupyPoint(const int status) override {};
299
300 // Gets survey detail information contained in the metadata.
301 // feedback: meta data, byte array, contents of survey.xml file
302 virtual void OnGetSurveyMetadata(const unsigned char* meta_data, const unsigned int dataSize) override;
303
304 virtual void OnSetScannerSpeed(const int status) override;
305 virtual void OnSetScanParameters(const int roiIndex, const int status) override;
306 virtual void OnGetScannerSpeed(const int scannerSpeed) override;
307 virtual void OnGetLaserTemperatures(const int status, const float boosterTemp, const float prepumpTemp, const float seedTemp, const float caseTemp) override;
308 virtual void OnGetScannerType(const int scannerType) override;
309
310 // Starts survey
311 // feedback: status int 0 – successful, -1 – error
312 virtual void OnSurveyStart(const int status) override;
313
314 // will terminate a survey in progress
315 // feedback: status int 0 – successful, -1 – error
316 virtual void OnSurveyStop(const int status) override;
317
318 // Pauses a survey in progress
319 // feedback: status int 0 – successful, -1 – error
320 virtual void OnSurveyPause(const int status) override;
321
322 // Resumes a paused survey
323 // feedback: status int 0 – successful, -1 – error
324 virtual void OnSurveyResume(const int status) override;
325
326 // To query current scan index during survey
327 // feedback: index, int, current scan index greater or equal to 1 if in Survey state or
328 // -1 if system is not in Survey state
329 virtual void OnGetScanIndex(const int scan_index) override {};
330
331 // Lists all stored scan presets by name
332 // feedback:
333 // num_names, number of names in the array
334 // array_names, string array, names of targets. each string is 260 bytes.
335 virtual void OnListScanPresets(const int num_names, const OPTECH_POLARIS_API::SPlsFileName* array_names) override {};
336
337 // Gets scan parameters associated with the specified scan preset name.
338 // pan_start int horizontal field of view, start of pan position in encoder counts
339 // pan_stop int horizontal field of view, end of pan position in encoder counts
340 // galvo_start int vertical field of view, start of galvo position in encoder counts
341 // galvo_stop int vertical field of view, end of galvo position in encoder counts
342 // galvo_speed int galvo scanner speed in Hz
343 // pan_speed int pan base speed in Hz (tbd)
344 // prf int laser prf in KHz
345 // attenuator int attenuator position, 0 – no attenuator, 1 – use attenuator 1, 2 – use attenuator 2
346 // int_cam_flag int flag to indicate if camera image from the internal camera is collected with the scan 0 – without image 1 – with image
347 // ext_cam_flag int flag to indicate if camera image from the external camera is collected with the scan 0 – without image 1 – with image
349 virtual void OnGetScanPreset(char* xml_file/*const SPlsScanPreset*/, const int file_size) override {};
350
351
352 // Creates a new survey directory for storing survey files such as
353 // scan data, gps data, camera images, etc
354 // feedback: status int 0 – successful, -1 – error
355 virtual void OnAddNewSurvey(const int status) override {};
356
360
364 virtual void OnListProject(const int num_names, const OPTECH_POLARIS_API::SPlsFileName* array_names) override {};
365
366 // Imports external camera configuration file. filename, <camera_name>.xml
367 // feedback: status int 0 – successful, -1 – error
368 virtual void OnExternalCameraConfigImport(const int status) override {};
369
370 // Sets project current context so all subsequent messages that require a project name
371 // are within this context.
372 // feedback: status int 0 – complete -1 – error
373 virtual void OnSetProjectContext(const int status) override;
374
375 // Gets project current context
376 // feedback: status int 0 – complete -1 – error
377 virtual void OnGetProjectContext(const OPTECH_POLARIS_API::SPlsFileName* projectContextName) override {};
378
379 // Sets plan current context so all subsequent messages that require a plan name
380 // are within this context
381 // status int 0 – success -1 – plan does not exist
382 // virtual void OnSetPlanContext(const int status) override; // must be removed since it is not in the SCADA ICD rev 9.2.
383
384 // lists stored plans by name
385 // nitems, int, total number of plans in the list
386 // array_names, string array, names of plans. each string is 260 bytes.
387 virtual void OnListPlans(const int num_names, const OPTECH_POLARIS_API::SPlsFileName* array_names) override {};
388
389 // Gets plan status
390 // feedback:status int 0 – not started 1 – started but incomplete 2 - complete
391 virtual void OnGetPlanStatus(const int status) override {};
392
393 // Executes a plan
394 // feedback: status int 0 – success -1 - error
395 virtual void OnPlanStart(const int status) override {};
396
397 // Imports a plan
398 // feedback: status int 0 – success -1 - error
399 virtual void OnPlanFileImport(const int status) override {};
400
401 // Exports a plan, copies plan from internal disk storage and saves it to external USB storage.
402 // feedback: status int 0 – success -1 - error
403 virtual void OnPlanExport(const int status) override {};
404
405 // Gets a list of stations from a plan
406 // num_names, number of items in the list
407 // array_names, string array, names of stations. each string is 260 bytes.
408 virtual void OnGetPlanStations(const int num_names, const OPTECH_POLARIS_API::SPlsFileName* array_names) override;
409
410 // Gets station status
411 // status int 0 – complete 1 – incomplete
412 virtual void OnGetPlanStationStatus(const int status) override {};
413
414 // Gets a list of backsight/resection targets from an occupy station in a plan
415 // num_names, number of items in the list
416 //array_names, string array, names of targets. each string is 260 bytes.
417 virtual void OnListPlanStationTargets(const int num_names, const OPTECH_POLARIS_API::SPlsFileName* array_names) override;
418
419 // Creates a new backsight/resection target to associate with an occupy station
420 // feedback: status int 0 – success -1 - error
421 // virtual void OnSetPlanStationTarget(const int status) override; // No longer used since Scada ICD 9.2
422
423 // Lists all stored coordinates by name
424 // num_names, number of items in the list
425 // array_names, string array, names of stored coordinates. each string is 260 bytes
426 virtual void OnListCoordinates(const int num_names, const OPTECH_POLARIS_API::SPlsFileName* array_names) override;
427
428 // Gets coordinates value associated with the specified coordinate’s name for the current project context.
429 // northing, double northing value
430 // easting, double easting value
431 // up, double up value
432 virtual void OnGetCoordinates(const OPTECH_POLARIS_API::SPlsCoordinates coordinates) override;
433
434 // Adds new coordinates
435 // feedback: status int 0 – success -1 - error
436 virtual void OnAddCoordinates(const int status) override {};
437
438 // Get Ethernet and wireless IP address.
439 //feedback: eth_addr, string, Ethernet IP address
440 // wls_addr, string, wireless IP address
441 virtual void OnGetIPAddress(const char* eth_addr, const char* wls_addr) override {};
442
443 // OPOL-893
444 virtual void OnAddCustomFovScanRoi(const int status) override {};
445
446 // to force disconnection of remote controller
447 // feedback: status int 0 – success -1 - error
448 // virtual void OnDisconnectRemoteCtrl(const int status) override; // must be removed as the control API must not implement this message
449
450 // Get system power source. System power source could be
451 // from external power supply, battery 1 or battery 2
452 // feedback: source, int, 0 – external power supply, 1 – battery 1, 2 – battery 2
453 // volts, float, external power supply voltage in volts
454 // or zero if powered from battery
455 virtual void OnGetPowerSource(const int source, const float volts) override;
456
457 // Synchronize system time with GPS time
458 // feedback: status int 0 – success -1 - error
459 virtual void OnSyncSystemTimeWithGPS(const int status) override {};
460
461 // update ICD r6
462 // to get list of stored external camera configuration files by name
463 // feedback:
464 // num_names, number of items in the array
465 // array_cfg_names, string, names of stored coordinates
466 virtual void OnListExtCamCfgFile(const int num_names, const OPTECH_POLARIS_API::SPlsFileName* array_cfg_names) override {};
467
468 // to delete the specified camera configuration file
469 virtual void OnDeleteExtCamCfgFile(const int status) override {};
470 // to delete all added ROI’s
471 virtual void OnClearSurvey(const int status) override {};
472 // to delete plan file in the current project context
473 // feedback: status int 0 – success -1 - error
474 virtual void OnDeletePlan(const int status) override;
475
476 // to Calculate estimated survey data size of all the added ROI’s
477 // feedback:
478 // file_size, float, size in megabytes
479 virtual void OnGetSurveySizeEstimate(const float file_size) override;
480 // to copy all files (image, scan data, etc) associated with a project to
481 // an external USB storage device
482 virtual void OnExportProj(const int status) override;
483 // to delete all files (image, scan data, etc) associated with a project
484 virtual void OnDeleteProj(const int status) override;
485
486 virtual void OnGetProjectInfo(const float size, const int nSurveys) override;
487 virtual void OnPresetImport(const int status) override;
488 virtual void OnGetPlanStationGeorefType(const int type) override;
489 virtual void OnPlanReset(const int status) override;
490 virtual void OnExportCalAndConfigFile(const int status) override;
491
492 // Changes SCADA operating mode between Normal mode and Engineering mode. Normal mode is
493 // for customer use while Engineering mode is for internal use
494 // feedback: status int 0 – success -1 - error
495 virtual void OnChangeOperatingMode(const int status) override;
496
497 // control messages set 2
498 // Gets list of stations in a plan
499 // feedback: list string concatenated names of stations within proximity of current GPS position
500 virtual void OnListNearbyStations(const int num_names, const OPTECH_POLARIS_API::SPlsFileName* array_names) override;
501
502 // Calculates relative location of a backsight/resection target
503 // easting double easting value
504 // northing double northing value
505 // up double up value
506 virtual void OnCalcTargetRelLocation(const int validFlag, const double range, const double panAngle, const double galvoAngle) override;
507
508 // Calculates target centroid
509 // feedback:
510 // target centroid local X, Y, Z position, in meters
511 // relative x, y position of centroid inside target scan bounds, expressed as a fraction
512 virtual void OnCalcTargetCentroid(const OPTECH_POLARIS_API::SPlsPositionD centroid, const float rx, const float ry) override;
513
514 // Calculates true heading by backsighting
515 // home position heading in degrees in global coordinate frame
516 // valid_flag - Added as Rev8 : 0 = data not valid, 1 = data is valid
517 virtual void OnCalcBacksight(const int valid_flag, const float heading) override;
518
519 // PositionAndOrientation feedback
520 // instrument reference X, Y, Z position
521 // roll, pitch, heading instrument orientation roll in degrees
522 // stddev, float, standard deviation
523 // residual, float list of residual, one for each target
524 virtual void OnCalcResection(
525 const OPTECH_POLARIS_API::SPlsPositionD position,
526 const OPTECH_POLARIS_API::SPlsAttitudeF attitude,
527 const float stddev,
528 std::vector<float> residual
529
530 ) override;
531 virtual void OnAddTarget(const int status) override;
532
533 // retro targets list
534 // x1, x2, float, retro target horizontal bounding box position in degrees
535 // y1, y2, float, retro target vertical bounding box position in degrees
536 virtual void OnFindRetroTarget(OPTECH_POLARIS_API::SPlsRetroTargetPosn retro, std::vector<OPTECH_POLARIS_API::SPlsRetroTargetData> targetData) override;
537
538 // centroid_local_pos, double, target centroid local position, in meters
539 // rx float relative position of centroid inside target scan bounds, expressed as a fraction
540 // ry float relative position of centroid inside target scan bounds, expressed as a fraction
541 virtual void OnCalcManualCentroid(const OPTECH_POLARIS_API::SPlsPositionD centroid_local_pos, const float rx, const float ry) override;
542
543 // control message set 3. Messages used by Engineering OI (internal test utility).
544 // Queries current attenuator setting
545 // feedback: attenuator int attenuator setting: 0 – no attenuator, 1 – use, 2 – use attenuator 2
546 // virtual void OnGetAttenuator(const int attenuator) override; no longer exists in SCADA ICD rev 9.2
547
548 // Set attenuator setting, 0 – no attenuator, 1 – use attenuator1, 2 – use attenuator2
549 // feedback: status int 0 – success - 1 – error
550 virtual void OnSetAttenuator(const int status) override;
551
554 //virtual void OnSetScanHFov(const int status) override;
555
558 //virtual void OnSetScanVFov(const int status) override;
559
562 //virtual void OnSetScanDensity(const int status) override;
563
564 // Changes Laser PRF, meanwhile changes range mode to short, medium or long
565 // unit in KHz
566 // feedback: status int 0 – success -1 - error
567 virtual void OnSetLaserPRF(const int status) override;
568
569 // Enable or disable laser so it starts/stops firing
570 // feedback: status int 0 – success -1 - error
571 virtual void OnSetLaserOn(const int status) override;
572
573 // Sets tilt (elevation stage) current position, unit in encoder counts
574 // feedback: status int 0 – success -1 - error
575 // virtual void OnSetTiltPosition(const int status) override; // Not used since Scada ICD 9.2
576
577 // Gets galvo and tilt's current positions
578 // feedback: position int position in encoder counts
579 virtual void OnGetGalvoPosition(const int galvo_position) override;
580
581 // Sets galvo desired position
582 // feedback: position int position in encoder counts
583 virtual void OnSetGalvoPosition(const int status) override;
584
586 // feedback: status int 0 – success - 1 – error
587 virtual void OnSetPowerSource(const int status) override;
588
589 // Save raw data.
590 // status: 0 - success, -1 - error
591 virtual void OnSaveRawData(const int status) override;
592
593 // Data messages
594 // err_code, int, error code
595 // msg_id, int, the message caused the error
596 // or zero if occurred on the system
597 virtual void OnDatErrorMessage(const int err_code, const int msg_id, const int int_err_code) override;
598
599 //msg_code, int, message code
600 virtual void OnDatGeneralMessage(const int msg_code) override;
601
602 // tasks, int, total number of tasks to be performed, a task can be an ROI scan or camera image capture
603 // current_task, int, current task being performed
604 // current_progress, float progress of current task (0 to 100 %)
605 virtual void OnDatSurveyProgress(const int tasks, const int current_task, const float current_progress, const __int64 survey_size) override;
606
607 // scan index, int, current scan index being scanned
608 virtual void OnDatStartScan(const int scan_index) override;
609
610 // scan index, int, current scan index being scanned
611 virtual void OnDatEndScan(const int scan_index) override;
612
613 // data, byte array, lidar data
614 virtual void OnDatScan(const unsigned char* data_buf, const int data_size) override;
615
616 // data, byte array, lidar data header
617 virtual void OnDatScanHeader(const unsigned char* rawHeaderBuffer, const int bufferSize) override;
618
619 // data, byte array, lidar data header
620 virtual void OnDatPpsRecord(const unsigned char* rawPpsBuffer, const int bufferSize) override;
621
622 // data, byte array, lidar data header
623 virtual void OnDatNmeaRecord(const unsigned char* rawNmeaBuffer, const int bufferSize) override;
624
625 // cam_img, byte array, camera image data in JPEG format
626 virtual void OnDatCamera(const int cam_number, const unsigned char* img_buf, const int data_size) override;
627
628 // flag, int, 0 – extcamera.dat, 1 – intcamera.dat, 2 – serial.dat, 3 – tbd
629 // contents, byte array, contents of the file indicated in the flag parameter
630 virtual void OnDatDatafile(const int flag, const unsigned char* data_buf, const int data_size) override;
631
632
633 //Notified any alerts during processing. This function could be invoked from multiple threads simultaneously,
634 //thus client needs to make their implementation thread safe.
635 virtual void Alert(std::string alert) override;
636
637 int waitForCommand(TimeSpan timeout = TimeSpan(30.0));
638 private:
639 void initConnection();
640 OPTECH_POLARIS_API::IPolarisControl* m_polaris_control;
641 Motor* m_scope = nullptr;
642 Motor* m_head = nullptr;
643 Connection* m_connection = nullptr;
644 OptechScannerPositionSensor* m_position_sensor = nullptr;
645 RangeSensor* m_range_sensor = nullptr;
646 TemperatureSensor* m_booster_temp = nullptr;
647 TemperatureSensor* m_prepump_temp = nullptr;
648 TemperatureSensor* m_seed_temp = nullptr;
649 TemperatureSensor* m_case_temp = nullptr;
650 Battery* m_battery_1 = nullptr;
651 Battery* m_battery_2 = nullptr;
652 Battery* m_power_source = nullptr;
653 GPSSensor* m_gps_sensor;
654 OrientationSensor* m_orientation_sensor = nullptr;
655 OPTECH_POLARIS_API::SPlsScanROI m_survey_parameters;
656 Time m_last_standard_refresh;
657 Time m_last_scan_update_time;
658 TimeSpan m_scan_time_estimate = Constant<TimeSpan>::NaN;
659 fltp04 m_scan_progress = Constant<fltp04>::NaN;
660 sint04 m_last_return = Constant<sint04>::NaN;
661 bool m_is_initializing_scan = false;
662 bool m_is_valid = false;
663 bool m_is_init = false;
664 bool m_use_internal_camera = false;
665 bool m_use_external_camera = false;
666 TimeSpan m_external_camera_interval = TimeSpan(1.0);
667 PowerSource m_current_power_source;
668 };
669}
670#endif
A device which has an associated voltage or percent that changes.
Definition Battery.h:106
A standard interface for all types of connections that allow transmitting and receiving of data betwe...
Definition Connection.h:316
A core class where all Design Objects including models, materials, and geometries are stored.
A GPS sensor implementation that receives NMEA data from serial connections, files,...
Definition GPSSensor.h:61
INIInterface()
Constructs an INIInterface with no default INI file.
Serves as the primary program interface for processes to report issues and allows any number of LogSt...
Definition Log.h:50
A motor is a device which produces rotational spin.
Definition Motor.h:46
A Connection subclass that manages the network connection to an Optech scanner.
A PositionSensor implementation for Optech scanners that tracks instrument position using station/dep...
Forward declaration for design object lookup service.
virtual void OnListProject(const int num_names, const OPTECH_POLARIS_API::SPlsFileName *array_names) override
Get list of project names feedback: nitems, int, total number of items in the list array_names,...
virtual void OnStartCamera(const int status) override
camera commands
virtual void OnGetPanPosition(const float pan) override
pan/tilt/gavo commands
PolarisScanner(Connection *connection, DesignObjectLookup *manager, ProgressInfo *log, QObject *parent=nullptr)
Constructs the Polaris scanner controller.
virtual void OnSetPowerSource(const int status) override
Set system power source.
virtual void OnGetGpsStatus(const OPTECH_POLARIS_API::SPlsGpsStatus gps_status) override
Gps/compass/level.
Used with InfoPipe to signal that the system will be using progress.
A RangeSensor is a Device that determines the distance of a target at a certain orientation.
Definition RangeSensor.h:52
A specific channel of communication within the SocketIO framework.
The core String class for the NDEVR API.
Definition String.h:95
A Device responsible for determining the temperature of either the environment or a specific componen...
Stores a time span, or difference between two times, with an optional start time.
Definition TimeSpan.h:46
Represents a timestamp with utilities for manipulation and conversion.
Definition Time.h:62
A fixed-size array with N dimensions used as the basis for geometric and mathematical types.
Definition Vector.hpp:62
The primary namespace for the NDEVR SDK.
@ type
The type identifier string for this model node.
Definition Model.h:58
float fltp04
Defines an alias representing a 4 byte floating-point number Bit layout is as follows: -Sign: 1 bit a...
ScanMode
The mode that a scanner will collect data in.
Definition ScanMode.h:8
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
int32_t sint04
-Defines an alias representing a 4 byte, signed integer.
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
@ meta_data
General-purpose metadata string for the object.
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved 'invali...
A FileRequest bundles format data as well as a particular file.
Definition FileFormat.h:101