Skip to content

Commit

Permalink
plugins/soi/endurance/AssetsManager: Tweak to make it iridium message…
Browse files Browse the repository at this point in the history
…s to be split if too big to send.
  • Loading branch information
paulosousadias committed Oct 8, 2024
1 parent c006fd9 commit 0cb04fc
Showing 1 changed file with 16 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.List;
Expand Down Expand Up @@ -122,16 +123,24 @@ public void sendCommand(String systemName, SoiCommand cmd, CommMean commMean, Co
else if (commMean == CommMean.Iridium) {
try {
ImcSystem system = ImcSystemsHolder.lookupSystemByName(systemName);
ImcIridiumMessage msg = new ImcIridiumMessage();
msg.setSource(ImcMsgManager.getManager().getLocalId().intValue());
cmd.setSrc(ImcMsgManager.getManager().getLocalId().intValue());
cmd.setDst(system.getId().intValue());
msg.setMsg(cmd);
msg.setDestination(system.getId().intValue());
IridiumManager.getManager().send(msg);
if (console != null)
console.post(Notification.success(cmd.getCommandStr()+" sent to "+systemName, cmd.getCommandStr()+" sent using "

Collection<ImcIridiumMessage> irMsgs = IridiumManager.iridiumEncode(cmd);

for (ImcIridiumMessage msg : irMsgs) {
msg.setSource(ImcMsgManager.getManager().getLocalId().intValue());
//msg.setMsg(cmd);
msg.setDestination(system.getId().intValue());
IridiumManager.getManager().send(msg);
}

if (console != null) {
console.post(Notification.success(cmd.getCommandStr() + " sent"
+ (irMsgs.size() > 1 ? " in " + irMsgs.size() + " parts" : "")
+ " to " + systemName, cmd.getCommandStr() + " sent using "
+ IridiumManager.getManager().getCurrentMessenger().getName()));
}
}
catch (Exception e) {
GuiUtils.errorMessage(console != null ? console : null, e);
Expand Down

0 comments on commit 0cb04fc

Please sign in to comment.