Сборка 1901311830

This commit is contained in:
Иван Мокротоваров 2019-01-31 18:30:35 +03:00
parent d515e2cdd7
commit 64a612b8ae
10 changed files with 80 additions and 22 deletions

View File

@ -7,7 +7,7 @@ opened=yes
breakpoints= breakpoints=
[file2] [file2]
line=68 line=68
cursor=1100 cursor=1487
opened=yes opened=yes
breakpoints= breakpoints=
[file3] [file3]
@ -26,19 +26,19 @@ cursor=161
opened=no opened=no
breakpoints= breakpoints=
[file6] [file6]
line=108 line=45
cursor=1395 cursor=2144
opened=yes opened=yes
breakpoints= breakpoints=
[file7] [file7]
line=0 line=106
cursor=2450 cursor=2777
opened=yes opened=yes
breakpoints= breakpoints=
[file8] [file8]
line=0 line=0
cursor=172 cursor=407
opened=no opened=yes
breakpoints= breakpoints=
[file9] [file9]
line=0 line=0
@ -81,12 +81,12 @@ opened=no
breakpoints= breakpoints=
[file17] [file17]
line=0 line=0
cursor=20 cursor=293
opened=no opened=active
breakpoints= breakpoints=
[file18] [file18]
line=0 line=0
cursor=295 cursor=500
opened=yes opened=yes
breakpoints= breakpoints=
[file19] [file19]
@ -97,7 +97,7 @@ breakpoints=
[file20] [file20]
line=48 line=48
cursor=2344 cursor=2344
opened=active opened=yes
breakpoints= breakpoints=
[file21] [file21]
line=0 line=0

View File

@ -1 +1,18 @@
"# tibbo_line" # tibbo_line
Команды реализованные
systeminfo - возвращает информацию о версии текущей прошивки и время прошедшее с момента включения контроллера Tibbo
reset или reboot - перезагрузка контроллера
ip - установка ip адреса контроллера. Изменения вступают в силу после перезагрузки. Формат - ip=192.168.123.10
setbraker - настройка брокиратора
setencoder - настройка энкодера
enc_calibrate_start - запуск процедуры калибровки. Параметер - режим работы энкодера. пока только "1"
enc_calibrate_end - остановка процедуры калибровки
enc_set_windows - установка размера разрешенного окна энкодера. Параметер от 0 до 100. по умолчанию - 40
# команды отладки
debug_enc_level - уровени вывода сообщений отладки энкодера. Параметер от 0 до 4. По умолчанию - 0
debug_relay_reply - Вывод ответного сообщения при включении реле. Параметер - 0/1. По умолчанию - 0
debug_sensors - Вывод информации об отправке сигнала датчика в порт диагностики. Параметер - 0/1. По умолчанию - 0
debug_showtime - Показ в сообщении диагностики времени с момента включения. Параметер - 0/1. По умолчанию - 0

View File

@ -40,6 +40,8 @@ void on_sock_inband() // обработка поступивших команд
cmd_replay(cmd_enc_set_windows(params)); cmd_replay(cmd_enc_set_windows(params));
}else if (cmd == "debug_enc_level"){ }else if (cmd == "debug_enc_level"){
cmd_replay(cmd_debug_enc_level(params)); cmd_replay(cmd_debug_enc_level(params));
}else if (cmd == "debug_relay_reply"){
cmd_replay(cmd_debug_relay_reply(params));
}else if (cmd == "debug_sensors"){ }else if (cmd == "debug_sensors"){
cmd_replay(cmd_debug_sensors(params)); cmd_replay(cmd_debug_sensors(params));
}else if (cmd == "debug_showtime"){ }else if (cmd == "debug_showtime"){
@ -59,6 +61,13 @@ string cmd_debug_sensors(string params){
config.debug.SensorsLook = val(pars[0])>0; config.debug.SensorsLook = val(pars[0])>0;
return "Debug sensors SET="+(config.debug.SensorsLook? "TRUE":"FALSE"); return "Debug sensors SET="+(config.debug.SensorsLook? "TRUE":"FALSE");
} }
string cmd_debug_relay_reply(string params){
getParams(params);
config.debug.RelayReply = val(pars[0])>0;
return "Debug sensors SET="+(config.debug.RelayReply? "TRUE":"FALSE");
}
string cmd_debug_enc_level(string params){ string cmd_debug_enc_level(string params){
getParams(params); getParams(params);
config.debug.EncoderDebug= val(pars[0]); config.debug.EncoderDebug= val(pars[0]);

View File

@ -11,3 +11,4 @@ string cmd_debug_enc_level(string params);
string cmd_debug_sensors(string params); string cmd_debug_sensors(string params);
string cmd_debug_showtime(string params); string cmd_debug_showtime(string params);
void getParams(string params); void getParams(string params);
string cmd_debug_relay_reply(string params);

View File

@ -9,7 +9,7 @@
#message "link global not defined" #message "link global not defined"
#endif #endif
#define VERSION "2.0b" #define VERSION "2.0b_1901311830"
#define MAX_FIFO_SIZE 20 #define MAX_FIFO_SIZE 20
#define BRAKER_COUNT 3 #define BRAKER_COUNT 3
@ -80,6 +80,7 @@ typedef struct DebugConf{
bool SensorsLook; bool SensorsLook;
bool ShowTime; bool ShowTime;
int EncoderDebug; int EncoderDebug;
bool RelayReply;
}; };
typedef struct Configuration{ typedef struct Configuration{
@ -109,3 +110,9 @@ extern unsigned char state[SENSORS];
extern BrakerProcess brakers[BRAKER_COUNT]; extern BrakerProcess brakers[BRAKER_COUNT];

View File

@ -1,13 +1,9 @@
@echo off @echo off
node premake.js
echo Y|del up\*.* echo Y|del up\*.*
node premake.js
set dat=%date:~8,2%%date:~3,2%%date:~0,2%%time:~0,2%%time:~3,2% set dat=%date:~8,2%%date:~3,2%%date:~0,2%%time:~0,2%%time:~3,2%
git commit -a -m "‘¡®àª  %dat%" git commit -a -m "‘¡®àª  %dat%"
git push git push
"C:\Program Files (x86)\Tibbo\TIDE\Bin\tmake.exe" -r -p "C:\Program Files (x86)\Tibbo\TIDE\Platforms" KSM-Line-2.2_tpp2.tpr "C:\Program Files (x86)\Tibbo\TIDE\Bin\tmake.exe" -r -p "C:\Program Files (x86)\Tibbo\TIDE\Platforms" KSM-Line-2.2_tpp2.tpr
rem ren KSM-Line-2.0.tpc KSM-Line-2.0.tpp2.%dat%.tpc
rem copy KSM-Line-2.0.tpp2.%dat%.tpc up\KSM-Line-2.0.tpp2.%dat%.tpc.zip
"C:\Program Files (x86)\Tibbo\TIDE\Bin\tmake.exe" -r -p "C:\Program Files (x86)\Tibbo\TIDE\Platforms" KSM-Line-2.2_tpp3.tpr "C:\Program Files (x86)\Tibbo\TIDE\Bin\tmake.exe" -r -p "C:\Program Files (x86)\Tibbo\TIDE\Platforms" KSM-Line-2.2_tpp3.tpr
rem ren KSM-Line-2.0.tpc KSM-Line-2.0.tpp3.%dat%.tpc
rem copy KSM-Line-2.0.tpp3.%dat%.tpc up\KSM-Line-2.0.tpp3.%dat%.tpc.zip
call postmake.cmd call postmake.cmd

8
net.tc
View File

@ -123,6 +123,14 @@ void send_sensor(int number, bool state){
sock.send(); sock.send();
} }
} }
void net_send_data(int sock_num,string data){
int n = sock.num;
sock.num = sock_num;
sock.setdata(data);
sock.send();
sock.num = n;
}
void on_sock_data_arrival() void on_sock_data_arrival()
{ {
switch (sock.num){ switch (sock.num){

3
net.th
View File

@ -6,4 +6,5 @@ void net_relay_handle(string message);
void net_diag_handle(string message); void net_diag_handle(string message);
void net_config_handle(string message); void net_config_handle(string message);
void net_sensor_handle(string message); void net_sensor_handle(string message);
void send_sensor(int number, bool state); void send_sensor(int number, bool state);
void net_send_data(int sock_num,string data);

View File

@ -41,12 +41,28 @@ for (line in lines){
fs.writeFile("KSM-Line-2.2_tpp2.tpr", out1 , function(err){ console.log("tpp2")}); fs.writeFile("KSM-Line-2.2_tpp2.tpr", out1 , function(err){ console.log("tpp2")});
fs.writeFile("KSM-Line-2.2_tpp3.tpr", out2 , function(err){ console.log("tpp3")}); fs.writeFile("KSM-Line-2.2_tpp3.tpr", out2 , function(err){ console.log("tpp3")});
file = getFile("global.th");
lines = file.toString().split("\n")
out1 = '';
for (line in lines){
var l = lines[line];
if (l.includes("#define VERSION ")){
// var ver = l.replace("#define VERSION",'').trim().trim('"').split("_")[0];
var ver = l.replace("#define VERSION",'').trim().replace('\"','').replace('\"','').split("_")[0];
l = '#define VERSION "'+ver+'_'+dt+'"\r';
}
out1 += l+"\n";
}
fs.writeFile("global.th", out1 , function(err){ console.log("global.th")});
var postmake = ""; var postmake = "";
postmake += "copy KSM-Line-2.0.tpp2."+dt+".tpc up\\KSM-Line-2.0.tpp2."+dt+".tpc.zip\r\n"; postmake += "copy KSM-Line-2.0.tpp2."+dt+".tpc up\\KSM-Line-2.0.tpp2."+dt+".tpc.zip\r\n";
postmake += "copy KSM-Line-2.0.tpp3."+dt+".tpc up\\KSM-Line-2.0.tpp3."+dt+".tpc.zip\r\n"; postmake += "copy KSM-Line-2.0.tpp3."+dt+".tpc up\\KSM-Line-2.0.tpp3."+dt+".tpc.zip\r\n";
postmake += "move KSM-Line-2.0.tpp2."+dt+".tpc bin\\KSM-Line-2.0.tpp2."+dt+".tpc\r\n"; postmake += "move KSM-Line-2.0.tpp2."+dt+".tpc bin\\KSM-Line-2.0.tpp2."+dt+".tpc\r\n";
postmake += "move KSM-Line-2.0.tpp3."+dt+".tpc bin\\KSM-Line-2.0.tpp3."+dt+".tpc\r\n"; postmake += "move KSM-Line-2.0.tpp3."+dt+".tpc bin\\KSM-Line-2.0.tpp3."+dt+".tpc\r\n";
postmake += "echo wget -c -O ./KSM-Line-2.0.tpp2."+dt+".tpc http://available-we.azurewebsites.net/tibbo/KSM-Line-2.0.tpp2."+dt+".tpc.zip >up\\app.sh\r\n"; fs.writeFile("postmake.cmd", postmake , function(err){ console.log("postmake")});
postmake += "echo wget -c -O ./KSM-Line-2.0.tpp3."+dt+".tpc http://available-we.azurewebsites.net/tibbo/KSM-Line-2.0.tpp3."+dt+".tpc.zip >>up\\app.sh\r\n";
postmake = "wget -c -O ./KSM-Line-2.0.tpp2."+dt+".tpc http://available-we.azurewebsites.net/tibbo/KSM-Line-2.0.tpp2."+dt+".tpc.zip\n";
postmake += "wget -c -O ./KSM-Line-2.0.tpp3."+dt+".tpc http://available-we.azurewebsites.net/tibbo/KSM-Line-2.0.tpp3."+dt+".tpc.zip\n";
fs.writeFile("up/app.sh", postmake , function(err){ console.log("postmake")});
fs.writeFile("postmake.cmd", postmake , function(err){ console.log("postmake")});

View File

@ -13,6 +13,9 @@ void relay_init(){
void relay_set(int number, bool state) void relay_set(int number, bool state)
{ {
if (config.debug.RelayReply){
net_send_data(1,"+"+str(number)+str((state? 1:0))+"\r\n");
}
#if PLATFORM_ID != SIMULATOR #if PLATFORM_ID != SIMULATOR
io.lineset(OUTPIN[number-1],!state ); io.lineset(OUTPIN[number-1],!state );
#endif #endif