migrate to PIP v4.1

This commit is contained in:
2024-10-22 09:59:56 +03:00
parent b6898b96f7
commit 0c36565aec
4 changed files with 12 additions and 2 deletions

View File

@@ -58,6 +58,7 @@ CDCore::CDCore() {
setName("CDCore"); setName("CDCore");
x_timer.setName("_S.CDCore.x_timer"); x_timer.setName("_S.CDCore.x_timer");
datatr.setPacketSize(960); datatr.setPacketSize(960);
cout_buffer_id = PICout::registerExternalBufferID();
CONNECTU(&connection, dataReceivedEvent, this, dataReceived); CONNECTU(&connection, dataReceivedEvent, this, dataReceived);
CONNECTU(PICout::Notifier::object(), finished, this, piCoutFinished); CONNECTU(PICout::Notifier::object(), finished, this, piCoutFinished);
/*PIString s(app_config); /*PIString s(app_config);
@@ -387,7 +388,7 @@ void CDCore::xTimerTick() {
void CDCore::piCoutFinished(int id, PIString * buffer) { void CDCore::piCoutFinished(int id, PIString * buffer) {
if (!buffer || !(id == 1)) return; if ((id != cout_buffer_id) || !buffer) return;
PIString sp = buffer->takeRange('[', ']'); PIString sp = buffer->takeRange('[', ']');
PIDeque<int> p = CDCore::stringToPath(sp); PIDeque<int> p = CDCore::stringToPath(sp);
sendMessage(m_[p], Log, *buffer); sendMessage(m_[p], Log, *buffer);

View File

@@ -48,6 +48,7 @@ class CD_CORE_EXPORT CDCore: public PIObject {
friend class CDSection; friend class CDSection;
friend class Interface; friend class Interface;
friend class XInterface; friend class XInterface;
friend class MInterface;
public: public:
static CDCore * instance(); static CDCore * instance();
@@ -111,6 +112,7 @@ public:
private: private:
CDCore(); CDCore();
~CDCore(); ~CDCore();
EVENT_HANDLER2(void, dataReceived, const PIString &, from, const PIByteArray &, data); EVENT_HANDLER2(void, dataReceived, const PIString &, from, const PIByteArray &, data);
EVENT_HANDLER1(void, dtSendRequest, PIByteArray &, data); EVENT_HANDLER1(void, dtSendRequest, PIByteArray &, data);
EVENT_HANDLER1(void, dtReceiveFinished, bool, ok); EVENT_HANDLER1(void, dtReceiveFinished, bool, ok);
@@ -136,6 +138,7 @@ private:
PIMutex x_mutex; PIMutex x_mutex;
PIVector<PIDeque<int>> x_selected; PIVector<PIDeque<int>> x_selected;
PIMap<PIString, OHPair> c_handlers; PIMap<PIString, OHPair> c_handlers;
int cout_buffer_id = 0;
bool need_rebuild_x, x_pult_side; bool need_rebuild_x, x_pult_side;
}; };

View File

@@ -19,5 +19,5 @@ void MInterface::messageBox(const CDType & m, const PIString & msg) {
PICout MInterface::createPICout(const CDType & m) const { PICout MInterface::createPICout(const CDType & m) const {
PIString * buff = new PIString("[" + CDCore::pathToString(m.path()) + "]"); PIString * buff = new PIString("[" + CDCore::pathToString(m.path()) + "]");
return PICout::withExternalBuffer(buff, 1); return PICout::withExternalBuffer(buff, core->cout_buffer_id);
} }

View File

@@ -34,6 +34,12 @@ class CDItemModel;
namespace CDUtils { namespace CDUtils {
class CDSection; class CDSection;
class CDCore;
class Interface;
class KInterface;
class XInterface;
class CInterface;
class MInterface;
enum UpdateMode { enum UpdateMode {
SaveByIndex = 0x01, SaveByIndex = 0x01,