Supports camera upgrade to SD 1.3, ver. 2.17.762

This commit is contained in:
Milan Hanajik
2017-12-08 09:06:27 +03:00
parent f6e44914fa
commit ace0bdb2a6
7 changed files with 70 additions and 27 deletions
@@ -112,6 +112,8 @@ namespace TBF.BenchControl.Elde
#else
int flowMeterIdxAndDiv = flowMeterNr;
#endif
log.InfoFormat("Start() : SendCommand(Cmd.Start, {0}, route, {1}, {1}, {2}, {3}, {4}, 0, Stop.None)",
flowMeterIdxAndDiv, refPulses, testMethod, filterConstant, (int)pidCoef);
controlBoard.SendCommand(Command.Start, flowMeterIdxAndDiv, controlBoard.Route,
refPulses, refPulses, testMethod,
@@ -154,12 +154,9 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
roisAndResults = new RoisAndResults(); /// object for measurement results, writes/reads to/from this object are locked
running = false;
log.Debug(this.ToString());
}
public void Initialize()
{
cameraIdx = GetCameraIdx();
@@ -211,7 +208,7 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
Telnet.Enqueue(new Telnet.Command(Network.Telnet.CmdAction.CLEAR_RESPONSE));
Telnet.Enqueue(new Telnet.Command(Network.Telnet.CmdAction.SEND_COMMAND, "sha1sum clp/*"));
log.FatalFormat("'{0}' with address {1} detected, IP address = {2}", Name, CameraCfg.HardwareAddress, ipAddress);
log.FatalFormat("'{0}' with address {1} detected, IP = {2}, SD = {3}", Name, CameraCfg.HardwareAddress, ipAddress, sdCardVer);
}
else
{
@@ -461,7 +458,15 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
if (!sha1sumResponse.Contains(fi.Name))
{
/// Change file properties if it was a new file
sshClient.CreateCommand(string.Format("chmod 755 clp/{0}", fi.Name)).Execute();
string command = string.Format("chmod 755 clp/{0}", fi.Name);
log.InfoFormat("{0}, IP={1}, Executing command '{2}'", Name, IPAddress, command);
sshClient.CreateCommand(command).Execute();
//if (fi.Name.Equals("runmeonce"))
//{
// log.InfoFormat("{0}, IP={1}, Executing command 'sudo clp/runmeonce'", Name, IPAddress);
// sshClient.CreateCommand("sudo clp/runmeonce").Execute();
//}
}
}
}
@@ -472,32 +477,32 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
///
/// Run SCP command loop
///
if (scpConnected)
while (scpConnected && !stopScpThreadFlag)
{
while (!stopScpThreadFlag)
switch (scpCommand)
{
switch (scpCommand)
{
case ScpCommand.Get:
scpCommand = ScpCommand.None;
scpClient.Download(scpRemoteFileName, new System.IO.FileInfo(scpLocalFileName));
break;
case ScpCommand.Get:
scpCommand = ScpCommand.None;
scpClient.Download(scpRemoteFileName, new System.IO.FileInfo(scpLocalFileName));
break;
case ScpCommand.Put:
scpCommand = ScpCommand.None;
scpClient.Upload(new System.IO.FileInfo(scpLocalFileName), scpRemoteFileName);
break;
case ScpCommand.Put:
scpCommand = ScpCommand.None;
scpClient.Upload(new System.IO.FileInfo(scpLocalFileName), scpRemoteFileName);
break;
default:
Thread.Sleep(250);
break;
}
default:
Thread.Sleep(250);
break;
}
scpConnected = scpClient.IsConnected;
}
scpClient.Disconnect();
running = false;
scpClient.Disconnect();
scpConnected = false;
}
}
}
catch (Exception exc)
{