PIString::toFloat/Double/LDouble own fast implementation (. and , equivalent)

PICout ldouble support
PIEthernet small optimization
This commit is contained in:
2022-09-17 17:53:58 +03:00
parent eddef26b5e
commit 499ee386a7
8 changed files with 270 additions and 103 deletions

View File

@@ -909,6 +909,17 @@ void PIEthernet::server_func(void * eth) {
}
void PIEthernet::setType(Type t, bool reopen) {
eth_type = t;
setProperty("type", (int)t);
if (reopen && isOpened()) {
closeDevice();
init();
openDevice();
}
}
bool PIEthernet::configureDevice(const void * e_main, const void * e_parent) {
PIConfig::Entry * em = (PIConfig::Entry * )e_main;
PIConfig::Entry * ep = (PIConfig::Entry * )e_parent;

View File

@@ -213,7 +213,7 @@ public:
PIFlags<PIEthernet::Parameters> parameters() const {return (PIFlags<PIEthernet::Parameters>)(property("parameters").toInt());}
//! Returns %PIEthernet type
Type type() const {return (Type)(property("type").toInt());}
Type type() const {return eth_type;}
//! Returns read timeout
double readTimeout() const {return property("readTimeout").toDouble();}
@@ -489,6 +489,7 @@ protected:
int sock, sock_s;
bool connected_, connecting_, listen_threaded, server_bounded;
mutable Address addr_r, addr_s, addr_lr;
Type eth_type;
PIThread server_thread_;
PIMutex clients_mutex;
PIVector<PIEthernet * > clients_;
@@ -498,7 +499,7 @@ protected:
private:
EVENT_HANDLER1(void, clientDeleted, PIObject *, o);
static void server_func(void * eth);
void setType(Type t, bool reopen = true) {setProperty("type", (int)t); if (reopen && isOpened()) {closeDevice(); init(); openDevice();}}
void setType(Type t, bool reopen = true);
static int ethErrorCore();
static PIString ethErrorString();