- Extended CJMS11 camera handling with new functionalities, including image grabbing, resolution configuration, and improved ROI support. - Added new `ToString` method implementations for enhanced debugging and logging in key classes like `JmsMessage`, `JmsPacket`, and `RoiCfg`. - Introduced additional commands (`start_stream_images`, `stop_stream_images`) in `CommandM` and its enum. - Implemented new resolution handling in `RoiCfg` with support for configurable image frames. - Refactored resolution-related UI elements in `RoiCfgCtrl` to add a dropdown for selecting resolution. - Made minor UX improvements by replacing inconsistent string formats with verbatim strings in console messages. - Updated project dependencies with new resolution-related utilities (`Frame` and `ResolutionFrames`). - Resolved camera-specific symbolic issues by transitioning to `CJMS11.Camera` over prior naming inconsistencies.
72 lines
1.8 KiB
C#
72 lines
1.8 KiB
C#
using TBF.Rig.Network.Camera.CJMS11.POJO;
|
|
|
|
namespace TBF.Rig.Network.Camera.CJMS11
|
|
{
|
|
public class JmsMessage
|
|
{
|
|
private POJO.MessageStatus status;
|
|
private CommandM command;
|
|
private string payload;
|
|
|
|
private string orig_status;
|
|
private string orig_command;
|
|
private string orig_payload;
|
|
|
|
public POJO.MessageStatus Status
|
|
{
|
|
get => status;
|
|
set => status = value;
|
|
}
|
|
|
|
public CommandM Command
|
|
{
|
|
get => command;
|
|
set => command = value;
|
|
}
|
|
|
|
public string Payload
|
|
{
|
|
get => payload;
|
|
set => payload = value;
|
|
}
|
|
|
|
public string OrigStatus => orig_status;
|
|
|
|
public string OrigCommand => orig_command;
|
|
|
|
public string OrigPayload => orig_payload;
|
|
|
|
public JmsMessage(string status, string command, string payload)
|
|
{
|
|
this.status = MessageStatusEnum.GetCommandM(status);
|
|
this.command = CommandMEnum.GetCommandM(command);
|
|
|
|
orig_status = status;
|
|
orig_command = command;
|
|
orig_payload = payload;
|
|
this.payload = payload;
|
|
}
|
|
|
|
public bool isMessageImageType(){
|
|
return this.command == CommandM.grab_image_;
|
|
}
|
|
|
|
public ParsedImage getImage(){
|
|
if(isMessageImageType()){
|
|
return JmsPacket.ImageParser(this.payload);
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
return string.Format( "status:{0}, command:{1}, payload:{2}, orig_status:{3}, orig_command:{4}, orig_payload:{5}",
|
|
status,
|
|
command,
|
|
payload,
|
|
orig_status,
|
|
orig_command,
|
|
orig_payload);
|
|
}
|
|
}
|
|
} |