This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const numericArray: Array<number> = [49, 50, 51, 52, 53, 54, 55, 56, 32, 79, 76, 69, 68, 46, 67, 77, 52, 32, 118, 51, 46, 48, 46, 49, 32, 50, 50, 46, 48, 52, 46, 50, 48, 50, 51, 32, 119, 119, 119, 46, 105, 110, 116, 109, 97, 115, 104, 46, 114, 117]; | |
| const s: string = String.fromCharCode(...numericArray); | |
| console.log('MY DATA-ASCII:', s);//"12345678 OLED.CM4 v3.0.1 22.04.2023 www.intmash.ru" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <map> | |
| #include <functional> | |
| typedef pSignal(*createSignal)(TSignalPropsPointers props); | |
| pSignal SignalFactoty::getSignal(TSignalPropsPointers props) { | |
| /*TODO тут надо парсить переданнюу строку и генерить объекты vars, word, bit, float и т.п.*/ | |
| int size = 100; | |
| std::string pType = IniParser::getElement('/', &props.pType, size); | |
| /*GIST создание объеата из словаря*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| How to add fontawesome and bootstrap to React project? I'm not doing its often... all time as first time . Reminder: | |
| 1) installation | |
| npm install --save bootstrap | |
| npm install --save @fortawesome/fontawesome-free | |
| 2) importing to project | |
| to header of root project file index.tsx: | |
| import React from 'react'; | |
| import ReactDOM from 'react-dom'; | |
| to add imports | |
| import 'bootstrap/dist/css/bootstrap.min.css'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //валидация boolean с присвоением false а по умолчанию true | |
| //без этой конструкции всегда присваивался true | |
| let respond: boolean; | |
| result: boolean = (typeof respond !== 'undefined') ? respond : false ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| async function getSlotsData(request: Object, SlotsDataRequest :TSlotsDataRequest, host:THost): Promise<any>{ | |
| const FieldBus: TFieldBus = SlotsDataRequest.AddressableDevice.FieldBus; | |
| const PositionName = SlotsDataRequest.PositionName; | |
| const result: Object = {[PositionName]:{}}; | |
| const loadOneSlot = async (SlotDataRequest:TSlotDataRequest) => { | |
| const slot:TSlot = host.SlotsMap.get(SlotDataRequest.SlotName); | |
| const Tag: TParameters = SlotsDataRequest.AddressableDevice.Tags[SlotDataRequest.SectionName.toLowerCase()] | |
| try { | |
| await host.getSlotData(slot)//обновляю данные хоста | |
| FieldBus.checkHeaderOfAnswer(slot); |