Skip to content

Commit

Permalink
1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
elkinvg committed Jul 10, 2022
1 parent 731f926 commit 0a45f82
Show file tree
Hide file tree
Showing 44 changed files with 3,097 additions and 457 deletions.
15 changes: 7 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,17 @@ obj/*
bin/*
lib/*
bck/*
vc10_proj/*
vc12_proj/*.user
vc12_proj/*.sdf
vc12_proj/.vs/*
vc12_proj/*.suo
vc12_proj/*.opensdf
*/*.user
*/*.sdf
*/.vs/*
*/*.suo
*/*.opensdf
.idea/*
*.autosave

#tmp
vc141_proj
vc141_proj/*
#vc141_proj
#vc141_proj/*

#my
my_sett.js
Expand Down
332 changes: 170 additions & 162 deletions CHANGELOG.md

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ SUBDIRS = server_mode client_mode
all: $(SUBDIRS)

$(SUBDIRS):
$(MAKE) -C $@
$(MAKE) -C $@

.PHONY: $(SUBDIRS)
.PHONY: $(SUBDIRS)

.PHONY: clean
clean:
@rm -rf obj bin
3 changes: 2 additions & 1 deletion client_mode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,8 @@ Input message:
"device_name": "name of device",
"command_name": "name of command",
"precision": "precf=10",
"group_request": true
"group_request": true,
"argin": "value or array if needed"
}
```

Expand Down
10 changes: 9 additions & 1 deletion client_mode/README_RUS.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,20 @@
"device_name": "name of device",
"command_name": "name of command",
"precision": "precf=10",
"group_request": true
"group_request": true,
"argin": "value or array if needed",
"jsonout": true
}
```

---

---

**Ключ `jsonout` указывается, только если получаемые данные имеют JSON формат, и их не нужно заключать в кавычки**

---

**Ключ `group_request: true` указывается, только если запрос групповой. В `device_name` следует указать шаблон. Параметром шаблона может быть простое имя устройства или шаблон имени устройства (например, `domain_*/family/member_*`)**

---
Expand Down
3 changes: 2 additions & 1 deletion server_mode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ Input message:
"id": "ID request",
"device_name": "name of device",
"command_name": "name of command",
"precision": "precf=10"
"precision": "precf=10",
"argin": "value or array if needed"
}
```

Expand Down
3 changes: 2 additions & 1 deletion server_mode/README_RUS.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@
"id": "ID request",
"device_name": "name of device",
"command_name": "name of command",
"precision": "precf=10"
"precision": "precf=10",
"argin": "value or array if needed"
}
```

Expand Down
28 changes: 14 additions & 14 deletions src/wstangoproc_cli/EventProcCli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,23 +58,23 @@ namespace WebSocketDS_ns {
if (con_lock.try_lock()) {
map < websocketpp::connection_hdl, string, std::owner_less < websocketpp::connection_hdl>> connAddrList = eventSubs[deviceName][attrName][dt->event].connList;

// DONE: Для использования данных каждым соединением делается копия Tango::DeviceAttribute
MyEventData eventData(dt);
eventData.err = dt->err;
eventData.eventType = dt->event;
eventData.errors = dt->errors;
eventData.tv_sec = dt->get_date().tv_sec;
eventData.deviceName = dt->device->dev_name();

vector<websocketpp::connection_hdl> _del_conn;

for (pair<websocketpp::connection_hdl, string> hdlnopt : connAddrList) {
string precOpt = hdlnopt.second;

// DONE: ДЛя каждого соединения делается копия Tango::DeviceAttribute
// TODO: Не делать копию самого Tango::DeviceAttribute, а лишь необходимых данных?
MyEventData eventData;
eventData.attr_value.deep_copy(*(dt->attr_value));
eventData.err = dt->err;
eventData.eventType = dt->event;
eventData.errors = dt->errors;
eventData.tv_sec = dt->get_date().tv_sec;
eventData.attrName = dt->attr_name;
eventData.deviceName = dt->device->dev_name();

string message = TangoProcessor::processEvent(eventData, precOpt);
UserOptions uo;
uo.isJsonString = false;
uo.precision = hdlnopt.second;

string message = TangoProcessor::processEvent(eventData, uo);

try {
_wsThread->send(hdlnopt.first, message);
}
Expand Down
8 changes: 4 additions & 4 deletions src/wstangoproc_common/GroupOrDeviceForWs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ namespace WebSocketDS_ns

StringProc::checkPrecisionOptions(attr, _precisionOptsOfAttrs);

// TODO: Îïöèè
// TODO: Опции
//forNiterOpt(attr);

string tmpAttrName = attr;
Expand All @@ -81,9 +81,9 @@ namespace WebSocketDS_ns
{
vector<string> all_attributes = getListOfAllAttributes();

// Åñëè òîëüêî __all_attrs__ ñïèñîê áóäåò ïóñò
// Îñòàëüíîé ñïèñîê, íàïðèìåð àòðèáóòû ñ îïöèÿìè
// Äàëåå ñïèñîê ÷èòàåòñÿ. Ýòî íóæíî, åñëè óêàçàíû îïöèè äëÿ àòðèáóòîâ
// Если только __all_attrs__ список будет пуст
// Остальной список, например атрибуты с опциями
// Далее список читается. Это нужно, если указаны опции для атрибутов
if (attributes.size()) {
for (auto& attr : attributes) {
auto cp_attr = attr;
Expand Down
Loading

0 comments on commit 0a45f82

Please sign in to comment.