forked from xin/TowerOptoSifAndSpectral
程序重命名及版本更新
- 程序名从 TowerOptoSifAndSpectral 更名为 AirOptoSifAndSpectral - 版本从 2.1.5 更新至 2.1.9 - GPIO 控制逻辑修改:引脚 1 和 12 输出改为 0 - 新增 dpkg preinst 脚本处理冲突文件
This commit is contained in:
@ -7,7 +7,7 @@
|
|||||||
# exit 1
|
# exit 1
|
||||||
#fi
|
#fi
|
||||||
|
|
||||||
VERSION=2.1.5
|
VERSION=2.1.9
|
||||||
sh install.sh
|
sh install.sh
|
||||||
|
|
||||||
thispwd=$(pwd)
|
thispwd=$(pwd)
|
||||||
@ -36,6 +36,7 @@ echo "Version:${VERSION}" >> ./control
|
|||||||
echo "echo \"V${VERSION}\" > /home/data/version" >> ./postinst
|
echo "echo \"V${VERSION}\" > /home/data/version" >> ./postinst
|
||||||
chmod +x ./post*
|
chmod +x ./post*
|
||||||
chmod +x ./control
|
chmod +x ./control
|
||||||
|
chmod +x ./preinst
|
||||||
cd ../
|
cd ../
|
||||||
#复制root文件
|
#复制root文件
|
||||||
mkdir -p ./root
|
mkdir -p ./root
|
||||||
|
|||||||
7
dpkg/preinst
Normal file
7
dpkg/preinst
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
# 删除可能引起冲突的文件
|
||||||
|
if [ -f /home/data/ChangeLog.md ]; then
|
||||||
|
echo "Removing conflicting ChangeLog.md file..."
|
||||||
|
rm -f /home/data/ChangeLog.md
|
||||||
|
fi
|
||||||
@ -13,9 +13,10 @@ set_time_limit(0);
|
|||||||
ob_end_clean();//清空(擦除)缓冲区并关闭输出缓冲
|
ob_end_clean();//清空(擦除)缓冲区并关闭输出缓冲
|
||||||
ob_implicit_flush(1);//将打开或关闭绝对(隐式)刷送。绝对(隐式)刷送将导致在每次输出调用后有一次刷送操作,以便不再需要对 flush() 的显式调用
|
ob_implicit_flush(1);//将打开或关闭绝对(隐式)刷送。绝对(隐式)刷送将导致在每次输出调用后有一次刷送操作,以便不再需要对 flush() 的显式调用
|
||||||
system("sudo gpio mode 1 out");
|
system("sudo gpio mode 1 out");
|
||||||
system("sudo gpio write 1 1");
|
system("sudo gpio write 1 0");system("sudo gpio write 12 0");
|
||||||
|
|
||||||
system("sudo killall Mywathdog.sh");
|
system("sudo killall Mywathdog.sh");
|
||||||
system("sudo killall TowerOptoSifAndSpectral");
|
system("sudo killall AirOptoSifAndSpectral");
|
||||||
system("sudo pkill shutter_calibrate");
|
system("sudo pkill shutter_calibrate");
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -34,9 +34,10 @@ $numberofFS=0;
|
|||||||
|
|
||||||
|
|
||||||
system("sudo killall Mywathdog.sh");
|
system("sudo killall Mywathdog.sh");
|
||||||
system("sudo killall TowerOptoSifAndSpectral");
|
system("sudo killall ");
|
||||||
system("sudo pkill ocean_optics_calibration_console");
|
system("sudo pkill ocean_optics_calibration_console");
|
||||||
system("sudo gpio write 1 1");
|
system("sudo gpio write 1 0");
|
||||||
|
system("sudo gpio write 12 0");
|
||||||
$cmd="";
|
$cmd="";
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -14,7 +14,7 @@ ob_implicit_flush(1);//将打开或关闭绝对(隐式)刷送。绝对(隐
|
|||||||
//$cmd = 'ping 127.0.0.1';
|
//$cmd = 'ping 127.0.0.1';
|
||||||
//sy""
|
//sy""
|
||||||
system("sudo killall Mywathdog.sh");
|
system("sudo killall Mywathdog.sh");
|
||||||
system("sudo killall TowerOptoSifAndSpectral");
|
system("sudo killall AirOptoSifAndSpectral");
|
||||||
system("sudo pkill movingliner");
|
system("sudo pkill movingliner");
|
||||||
Echo $a;
|
Echo $a;
|
||||||
$cmd = 'sudo /home/pi/bin/movingliner '.$a;
|
$cmd = 'sudo /home/pi/bin/movingliner '.$a;
|
||||||
|
|||||||
@ -2,5 +2,6 @@ mkdir -p build
|
|||||||
cd build
|
cd build
|
||||||
cmake ../
|
cmake ../
|
||||||
make -j4
|
make -j4
|
||||||
|
cp AirOptoSifAndSpectral /home/pi/bin
|
||||||
cd ../othersoft
|
cd ../othersoft
|
||||||
sh install.sh
|
sh install.sh
|
||||||
14
main.cpp
14
main.cpp
@ -60,12 +60,20 @@ int main(int argc, char *argv[])
|
|||||||
iRet0 = system("gpio mode 1 out");
|
iRet0 = system("gpio mode 1 out");
|
||||||
iRet1 = system("gpio mode 4 out");
|
iRet1 = system("gpio mode 4 out");
|
||||||
iRet2 = system("gpio mode 5 out");
|
iRet2 = system("gpio mode 5 out");
|
||||||
|
iRet1 = system("gpio mode 20 out");
|
||||||
|
qDebug()<< "set gpio 20 out"<< endl;
|
||||||
|
iRet2 = system("gpio mode 21 out");
|
||||||
|
qDebug()<< "set gpio 21 out"<< endl;
|
||||||
|
iRet1 = system("gpio mode 22 out");
|
||||||
|
qDebug()<< "set gpio 22 out"<< endl;
|
||||||
|
iRet2 = system("gpio mode 23 out");
|
||||||
|
qDebug()<< "set gpio 23 out"<< endl;
|
||||||
system("gpio mode 13 input");
|
system("gpio mode 13 input");
|
||||||
system("gpio write 13 0");
|
system("gpio write 13 0");
|
||||||
iRet3 = system("gpio write 1 1");//上电
|
iRet3 = system("gpio write 1 0");//上电
|
||||||
|
iRet3 = system("gpio write 12 0");//上电
|
||||||
qDebug() << "gpio 1;4;5; ready"<<" Ret:"<< iRet0<< iRet1<< iRet2<< endl;
|
qDebug() << "gpio 1;4;5; ready"<<" Ret:"<< iRet0<< iRet1<< iRet2<< endl;
|
||||||
qDebug() << "gpio write 1 1......" <<" Ret:"<< iRet3<< endl;
|
qDebug() << "gpio write 1 0......" <<" Ret:"<< iRet3<< endl;
|
||||||
|
|
||||||
// QString qstrCMD_A, qstrCMD_B, qstrCMD_Temp;
|
// QString qstrCMD_A, qstrCMD_B, qstrCMD_Temp;
|
||||||
// qstrCMD_Temp = QString::fromStdString("4");
|
// qstrCMD_Temp = QString::fromStdString("4");
|
||||||
|
|||||||
@ -12,6 +12,7 @@ DataLogger::DataLogger(const QString &filePath, QObject *parent)
|
|||||||
bool DataLogger::openFile()
|
bool DataLogger::openFile()
|
||||||
{
|
{
|
||||||
if (m_file.open(QIODevice::WriteOnly | QIODevice::Append | QIODevice::Text)) {
|
if (m_file.open(QIODevice::WriteOnly | QIODevice::Append | QIODevice::Text)) {
|
||||||
|
m_stream.setRealNumberPrecision(8);
|
||||||
qDebug() << "Data log file opened: " << m_filePath;
|
qDebug() << "Data log file opened: " << m_filePath;
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -146,6 +146,13 @@ int CMainDataGrabber::InitLS()
|
|||||||
DSSOne.iChannelA = 1;
|
DSSOne.iChannelA = 1;
|
||||||
DSSOne.iChannelB = 1;
|
DSSOne.iChannelB = 1;
|
||||||
}
|
}
|
||||||
|
if (m_struLinearShutterContext.usGPIOChannelAPin!="null"&& m_struLinearShutterContext.usGPIOChannelBPin!="null") {
|
||||||
|
DSSOne.strChannelA = m_struLinearShutterContext.usGPIOChannelAPin;
|
||||||
|
DSSOne.strChannelB = m_struLinearShutterContext.usGPIOChannelBPin;
|
||||||
|
}
|
||||||
|
qDebug()<< "Debugging GPIO Init Finished. Channel A Pin:"<< QString::fromStdString(DSSOne.strChannelA) << " Channel B Pin:"<< QString::fromStdString(DSSOne.strChannelB);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
m_vecDSS.push_back(DSSOne);
|
m_vecDSS.push_back(DSSOne);
|
||||||
|
|
||||||
@ -587,7 +594,7 @@ int CMainDataGrabber::GrabOnceFinished()
|
|||||||
|
|
||||||
qDebug() << qstrCMD_A;
|
qDebug() << qstrCMD_A;
|
||||||
qDebug() << qstrCMD_B;
|
qDebug() << qstrCMD_B;
|
||||||
Delay_MSec(200);
|
Delay_MSec(200);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -85,8 +85,9 @@ int Scheduler::OnTimeCounter()
|
|||||||
m_iFlagIsOnRestart = 1;
|
m_iFlagIsOnRestart = 1;
|
||||||
}
|
}
|
||||||
emit SignalZeroHoldCurrent();
|
emit SignalZeroHoldCurrent();
|
||||||
system("gpio write 1 0");//<2F>豸<EFBFBD>ϵ<EFBFBD>
|
system("gpio write 1 1");//<2F>豸<EFBFBD>ϵ<EFBFBD>
|
||||||
qDebug() << "gpio write 1 0......"<<endl;
|
system("gpio write 12 1");//<2F>豸<EFBFBD>ϵ<EFBFBD>
|
||||||
|
qDebug() << "gpio write 1 1......"<<endl;
|
||||||
qDebug() << "Non working time. Idling......";
|
qDebug() << "Non working time. Idling......";
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -216,6 +216,8 @@ namespace ZZ_MISCDEF
|
|||||||
std::string strInterface;
|
std::string strInterface;
|
||||||
ZZ_U8 ucProtocolType;
|
ZZ_U8 ucProtocolType;
|
||||||
ZZ_U16 usCmdID;
|
ZZ_U16 usCmdID;
|
||||||
|
std::string usGPIOChannelAPin;
|
||||||
|
std::string usGPIOChannelBPin;
|
||||||
}LSContext;
|
}LSContext;
|
||||||
|
|
||||||
typedef struct tagAcquisitionTimeSettings
|
typedef struct tagAcquisitionTimeSettings
|
||||||
|
|||||||
@ -9,6 +9,7 @@
|
|||||||
#else
|
#else
|
||||||
m_qstrDeviceConfigFilePath = "/home/data/Setting/DeviceSettings.ini";
|
m_qstrDeviceConfigFilePath = "/home/data/Setting/DeviceSettings.ini";
|
||||||
m_qstrJSONConfigFilePath = ("/home/data/Setting/config.json");
|
m_qstrJSONConfigFilePath = ("/home/data/Setting/config.json");
|
||||||
|
qDebug()<< "Load Device Config File Path:" << m_qstrDeviceConfigFilePath;
|
||||||
#endif // DEBUG
|
#endif // DEBUG
|
||||||
|
|
||||||
m_qsDeviceConfig = NULL;
|
m_qsDeviceConfig = NULL;
|
||||||
@ -24,6 +25,9 @@
|
|||||||
|
|
||||||
int ZZ_SysConfigger::Initialize()
|
int ZZ_SysConfigger::Initialize()
|
||||||
{
|
{
|
||||||
|
qDebug()<< "Load Device Config File Path:" ;
|
||||||
|
qDebug()<< "Load Device Config File Path:" << m_qstrDeviceConfigFilePath;
|
||||||
|
qDebug()<< "Load Device Config File Path:" << m_qstrDeviceConfigFilePath;
|
||||||
//////////////////////////////////////////////////////////////////////////load device settings
|
//////////////////////////////////////////////////////////////////////////load device settings
|
||||||
using namespace ZZ_MISCDEF;
|
using namespace ZZ_MISCDEF;
|
||||||
QMetaEnum enumDeviceModel = QMetaEnum::fromType<ConfiggerDeviceModel>();
|
QMetaEnum enumDeviceModel = QMetaEnum::fromType<ConfiggerDeviceModel>();
|
||||||
@ -32,6 +36,8 @@
|
|||||||
{
|
{
|
||||||
delete m_qsDeviceConfig;
|
delete m_qsDeviceConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
m_qsDeviceConfig = new QSettings(m_qstrDeviceConfigFilePath, QSettings::IniFormat);
|
m_qsDeviceConfig = new QSettings(m_qstrDeviceConfigFilePath, QSettings::IniFormat);
|
||||||
////FS
|
////FS
|
||||||
m_struFSContext.ucDeviceNumber = m_qsDeviceConfig->value(QString("DEVICE INFO/TotalSpectrometer"),-1).toInt();
|
m_struFSContext.ucDeviceNumber = m_qsDeviceConfig->value(QString("DEVICE INFO/TotalSpectrometer"),-1).toInt();
|
||||||
@ -81,7 +87,19 @@
|
|||||||
m_struLSContext.usCmdID = m_qsDeviceConfig->value(QString("LINEAR SHUTTER/DCID")).toInt();
|
m_struLSContext.usCmdID = m_qsDeviceConfig->value(QString("LINEAR SHUTTER/DCID")).toInt();
|
||||||
m_struLSContext.ucProtocolType = m_qsDeviceConfig->value(QString("LINEAR SHUTTER/Type")).toInt();
|
m_struLSContext.ucProtocolType = m_qsDeviceConfig->value(QString("LINEAR SHUTTER/Type")).toInt();
|
||||||
m_struLSContext.strInterface = m_qsDeviceConfig->value(QString("LINEAR SHUTTER/Port")).toString().toStdString();
|
m_struLSContext.strInterface = m_qsDeviceConfig->value(QString("LINEAR SHUTTER/Port")).toString().toStdString();
|
||||||
|
m_struLSContext.usGPIOChannelAPin="null";
|
||||||
|
m_struLSContext.usGPIOChannelBPin="null";
|
||||||
|
if (m_qsDeviceConfig->value(QString("LINEAR SHUTTER/GPIO_ChannelA")).toString().toStdString()!=""&& m_qsDeviceConfig->value(QString("LINEAR SHUTTER/GPIO_ChannelB")).toString().toStdString()!="") {
|
||||||
|
|
||||||
|
m_struLSContext.usGPIOChannelAPin = m_qsDeviceConfig->value(QString("LINEAR SHUTTER/GPIO_ChannelA")).toString().toStdString();
|
||||||
|
m_struLSContext.usGPIOChannelBPin = m_qsDeviceConfig->value(QString("LINEAR SHUTTER/GPIO_ChannelB")).toString().toStdString();
|
||||||
|
}else {
|
||||||
|
m_qsDeviceConfig->setValue("LINEAR SHUTTER/GPIO_ChannelA",QString(QString::number(m_struLSContext.usCmdID).toStdString()[0]) );
|
||||||
|
m_qsDeviceConfig->setValue("LINEAR SHUTTER/GPIO_ChannelB",QString(QString::number(m_struLSContext.usCmdID).toStdString()[1]) );
|
||||||
|
//保存更改
|
||||||
|
m_qsDeviceConfig->sync();
|
||||||
|
|
||||||
|
}
|
||||||
//////////////////////////////////////////////////////////////////////////humiture
|
//////////////////////////////////////////////////////////////////////////humiture
|
||||||
m_struHumitureDeviceInfo.qstrInterfaceName = m_qsDeviceConfig->value(QString("HUMITURE/Port")).toString();
|
m_struHumitureDeviceInfo.qstrInterfaceName = m_qsDeviceConfig->value(QString("HUMITURE/Port")).toString();
|
||||||
//////////////////////////////////////////////////////////////////////////load json settings
|
//////////////////////////////////////////////////////////////////////////load json settings
|
||||||
|
|||||||
Reference in New Issue
Block a user