Skip to content

Commit

Permalink
add loopback to assistant, add translation
Browse files Browse the repository at this point in the history
  • Loading branch information
chivstyle committed Sep 1, 2022
1 parent 69f78f6 commit 9ba82f5
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 16 deletions.
12 changes: 9 additions & 3 deletions comxd/comxd.t
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,19 @@ T_("Timeout")
zhCN("\350\266\205\346\227\266")


// SSHSFtp.cpp
// SSHTransmit.cpp

T_("Remote File")
zhCN("\350\277\234\347\250\213\346\226\207\344\273\266")

T_("Remote file does not exist or invalid")
zhCN("\350\277\234\347\250\213\346\226\207\344\273\266\344\270\215\345\255\230\345\234\250\346\210\226\351\235\236\346\263\225")
T_("Transmition was failed!")
zhCN("\344\274\240\350\276\223\345\244\261\350\264\245!")

T_("Transmition was completed!")
zhCN("\344\274\240\350\276\223\345\256\214\346\210\220!")

T_("The remote file is not a normal file!")
zhCN("\350\277\234\347\250\213\346\226\207\344\273\266\344\270\215\346\230\257\344\270\200\344\270\252\346\231\256\351\200\232\346\226\207\344\273\266!")


// TcpClientDialog.cpp
Expand Down
2 changes: 1 addition & 1 deletion comxd/comxd.tpp/about_en-us.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ topic "";
[{_}
[s0;/ &]
[s0; [*^https`:`/`/github`.com`/chivstyle`/comxd^@3 comxd][* ][/ Version
2.2.16.1 alpha.This program uses ][/^https`:`/`/www`.ultimatepp`.org`/^ U`+`+][/ ,
2.2.16.2 alpha.This program uses ][/^https`:`/`/www`.ultimatepp`.org`/^ U`+`+][/ ,
][/^http`:`/`/wjwwood`.io`/serial`/^ serial][/ .]&]
[s0;/ &]
[s0;> [/+92 noonecancrackit`@163.com]]]
2 changes: 1 addition & 1 deletion comxd/comxd.tpp/about_en-us.tppi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
TITLE("")
COMPRESSED
120,156,133,143,193,78,195,48,16,68,127,101,37,42,14,77,101,39,169,84,137,34,161,30,248,4,224,98,57,172,113,77,236,54,201,90,182,131,65,136,127,167,166,128,184,177,151,125,135,153,221,25,1,139,69,189,170,47,234,127,102,123,107,158,213,60,36,41,222,31,63,64,196,250,154,195,165,44,27,196,178,179,41,249,136,91,228,200,123,151,236,252,132,76,211,136,92,91,247,18,211,219,96,78,72,227,235,190,219,173,225,11,164,88,2,72,193,225,193,132,232,104,130,150,181,172,217,176,6,212,224,173,98,119,214,69,240,129,250,160,70,152,163,137,69,252,247,77,206,25,217,41,143,27,85,50,222,35,163,208,35,239,224,30,43,172,202,225,213,175,227,219,112,200,153,104,143,204,17,242,104,130,83,67,209,159,169,24,152,60,247,249,233,117,3,130,87,87,45,76,68,147,209,106,210,65,233,163,75,184,107,54,235,210,78,74,249,9,196,118,100,188,
120,156,133,143,193,78,195,48,16,68,127,101,37,42,14,77,101,167,169,84,137,34,161,30,248,4,224,98,57,172,113,77,236,54,201,90,182,131,65,136,127,167,166,45,226,198,94,246,29,102,118,103,4,204,102,245,162,190,170,255,153,205,189,121,85,83,159,164,248,124,254,2,17,235,91,14,215,178,108,16,243,214,166,228,35,110,144,35,239,92,178,211,11,50,77,3,114,109,221,91,76,31,189,57,34,13,239,187,118,187,130,31,144,98,14,32,5,135,39,19,162,163,17,26,214,176,229,154,53,160,122,111,21,123,176,46,130,15,212,5,53,192,20,77,44,226,191,111,114,206,200,142,121,220,160,146,241,30,25,133,14,121,11,143,88,97,85,14,47,126,29,103,195,62,103,162,29,50,71,200,163,9,78,245,69,127,162,98,96,242,212,231,210,235,14,4,175,110,26,24,137,70,163,213,168,131,210,7,151,112,187,92,175,74,59,41,229,55,197,36,100,189,

2 changes: 1 addition & 1 deletion comxd/comxd.tpp/about_zh-cn.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ topic "";
[{_}
[s0;/ &]
[s0; [*^https`:`/`/github`.com`/chivstyle`/comxd^@3 comxd][* ][/ Version
2.2.16.1 alpha.本程序使用到了 ][/^https`:`/`/www`.ultimatepp`.org`/^ U`+`+][/ ,
2.2.16.2 alpha.本程序使用到了 ][/^https`:`/`/www`.ultimatepp`.org`/^ U`+`+][/ ,
][/^http`:`/`/wjwwood`.io`/serial`/^ serial][/ .]&]
[s0;/ &]
[s0;> [/+92 noonecancrackit`@163.com]]]
2 changes: 1 addition & 1 deletion comxd/comxd.tpp/about_zh-cn.tppi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
TITLE("")
COMPRESSED
120,156,133,143,191,78,195,48,16,135,95,229,36,42,134,166,178,147,84,170,68,145,80,7,94,161,93,44,135,51,174,219,184,36,113,20,187,24,132,88,17,18,3,11,35,15,208,129,129,185,18,226,101,250,231,53,168,91,64,108,220,114,223,112,223,221,253,24,180,90,113,39,62,138,255,169,254,185,154,136,121,225,56,187,187,184,7,102,227,83,10,199,60,116,96,237,44,119,174,182,216,71,138,116,170,93,62,191,68,34,77,137,84,230,250,218,186,219,66,237,208,148,55,227,108,208,133,61,112,214,6,224,140,194,72,53,86,155,10,82,146,146,164,71,18,16,69,157,11,178,121,125,219,46,158,214,203,231,213,199,231,246,101,177,126,124,95,45,31,130,240,247,148,247,30,201,238,39,93,10,167,234,26,137,105,166,72,51,24,98,132,81,88,222,249,53,190,133,153,247,198,140,145,104,131,212,170,70,139,34,204,31,40,8,132,31,50,253,100,59,3,70,163,147,20,42,99,42,37,69,37,27,33,175,180,195,65,210,235,134,132,156,243,47,240,173,109,102,
120,156,133,143,177,78,195,48,16,134,95,229,36,42,134,166,58,167,169,84,137,34,161,14,188,2,44,150,195,25,215,52,134,36,142,98,23,131,16,43,66,98,96,97,228,1,58,48,48,87,66,188,76,75,95,131,154,2,98,227,150,251,134,251,238,238,231,208,233,164,189,116,39,253,167,70,135,250,76,206,74,47,248,205,201,45,112,151,238,51,216,21,177,3,239,230,133,247,141,163,17,49,98,83,227,139,217,41,161,178,21,49,85,152,75,231,175,75,189,65,91,93,77,242,241,0,190,64,240,46,128,224,12,142,117,235,140,173,33,195,12,251,67,204,64,150,77,33,241,227,249,101,61,127,88,45,30,151,111,239,235,167,249,234,254,117,185,184,139,194,223,83,33,4,194,205,79,166,146,94,55,13,161,109,167,196,114,56,162,132,146,184,188,247,107,124,11,231,33,88,59,33,52,150,152,211,173,145,101,156,223,82,20,80,108,51,253,100,59,0,206,146,189,12,106,107,107,173,100,173,90,169,46,140,167,113,127,56,136,9,133,16,159,241,95,109,103,

2 changes: 1 addition & 1 deletion comxd/ioimpls/SSHTransmit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ void SSHPort::Download()
SFtp ftp = mSession->CreateSFtp();
SFtp::DirEntry info = ftp.GetInfo(remote);
if (!info.IsFile()) {
PromptOK(Upp::DeQtf("The remote file is not a normal file!"));
PromptOK(Upp::DeQtf(t_("The remote file is not a normal file!")));
return;
}
// check
Expand Down
7 changes: 6 additions & 1 deletion terminal/connimpls/SerialConnRaw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ SerialConnRaw::SerialConnRaw(std::shared_ptr<SerialIo> io)
//
this->mIo = io; //!< Important, let this as the first sentence.
//
this->SetConnDescription("A common serial tool by chiv, v1.1a");
this->SetConnDescription("A common serial tool by chiv, v1.2a");
//
this->mRx.SetFrame(FieldFrame());
this->mTx.SetFrame(FieldFrame());
Expand Down Expand Up @@ -497,6 +497,7 @@ void SerialConnRaw::Update()
//
mRxBytes.SetText(std::to_string(mNumBytesRx).c_str());
}
mTxBytes.SetText(std::to_string(mNumBytesTx).c_str());
}

void SerialConnRaw::RxProc()
Expand All @@ -512,6 +513,10 @@ void SerialConnRaw::RxProc()
} else {
size_t max_buffer_sz = mRxBufferSz;
std::vector<unsigned char> buf = GetIo()->ReadRaw(sz);
if (mLoopback.Get()) {
// don't worry, lib serial is thread-safe
mNumBytesTx += GetIo()->Write(buf);
}
mRxBufferLock.lock();
{
mRxBuffer.insert(mRxBuffer.end(), buf.begin(), buf.end());
Expand Down
5 changes: 3 additions & 2 deletions terminal/connimpls/SerialConnRaw.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <mutex>
#include <thread>
#include <vector>
#include <atomic>

class Proto;

Expand Down Expand Up @@ -42,8 +43,8 @@ class SerialConnRaw : public WithConnRaw<SerialConn> {
void Update();
//
private:
size_t mNumBytesTx;
size_t mNumBytesRx;
std::atomic<size_t> mNumBytesTx;
std::atomic<size_t> mNumBytesRx;
Upp::LineEdit mRx;
Upp::LineEdit mTx;
Proto* mTxProto;
Expand Down
11 changes: 6 additions & 5 deletions terminal/terminal.lay
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,22 @@ LAYOUT(ConnRaw, 688, 428)
ITEM(Upp::Button, mBtnPauseRx, SetLabel(t_("\vPause")).LeftPosZ(80, 68).BottomPosZ(172, 20))
ITEM(Upp::LabelBox, dv___8, SetLabel(t_("Tx Settings")).LeftPosZ(8, 156).BottomPosZ(28, 136))
ITEM(Upp::Option, mTxHex, SetLabel(t_("Hex")).Tip(t_("Transcode from Hex/Txt by CODEC")).LeftPosZ(20, 56).BottomPosZ(128, 16))
ITEM(Upp::Option, mLoopback, SetLabel(t_("Loopback")).Tip(t_("Enable loopback")).LeftPosZ(80, 68).BottomPosZ(128, 16))
ITEM(Upp::Option, mTxPeriod, SetLabel(t_("Period")).LeftPosZ(20, 56).BottomPosZ(104, 20))
ITEM(Upp::EditInt, mTxInterval, Min(1).LeftPosZ(80, 44).BottomPosZ(105, 19))
ITEM(Upp::Label, dv___12, SetLabel(t_("ms")).LeftPosZ(128, 28).BottomPosZ(105, 19))
ITEM(Upp::Label, dv___13, SetLabel(t_("Line break")).LeftPosZ(20, 56).BottomPosZ(81, 19))
ITEM(Upp::Label, dv___13, SetLabel(t_("ms")).LeftPosZ(128, 28).BottomPosZ(105, 19))
ITEM(Upp::Label, dv___14, SetLabel(t_("Line break")).LeftPosZ(20, 56).BottomPosZ(81, 19))
ITEM(Upp::DropList, mLineBreaks, LeftPosZ(80, 64).BottomPosZ(81, 19))
ITEM(Upp::Option, mEnableEscape, SetLabel(t_("Enable Escape Chars")).LeftPosZ(20, 136).BottomPosZ(60, 16))
ITEM(Upp::Label, dv___16, SetLabel(t_("Tx Proto")).LeftPosZ(20, 48).BottomPosZ(37, 19))
ITEM(Upp::Label, dv___17, SetLabel(t_("Tx Proto")).LeftPosZ(20, 48).BottomPosZ(37, 19))
ITEM(Upp::DropList, mProtos, LeftPosZ(72, 84).BottomPosZ(37, 19))
ITEM(Splitter, mVsp, HSizePosZ(172, 4).VSizePosZ(8, 28))
ITEM(Upp::Button, mBtnRun, SetLabel(t_("Send")).RightPosZ(4, 56).BottomPosZ(4, 20))
ITEM(Upp::Button, mBtnClearNumRx, SetLabel(t_("C")).LeftPosZ(256, 28).BottomPosZ(5, 19))
ITEM(Upp::Label, mTxBytes, SetFrame(Upp::FieldFrame()).LeftPosZ(28, 80).BottomPosZ(5, 19))
ITEM(Upp::Label, mRxBytes, SetFrame(Upp::FieldFrame()).LeftPosZ(172, 80).BottomPosZ(5, 19))
ITEM(Upp::Label, dv___23, SetLabel(t_("Rx")).LeftPosZ(152, 16).BottomPosZ(5, 19))
ITEM(Upp::Label, dv___24, SetLabel(t_("Tx")).LeftPosZ(8, 16).BottomPosZ(5, 19))
ITEM(Upp::Label, dv___24, SetLabel(t_("Rx")).LeftPosZ(152, 16).BottomPosZ(5, 19))
ITEM(Upp::Label, dv___25, SetLabel(t_("Tx")).LeftPosZ(8, 16).BottomPosZ(5, 19))
ITEM(Upp::Button, mBtnClearNumTx, SetLabel(t_("C")).LeftPosZ(112, 28).BottomPosZ(5, 19))
END_LAYOUT

Expand Down
6 changes: 6 additions & 0 deletions terminal/terminal.t
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ zhCN("\345\217\221\351\200\201\350\256\276\347\275\256")
T_("Transcode from Hex/Txt by CODEC")
zhCN("\344\275\277\347\224\250\347\274\226\347\240\201\345\231\250\345\234\25016\350\277\233\345\210\266\345\222\214\346\226\207\346\234\254\344\271\213\351\227\264\347\233\270\344\272\222\350\275\254\346\215\242")

T_("Loopback")
zhCN("\345\233\236\347\216\257")

T_("Enable loopback")
zhCN("\344\275\277\350\203\275\345\233\236\347\216\257")

T_("Period")
zhCN("\345\221\250\346\234\237")

Expand Down

0 comments on commit 9ba82f5

Please sign in to comment.