phd2client icon indicating copy to clipboard operation
phd2client copied to clipboard

我发现了一个bug

Open AstroAir opened this issue 4 years ago • 4 comments

我尝试使用c++示例库中的程序,但是连接设备这个一部分总是不行,无法连接上设备,是不是代码有错误,我已尝试了许多次,好像python也有相同的情况。

AstroAir avatar Aug 02 '20 13:08 AstroAir

@AstroAir could you please provide more specific information. what exactly is not working? do you have a way for me to try to reproduce the problem?

agalasso avatar Aug 03 '20 02:08 agalasso

主要的问题是,如果整个程序中有连接设备的代码,那么这个程序就无法执行,或者是闪一下就没有了(在模拟器中执行),我觉得可能是变量的类型有问题,也可鞥能是示例代码有错误,我是直接使用示例代码的。 const char *profile = "Simulator"; printf("connect profile %s\n", profile);

    if (!guider.ConnectEquipment(profile))
        throw guider.LastError();

是不是需要修改代码?

AstroAir avatar Aug 03 '20 02:08 AstroAir

@AstroAir I see that you closed this issue. What was the resolution?

agalasso avatar Aug 04 '20 06:08 agalasso

@agalasso I open this issue again .I am thinking about how to write a API to recive message from PHD2 instead of using telnet (This is too slow,and work not very well). I found this code in https://github.com/agalasso/phd2client/blob/master/cxx/guider.cpp: else if (e == "GuideStep") { GuideStats stats; if (accum_active) { accum_ra.Add(ev["RADistanceRaw"].asDouble()); accum_dec.Add(ev["DECDistanceRaw"].asDouble()); accum_get_stats(&stats, accum_ra, accum_dec); } std::unique_lock<decltype(m_mutex)> _lock(m_mutex); AppState = "Guiding"; AvgDist = ev["AvgDist"].asDouble(); if (accum_active) Stats = stats; } but this did not write in https://github.com/agalasso/phd2client/blob/master/cxx/guider.h,so I could not use it.And I also found a bug in guider.h."#include <jsoncpp/json/json.h>" did not exit.It should change into "#include <json/json.h>".

AstroAir avatar Aug 06 '20 01:08 AstroAir