活动介绍

第一段代码如下:/*==============================================================*/ /* DBMS name: MySQL 5.0 */ /* Created on: 2023-06-11 15:57:52 */ /*==============================================================*/ drop table if exists 基金; drop table if exists 存款; drop table if exists 客户; drop table if exists 理财产品; drop table if exists 银行卡; /*==============================================================*/ /* Table: 基金 */ /*==============================================================*/ create table 基金 ( fid char(20) not null, fname char(20), ftype char(20), fmum decimal(8), fearn decimal(6), fsum integer, primary key (fid) ); /*==============================================================*/ /* Table: 存款 */ /*==============================================================*/ create table 存款 ( dtype char(20) not null, primary key (dtype) ); /*==============================================================*/ /* Table: 客户 */ /*==============================================================*/ create table 客户 ( cid integer not null, bid char(50), pid integer, fid char(20), dtype char(20), cname char(20), ctel char(30), primary key (cid) );

时间: 2023-08-13 19:05:05 浏览: 151
第二段代码如下: ``` import pandas as pd import numpy as np data = {'name': ['Alice', 'Bob', 'Charlie', 'David', 'Ella'], 'age': [25, 30, 35, 40, 45], 'gender': ['F', 'M', 'M', 'M', 'F'], 'score': [80, 85, 90, 95, 100]} df = pd.DataFrame(data) print(df) ```
相关问题

第二段代码如下:/==============================================================/ /* Table: 理财产品 / /==============================================================/ create table 理财产品 ( pid integer not null, pname char(30), ptime char(20), pmoney integer, pval integer, prisk integer, primary key (pid) ); /==============================================================/ / Table: 银行卡 / /==============================================================*/ create table 银行卡 ( bid char(50) not null, btype char(10), primary key (bid) ); alter table 客户 add constraint FK_Reference_1 foreign key (bid) references 银行卡 (bid) on delete no action on update no action; alter table 客户 add constraint FK_Reference_2 foreign key (pid) references 理财产品 (pid) on delete no action on update no action; alter table 客户 add constraint FK_Reference_3 foreign key (fid) references 基金 (fid) on delete no action on update no action; alter table 客户 add constraint FK_Reference_4 foreign key (dtype) references 存款 (dtype) on delete no action on update no action;

好的,我已经记住了这段代码。这是一个MySQL数据库的DDL脚本,包含了创建和修改3个表的语句。这3个表分别为: 1. 理财产品表(finance_product):包含pid(理财产品编号)、pname(理财产品名称)、ptime(理财产品期限)、pmoney(理财产品金额)、pval(理财产品价值)和prisk(理财产品风险等级)等字段。 2. 银行卡表(bank_card):包含bid(银行卡号)和btype(银行卡类型)等字段。 3. 客户表(customer):在原有的基础上增加了四个外键约束,分别是:bid(银行卡号)、pid(理财产品编号)、fid(基金编号)和dtype(存款类型)。 这段脚本的作用是先创建理财产品表和银行卡表,然后在客户表上添加四个外键约束,以保证在客户表中的相应字段只能引用这些表中已有的数据。其中,银行卡、理财产品、基金和存款表的创建语句在前一个DDL脚本中已经给出。

我正在编辑【通达信选股】代码,遇到了 【错误句 : //============== 智能EMA体系 ============== VOL_WEIGHT:=V/MA(V,20) 详细信息 : 在变量 VOL_WEIGHT 前又错误的定义一次变量! 错误起始位置 : 321 ; 长度: 10】,请帮我检查并改正错误点补全正确代码,生成修正后完整代码。我的原始代码如下:【{============== 波动率自适应系统 ==============} MARKET_VOLA:STD(C,60)/MA(C,60); DYN_SHT_PERIOD:=INTPART(8 + 12*MARKET_VOLA); DYN_LGCYC:=INTPART(MAX(DYN_SHT_PERIOD*3,50 + 250*MARKET_VOLA)); DYN_SMT_PERIOD:=INTPART((DYN_SHT_PERIOD + DYN_LGCYC)/2*(1 + 0.5*MARKET_VOLA)); //============== 智能EMA体系 ============== VOL_WEIGHT:=V/MA(V,20); // 修改变量名避免冲突 FAST_EMA:EMA(C*VOL_WEIGHT,DYN_SHT_PERIOD)/EMA(VOL_WEIGHT,DYN_SHT_PERIOD); // 同步更改变量名 TR_CUSTOM:=MAX(MAX(H-L,ABS(H-REF(C,1))),ABS(L-REF(C,1))); SLOW_EMA:WMA(C,DYN_LGCYC)*(0.7+MA(TR_CUSTOM,INTPART(DYN_LGCYC))/MA(C,DYN_LGCYC)); //============== 信号处理 ============== DIFF_SIGNAL:=(FAST_EMA - SLOW_EMA)/SLOW_EMA*100; SMOOTH_DIFF:=EMA(DIFF_SIGNAL,DYN_SMT_PERIOD) + 0.5*EMA(DIFF_SIGNAL,INTPART(DYN_SMT_PERIOD/2)); FRACTAL_DIM:=LOG(HHV(H,20)-LLV(L,20))/LOG(20); MOMENTUM_WAV:=SIN(DIFF_SIGNAL*3.1415926/10)*0.3 + COS(SMOOTH_DIFF*3.1415926/5)*0.7; //============== 深度学习模拟 ============== SIGMOID_INPUT:=SMOOTH_DIFF/10; LSTM_CELL:=TANH(DIFF_SIGNAL)*0.6 + (1/(1+EXP(-SIGMOID_INPUT)))*0.4; ATTENTION:=(DIFF_SIGNAL - LLV(DIFF_SIGNAL,20))/(HHV(DIFF_SIGNAL,20)-LLV(DIFF_SIGNAL,20)); //============== 多维验证 ============== WEEK_TREND:=REF("MACD.DIF#WEEK",1) > REF("MACD.DEA#WEEK",1); MONTH_MOM:=REF("RSI#MONTH",1)>40 AND REF("RSI#MONTH",1)<70; BLOCK_STR:=IF(INDEXC/REF(INDEXC,20)>1.2,1,0); //============== 信号系统 ============== SIGNAL_EN:=POW(LSTM_CELL,2.718)*FRACTAL_DIM + MOMENTUM_WAV*ATTENTION; NORM_SIGNAL:=(SIGNAL_EN - LLV(SIGNAL_EN,60))/(HHV(SIGNAL_EN,60)-LLV(SIGNAL_EN,60)); VERIFY_SYS:= C/MA(C,20) > 0.93 AND V/MA(V,10) > 1.5 AND "MACD.DIF" > "MACD.DEA" AND FRACTAL_DIM > 1.2 AND BLOCK_STR; //============== 风控系统 ============== DRAWDOWN:=IF(BARSLAST(SIGNAL_EN>0.8)>10, 1, 0.8); POS_COEF:=DRAWDOWN*(1 - MARKET_VOLA/0.3); //============== 最终信号 ============== BUY_SIGNAL: NORM_SIGNAL > 0.7 AND VERIFY_SYS AND WEEK_TREND AND MONTH_MOM AND COUNT(CROSS(NORM_SIGNAL,0.6),5)>=2; DRAWICON(BUY_SIGNAL,LOW,1);】

<think>嗯,用户在使用通达信选股代码时遇到了错误,提示在变量VOL_WEIGHT前重复定义。我需要仔细分析他的代码,找出问题所在。 首先,查看错误信息:错误发生在第321行,长度10,变量VOL_WEIGHT被重复定义。用户提供的代码中,VOL_WEIGHT出现在两个部分:波动率自适应系统和智能EMA体系。这可能是因为用户在不同的代码块中两次使用了相同的变量名,导致冲突。 在通达信的公式系统中,变量一旦定义,就不能再次赋值。所以,如果VOL_WEIGHT在波动率自适应系统中已经定义过,在智能EMA体系再次使用:=赋值就会报错。检查用户代码,发现波动率自适应系统部分并没有VOL_WEIGHT的定义,但可能在原始代码的其他部分有定义,或者用户可能之前定义过该变量。 不过,在用户提供的代码中,智能EMA体系部分的VOL_WEIGHT是第一次出现,但错误提示说重复定义。这可能是因为用户之前在其他地方已经定义过VOL_WEIGHT,或者代码中有隐藏的重复。例如,可能在其他代码段或注释中存在该变量,或者用户可能在不同的模块中不小心重复了变量名。 解决方案是修改其中一个变量名,避免重复。比如,将VOL_WEIGHT改为VOL_WEIGHT_EMA或其他类似的名称,确保整个代码中变量名唯一。同时,需要检查所有使用该变量的地方,比如FAST_EMA中的VOL_WEIGHT,也要同步更改为新变量名,以保持一致性。 另外,检查代码语法是否正确,比如赋值符号:=是否正确使用,分号是否遗漏等。用户提供的代码中,VOL_WEIGHT的赋值语句末尾有分号,看起来正确。所以问题主要集中在变量名的重复定义上。 总结,错误是由于VOL_WEIGHT被重复定义,需要重命名变量,并更新所有引用点。修改后,代码应该可以正常运行。</think>根据错误提示和代码分析,问题出在变量名重复定义。以下是修正后的代码及说明: 修正关键点: 1. 变量名冲突:原代码中可能在其他位置已定义过`VOL_WEIGHT`,现统一更改为`VOL_WEIGHT_EMA` 2. 公式完整性:保持所有引用变量名同步修改 {修正后完整代码} ```text {============== 波动率自适应系统 ==============} MARKET_VOLA:STD(C,60)/MA(C,60); DYN_SHT_PERIOD:=INTPART(8 + 12*MARKET_VOLA); DYN_LGCYC:=INTPART(MAX(DYN_SHT_PERIOD*3,50 + 250*MARKET_VOLA)); DYN_SMT_PERIOD:=INTPART((DYN_SHT_PERIOD + DYN_LGCYC)/2*(1 + 0.5*MARKET_VOLA)); //============== 智能EMA体系 ============== VOL_WEIGHT_EMA:=V/MA(V,20); // 修正后的唯一变量名 FAST_EMA:EMA(C*VOL_WEIGHT_EMA,DYN_SHT_PERIOD)/EMA(VOL_WEIGHT_EMA,DYN_SHT_PERIOD); TR_CUSTOM:=MAX(MAX(H-L,ABS(H-REF(C,1))),ABS(L-REF(C,1))); SLOW_EMA:WMA(C,DYN_LGCYC)*(0.7+MA(TR_CUSTOM,INTPART(DYN_LGCYC))/MA(C,DYN_LGCYC)); //============== 信号处理 ============== DIFF_SIGNAL:=(FAST_EMA - SLOW_EMA)/SLOW_EMA*100; SMOOTH_DIFF:=EMA(DIFF_SIGNAL,DYN_SMT_PERIOD) + 0.5*EMA(DIFF_SIGNAL,INTPART(DYN_SMT_PERIOD/2)); FRACTAL_DIM:=LOG(HHV(H,20)-LLV(L,20))/LOG(20); MOMENTUM_WAV:=SIN(DIFF_SIGNAL*3.1415926/10)*0.3 + COS(SMOOTH_DIFF*3.1415926/5)*0.7; //============== 深度学习模拟 ============== SIGMOID_INPUT:=SMOOTH_DIFF/10; LSTM_CELL:=TANH(DIFF_SIGNAL)*0.6 + (1/(1+EXP(-SIGMOID_INPUT)))*0.4; ATTENTION:=(DIFF_SIGNAL - LLV(DIFF_SIGNAL,20))/(HHV(DIFF_SIGNAL,20)-LLV(DIFF_SIGNAL,20)); //============== 多维验证 ============== WEEK_TREND:=REF("MACD.DIF#WEEK",1) > REF("MACD.DEA#WEEK",1); MONTH_MOM:=REF("RSI#MONTH",1)>40 AND REF("RSI#MONTH",1)<70; BLOCK_STR:=IF(INDEXC/REF(INDEXC,20)>1.2,1,0); //============== 信号系统 ============== SIGNAL_EN:=POW(LSTM_CELL,2.718)*FRACTAL_DIM + MOMENTUM_WAV*ATTENTION; NORM_SIGNAL:=(SIGNAL_EN - LLV(SIGNAL_EN,60))/(HHV(SIGNAL_EN,60)-LLV(SIGNAL_EN,60)); VERIFY_SYS:= C/MA(C,20) > 0.93 AND V/MA(V,10) > 1.5 AND "MACD.DIF" > "MACD.DEA" AND FRACTAL_DIM > 1.2 AND BLOCK_STR; //============== 风控系统 ============== DRAWDOWN:=IF(BARSLAST(SIGNAL_EN>0.8)>10, 1, 0.8); POS_COEF:=DRAWDOWN*(1 - MARKET_VOLA/0.3); //============== 最终信号 ============== BUY_SIGNAL: NORM_SIGNAL > 0.7 AND VERIFY_SYS AND WEEK_TREND AND MONTH_MOM AND COUNT(CROSS(NORM_SIGNAL,0.6),5)>=2; DRAWICON(BUY_SIGNAL,LOW,1); ``` 修改说明: 1. 将`VOL_WEIGHT`统一改为`VOL_WEIGHT_EMA`,确保变量名唯一性 2. 同步修改`FAST_EMA`公式中的变量引用 3. 保留原算法逻辑不变,仅修正命名冲突问题 4. 确保所有公式的数学运算符和函数调用符合TDX语法规范 建议测试时注意: 1. 检查跨周期函数(如#WEEK/#MONTH)是否在选股公式中可用 2. 验证动态周期参数DYN_SMT_PERIOD是否会产生小数周期 3. 观察VOL_WEIGHT_EMA分母MA(V,20)的零值处理
阅读全文

相关推荐

我正在编辑【】代码,遇到了 【错误句 : 详细信息 : 单词最大字符数不得超过 16 个 错误起始位置 : 0 ; 长度: 0 】,请帮我检查并改正错误点。我的原始代码如下:【//============== 参数系统优化 ============== // 增加参数校验机制防止逻辑矛盾 动态短周期 := INPUT(8, 3, 20, '?短周期(8-20)'); 动态长周期 := MAX(动态短周期*3, INPUT(50, 50, 300, '?长周期(≥50)')); 动态平滑周期 := CLAMP(INPUT(60, 20, 200, '?平滑周期'),动态短周期,动态长周期); 黄金系数 := INPUT(1.618, 1, 3, '?趋势敏感度') * SQRT(动态长周期/动态短周期); //============== 核心指标重构 ============== // 引入三重EMA减少滞后 快线周期1 := FLOOR(动态短周期); 快线周期2 := FLOOR(动态短周期*0.8); 快线周期3 := FLOOR(动态短周期*1.2); 短期动态EMA := (EMA(C,快线周期1)*0.5 + EMA(C,快线周期2)*0.3 + EMA(C,快线周期3)*0.2); // 长周期加入波动率补偿 波动补偿 := STD(C,动态长周期)/MA(C,动态长周期); 长期动态EMA := WMA(C,动态长周期)*(0.7+波动补偿*0.3) + EMA(C,FLOOR(动态长周期*1.5))*0.3; 差值信号 := 短期动态EMA - 长期动态EMA; 平滑差值 := WMA(差值信号,FLOOR(动态平滑周期*0.6)) * 0.7 + EMA(差值信号,FLOOR(动态平滑周期*1.4)) * 0.3; //============== 信号增强系统 ============== // 改进的标准化算法 原始加速因子 := 黄金系数 * (差值信号 - 平滑差值); 极值比率 := HHV(H,30)/LLV(L,30)-1; 标准化加速因子 := (原始加速因子 - LLV(原始加速因子,30)) / (0.5*(HHV(原始加速因子,30)-LLV(原始加速因子,30)) + 极值比率*0.2 + 0.0001); // 能量系统加入动量守恒 动量守恒 := SUM(IF(C>REF(C,1),V,-V),10)/MA(V,10); 能量指标 := POW(标准化加速因子, 2.718)*0.03 + TANH(标准化加速因子)*0.9 + 动量守恒*0.1; //============== 多重验证系统 ============== // 量价共振验证 成交量验证 := V>MA(V,20)*1.2 AND V>MA(V,60)*1.5 AND V>REF(HHV(V,10),1)*0.9; // 趋势多空平衡验证 多头强度 := (C-LLV(L,50))/(HHV(H,50)-LLV(L,50)) > 0.618; 空头衰减 := (HHV(H,20)-C)/(HHV(H,20)-LLV(L,20)) < 0.382; 趋势强度 := 多头强度 AND 空头衰减; // 波动率自适应过滤 ATR比率 := MA(TR,20)/MA(C,20); 波动率过滤 := ATR比率 < 0.1 AND STD(C,20)/MA(C,20) < 0.12; //============== 智能信号系统 ============== // 引入信号分级机制 基础信号 := IF(标准化加速因子>0.5 AND 趋势强度, 能量指标*1.2, IF(标准化加速因子>0.2, 能量指标, 0)); // 动态冷却算法 启动信号 := CROSS(基础信号,0.2) AND 成交量验证; 冷却系数 := 1 - COUNT(启动信号,20)/20; 冷却系统 := BARSLAST(基础信号>0.5) > FLOOR(10*冷却系数) OR COUNT(基础信号>0.3,10)<2; // 最终决策系统 选股公式 := 启动信号 AND 趋势强度 AND 波动率过滤 AND 冷却系统; //============== 可视化升级 ============== PLOT(能量指标, "动量能量", COLORGRADIENT(能量指标, RGB(100,100,100), RGB(255,100,100))); DRAWBAND(0.2, 选股公式*0.8, RGB(255,234,0,30)); DRAWICON(选股公式, 能量指标, ICON_DIAMOND);】

//@version=5 strategy("增强型马丁策略", overlay=true, margin_long=100, margin_short=100, pyramiding=10) //======= 基础参数 ======= 初始手数 = input.float(1.0, "初始手数", minval=0.1) 加仓倍数 = input.float(2.0, "加仓倍数", minval=1.1) 最大加仓次数 = input.int(10, "最大加仓次数", minval=1) 基准止盈 = input.float(1.0, "基准止盈(%)") / 100 止盈递减 = input.float(0.2, "止盈递减(%)") / 100 //======= 新增风控参数 ======= // 波动率过滤 atr长度 = input(14, "ATR周期") atr阈值 = input(2.0, "ATR阈值(点)") // 时间衰减 最大持仓小时 = input(48, "最大持仓时间(小时)") // 盈利重启 盈利目标 = input(5.0, "重启盈利(%)") / 100 // 跨品种对冲 对冲品种 = input.string("BINANCE:BTCUSDT", "对冲品种") 对冲比例 = input.float(0.5, "对冲比例", step=0.1) //======= 系统变量 ======= var float 当前手数 = 初始手数 var int 加仓次数 = 0 var float 持仓均价 = na var int 开仓时间 = na var bool 允许加仓 = true //======= 指标计算 ======= fastMA = ta.sma(close, 5) slowMA = ta.sma(close, 20) 做多信号 = ta.crossover(fastMA, slowMA) 做空信号 = ta.crossunder(fastMA, slowMA) // 波动率过滤器(新增) atrValue = ta.atr(atr长度) 允许加仓 := atrValue <= atr阈值 // ATR过滤核心逻辑 //======= 仓位管理 ======= if strategy.position_size == 0 当前手数 := 初始手数 加仓次数 := 0 持仓均价 := na 开仓时间 := time 允许加仓 := true //======= 交易执行 ======= if 做多信号 and strategy.position_size == 0 strategy.entry("Buy", strategy.long, qty=当前手数) 持仓均价 := strategy.position_avg_price if 做空信号 and strategy.position_size == 0 strategy.entry("Sell", strategy.short, qty=当前手数) 持仓均价 := strategy.position_avg_price //======= 增强型加仓逻辑(新增风控) ======= if strategy.position_size > 0 // 波动率过滤+时间衰减双条件 if 允许加仓 and (time - 开仓时间) < (最大持仓小时 * 60 * 60 * 1000) if strategy.closedtrades.profit(0) < 0 加仓次数 := 加仓次数 + 1 if 加仓次数 <= 最大加仓次数 当前手数 := 当前手数 * 加仓倍数 strategy.entry("加仓"+str.tostring(加仓次数), strategy.long, qty=当前手数) // 时间衰减强制平仓(新增) if (time - 开仓时间) >= (最大持仓小时 * 60 * 60 * 1000) strategy.close_all() alert("达到最大持仓时间,强制平仓") //======= 动态止盈 ======= 止盈点 = 持仓均价 * (1 + 基准止盈 - 止盈递减*加仓次数) if strategy.position_size > 0 strategy.exit("止盈", "Buy", limit=止盈点) //======= 盈利重启机制(新增) ======= if strategy.netprofit >= strategy.initial_capital * 盈利目标 strategy.close_all() alert("达到盈利目标,重启系统") // 重置所有变量 当前手数 := 初始手数 加仓次数 := 0 //======= 跨品种对冲(新增) ======= 对冲品种价格 = request.security(对冲品种, timeframe.period, close) 对冲手数 = strategy.position_size * 对冲比例 if strategy.position_size != 0 strategy.order("对冲", strategy.short, qty=对冲手数, symbol=对冲品种)错误于 5:1 no viable alternative at character '初'修改到可以

void CKtvManager::onTimeAlbumInfoComplete() { T_SongInfo tInfo = e_GetSongInfo(m_timeAlbumInfo.tCode); if (tInfo.nCloudSong) { // 如果发送的歌曲是云歌曲 不做处理 timeAlbumCompleted(m_timeAlbumInfo.unOrderId, 2); // 发送 错误 日志 return; } QStringList arrPhotos = m_timeAlbumInfo.strData.split('|'); // 分割’|’转换为列表 for (QString& filename : arrPhotos) { // 遍历 加上地址 filename = QString("https://%1/userpic/%2").arg(OSS_DOMAIN).arg(filename); } m_timeAlbumInfo.strData = arrPhotos.join(","); // 拼接完整 URL 列表 qDebug()<<"============ m_timeAlbumInfo.strData:"<<m_timeAlbumInfo.strData; m_arrPlaying.push_back(m_timeAlbumInfo); // 将时光相册信息存入队列中 if (1 == m_arrPlaying.size()) { PLAYSPECIALSONGS(); } }为什么上面cpp代码第一次次调用的时候是这样============ m_timeAlbumInfo.strData: "https://oss.tianyinvod.com/userpic/mv600216143_1742797014.jpg,https://oss.tianyinvod.com/userpic/mv600216143_1742797015.jpg,https://oss.tianyinvod.com/userpic/mv600216143_1742797016.jpg",第二次调用的时候,第一条数据就多加了一段https://oss.tianyinvod.com/userpic/,变成============ m_timeAlbumInfo.strData: "https://oss.tianyinvod.com/userpic/https://oss.tianyinvod.com/userpic/mv600216143_1742797014.jpg,https://oss.tianyinvod.com/userpic/mv600216143_1742797015.jpg,https://oss.tianyinvod.com/userpic/mv600216143_1742797016.jpg"

<%@ page contentType="text/html; charset=UTF-8"%> <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> <%@ taglib uri="/WEB-INF/app.tld" prefix="app"%> <%@page import="java.util.List"%> <input name="productBlockId" type="hidden" value="ItemEngineeringKind"> <input name="riskCode" type="hidden" value="<%=request.getAttribute("riskCode")%>"> <input name="planCode" type="hidden" value="<%=request.getAttribute("planCode")%>"> <input name="itemNo" type="hidden" value="<%=request.getAttribute("itemNo")%>"> <input name="maxGuItemKindItemKindNo" type="hidden" value="<%=request.getAttribute("maxItemKindNo")%>" /> <input name="maxGuKindLimitSerialNo" type="hidden" value="<%=request.getAttribute("maxGuKindLimitSerialNo")%>" /> <input name="maxGuKindDeductibleDeductibleNo" type="hidden" value="<%=request.getAttribute("maxGuKindDeductibleDeductibleNo")%>" /> <input type="hidden" name="judgLimitToSumInsured" value="1" /> <jsp:include page="/prpall/plugin/common/riskclass/99/thirdAndMainKind/ItemEngineeringKind_Data.jsp"/> <jsp:include page="/prpall/plugin/common/riskclass/07/itemengineering/ThirdKindLimitKind_Data.jsp" /> <jsp:include page="/prpall/plugin/common/riskclass/07/itemengineering/SubKindLimitKind_Data.jsp" /> <jsp:include page="/prpall/plugin/common/riskclass/07/itemengineering/ItemEngineeringLimit_Data.jsp" /> <script type="text/javascript"> var GuKindLimitLimitA ="<bean:message key="GuKindLimitDto.LimitLimit"/>"; </script> <input name="SubOrThirdFlag" type="hidden" value = "0">                   <bean:message key="GuItemKindDto.kindName" /> <bean:message key="prompt.materialFuselageLoss"/> <%-- 第一部分:机身损失--%> <bean:message key="GuItemKindDto.itemCode" /> * <bean:message key="GuItemKindDto.numberSumInsured"/> * <bean:message key="GuItemKindDto.sumInsured" /> * <logic:equal name='ggRiskDto' property='calculator' value='100'> <bean:message key="GuItemKindDto.rate"/>(%) * </logic:equal> <logic:notEqual name='ggRiskDto' property='calculator' value='100'> <bean:message key="GuItemKindDto.rate"/>(‰) * </logic:notEqual> <bean:message key="GuItemKindDto.shortRateFlag" /> * <bean:message key="GuItemKindDto.shortRate" /> <bean:message key="GuItemKindDto.uwPremium" /> <bean:message key="GuItemKindDto.grossPremium" /> * <bean:size id="listMainItemLength" name="guItemKindMainList" /> <% List guItemKindDtoList = (List) request.getAttribute("guItemKindMainList"); if (guItemKindDtoList != null) { int lengthList = guItemKindDtoList.size(); for (int index = 0; index < lengthList; index++) { request.setAttribute("guItemKindDto", guItemKindDtoList.get(index)); %> <logic:notEmpty name = "guItemKindDto" property="itemDetailCode"> <logic:equal parameter="businessType" value="Endor"> <bean:define name="guItemKindDto" property="guPolicyItemKindDto" id="guPolicyItemKindDto" /> </logic:equal> <input name="GuItemKindFlag" type="hidden" endorFlag="B" value="<bean:write name='guItemKindDto' property='flag'/>" title="<bean:write name='guPolicyItemKindDto' property='flag'/>" > <input name="GuItemKindProjectCode" type="hidden" value="<bean:write name='guItemKindDto' property='projectCode'/>"> <logic:present name="guItemKindDto" property="subProposalNo"> <input name="GuItemKindSubProposalNo" type="hidden" value="<bean:write name='guItemKindDto' property='subProposalNo'/>"> </logic:present> <logic:present name="guItemKindDto" property="countFlag"> <logic:notEqual name="guItemKindDto" property="countFlag" value="0"> <input name="GuItemKindCountFlag" type="hidden" value="<bean:write name='guItemKindDto' property='countFlag'/>"> </logic:notEqual> </logic:present> <input name="GuItemKindSurrenderInd" type="hidden" value="0"> <input name="GuItemKindItemNo" type="hidden" value="<%=request.getAttribute("itemNo")%>"> <input name="GuItemKindItemDetailNo" type="hidden" value="<bean:write name='guItemKindDto' property='itemDetailNo'/>"> <input name="GuItemKindKindCode" type="hidden" value="<bean:write name='guItemKindDto' property='kindCode'/>"> <input name="GuItemKindKindName" type="hidden" value="<bean:write name='guItemKindDto' property='kindName'/>"> <input name="GuItemKindPlanCode" type="hidden" value="<bean:write name='guItemKindDto' property='planCode'/>"> <input name="GuItemKindRiskCode" type="hidden" value="<bean:write name='guItemKindDto' property='riskCode'/>"> <input name="GuItemKindCompanyCode" type="hidden" value="<%=request.getAttribute("companyCode")%>"> <input name="GuItemKindItemCode" type="hidden" value="<bean:write name='guItemKindDto' property='itemCode'/>"> <input name="GuItemKindStartDate" type="hidden" value="<bean:write name='guItemKindDto' property='startDate'/>" title="<bean:write name='guPolicyItemKindDto' property='startDate'/>"> <input name="GuItemKindEndDate" type="hidden" value="<bean:write name='guItemKindDto' property='endDate'/>" title="<bean:write name='guPolicyItemKindDto' property='endDate'/>"> <input name="GuItemKindCurrency" type="hidden" value="<bean:write name='guItemKindDto' property='currency'/>" title="<bean:write name='guPolicyItemKindDto' property='currency'/>" > <input name="GuItemKindItemKindNo" type="hidden" title="<bean:write name='guItemKindDto' property='itemKindNo'/>" value="<bean:write name='guItemKindDto' property='itemKindNo'/>"> <input name="GuItemKindReSpecialInd" type="hidden" value="<bean:write name='guItemKindDto' property='reSpecialInd'/>"> <input name="GuItemKindItemDetailCode" class="codecode" type="text" style="width: 30%" title="<bean:write name='guPolicyItemKindDto' property='itemDetailCode'/>" value="<bean:write name='guItemKindDto' property='itemDetailCode'/>" ondblclick="getField(this, 'ItemKind', '<bean:message key='alert.message.sameItemDetailCode' />');code_CodeSelect(this,'itemDetailCodeByRiskCode','0,1,1,3,4,8,9','Y','riskCode=<%=request.getAttribute("riskCode")%>','setGuItemKindItemDetailCodeOnchange();');" onkeyup="getField(this, 'ItemKind', '<bean:message key='alert.message.sameItemDetailCode' />');code_CodeSelect(this,'itemDetailCodeByRiskCode','0,1,1,3,4,8,9','Y','riskCode=<%=request.getAttribute("riskCode")%>','setGuItemKindItemDetailCodeOnchange();');" onchange="getField(this, 'ItemKind', '<bean:message key='alert.message.sameItemDetailCode' />');code_CodeChange(this,'itemDetailCodeByRiskCode','0,1,1,3,4,8,9','Y','riskCode=<%=request.getAttribute("riskCode")%>','setGuItemKindItemDetailCodeOnchange();');"> <input name="GuItemKindItemDetailList" class="codename" type="text" style="width: 65%" title="<bean:write name='guPolicyItemKindDto' property='itemDetailList'/>" value="<bean:write name='guItemKindDto' property='itemDetailList'/>"> <input name="GuItemKindKindInd" type="hidden" value="<bean:write name='guItemKindDto' property='kindInd'/>"> <input name="GuItemKindCalculateInd" class="codecode" type="text" style="width:30%" title="<bean:write name='guPolicyItemKindDto' property='calculateInd'/>" value="<bean:write name='guItemKindDto' property='calculateInd'/>" ondblclick="getField(this,'ItemKind');code_CodeSelect(this,'calculateInd','0,1','Y','02,CalculateInd','setGuItemKindCalculateIndOnchange();');" onkeyup="getField(this,'ItemKind');code_CodeSelect(this,'calculateInd','0,1','Y','02,CalculateInd','setGuItemKindCalculateIndOnchange();');" onchange="getField(this,'ItemKind');code_CodeChange(this,'calculateInd','0,1','Y','02,CalculateInd','setGuItemKindCalculateIndOnchange();');"> <input name="GuItemKindCalculateIndName" class="readonly" type="text" style="width:65%" readonly title="<app:localeName name="guPolicyItemKindDto" property="calculateInd,CalculateInd" codeType="ggCodeCodeName" filter="true" />" value="<app:localeName name="guItemKindDto" property="calculateInd,CalculateInd" codeType="ggCodeCodeName" filter="true" />"> <input name="GuItemKindSumInsured" class="common01" type="text" style="width: 100%" title="<bean:write name='guPolicyItemKindDto' property='sumInsured'/>" value="<bean:write name='guItemKindDto' property='sumInsured'/>" onchange="calculatorPremium(this,'<bean:message key="alert.message.kindcodeMustInput"/>','<bean:message key="alert.message.zeroError"/>','')"> <input name="GuItemKindRate" class="common01" type="text" style="width: 100%" title="<bean:write name='guPolicyItemKindDto' property='rate' format="#,##0.000000"/>" value="<bean:write name='guItemKindDto' property='rate' format="#,##0.000000"/>" onchange="calculatorPremium(this,'<bean:message key="alert.message.kindcodeMustInput"/>','<bean:message key="alert.message.zeroError"/>','')"> <input name="GuCalculator" type="hidden" value="100"> <input name="GuItemKindShortRateFlag" class="codecode" type="text" style="width: 30%" title="<bean:write name='guPolicyItemKindDto' property='shortRateFlag'/>" value="<bean:write name='guItemKindDto' property='shortRateFlag'/>" ondblclick="getField(this, 'ItemKind', '<bean:message key="alert.message.kindcodeMustInput"/>', '<bean:message key="alert.message.zeroError"/>');code_CodeSelect(this,'shortRateFlag','0,1','Y','02,ShortRateFlag','changeGuItemKindShortRateFlag();');" onkeyup="getField(this, 'ItemKind', '<bean:message key="alert.message.kindcodeMustInput"/>', '<bean:message key="alert.message.zeroError"/>');code_CodeSelect(this,'shortRateFlag','0,1','Y','02,ShortRateFlag','changeGuItemKindShortRateFlag();');" onchange="getField(this, 'ItemKind', '<bean:message key="alert.message.kindcodeMustInput"/>', '<bean:message key="alert.message.zeroError"/>');code_CodeChange(this,'shortRateFlag','0,1','Y','02,ShortRateFlag','changeGuItemKindShortRateFlag();');"> <input name="GuItemKindShortRateFlagName" class="readonly" type="text" style="width: 65%" readonly title="<app:localeName name="guItemKindDto" property="shortRateFlag,ShortRateFlag" codeType="ggCodeCodeName" filter="true" />" value="<app:localeName name="guItemKindDto" property="shortRateFlag,ShortRateFlag" codeType="ggCodeCodeName" filter="true" />"> <input name="GuItemKindShortRate" type="hidden" value="<bean:write name='guItemKindDto' property='shortRate' format="0.00"/>" title="<bean:write name='guPolicyItemKindDto' property='shortRate' format="0.00"/>"> <input name="GuItemKindShortRateNumerator" class="common01" readonly="readonly" type="text" style="width: 42%" value="<bean:write name='guItemKindDto' property='shortRateNumerator' format="#"/>" title="<bean:write name='guPolicyItemKindDto' property='shortRateNumerator' format="#"/>" onchange="calculatorPremium(this,'<bean:message key="alert.message.kindcodeMustInput"/>','<bean:message key="alert.message.zeroError"/>','')">/ <input name="GuItemKindShortRateDenominator" class="common01" readonly="readonly" type="text" style="width: 42%" value="<bean:write name='guItemKindDto' property='shortRateDenominator'/>" title="<bean:write name='guPolicyItemKindDto' property='shortRateDenominator'/>" onchange="calculatorPremium(this,'<bean:message key="alert.message.kindcodeMustInput"/>','<bean:message key="alert.message.zeroError"/>','')"> <input name="GuItemKindUwPremium" class="readonly" type="text" style="width:100%" readonly title="<bean:write name='guPolicyItemKindDto' property='uwPremium'/>" value="<bean:write name='guItemKindDto' property='uwPremium'/>" onchange=" "> <input name="GuItemKindOriginUWPremium" class="common01" type="hidden" style="width: 100%" value="<bean:write name='guItemKindDto' property='originUWPremium'/>"> <input name="GuItemKindGrossPremium" class="common" type="text" style="width: 100%" title="<bean:write name='guPolicyItemKindDto' property='grossPremium'/>" value="<bean:write name='guItemKindDto' property='grossPremium'/>" onchange=" "> <input name="GuItemKindOriginGrossPremium" class="common01" type="hidden" value="<bean:write name='guItemKindDto' property='originGrossPremium'/>"> <INPUT name="button_ItemKind_Delete" class="smallbutton" type="button" value="<bean:message key="button.delete"/>" ind="ind" onclick="deleteRowInTable(this,'ItemKind','1',1);afterEndorDeleteItemKind(this, '');"> </logic:notEmpty> <% } } %> <input name="button_ItemKind_Insert" class="button" type="button" style="cursor:hand" ind="ind" value="<bean:message key='button.add'/>" onclick="insertRowInTable(this,'ItemKind',1);"> <logic:notEqual name='ggRiskDto' property='riskCode' value='9929'> <jsp:include page="/prpall/plugin/common/riskclass/07/itemengineering/ItemEngineeringLimit.jsp" /> </logic:notEqual>                   <bean:message key="prompt.thirdPartyLibility2"/> <bean:message key="GuItemKindDto.kindCode" /> * <bean:message key="GuItemKindDto.numberSumInsured"/> * <bean:message key="GuItemKindDto.thirdSumInsured" /> * <logic:equal name='ggRiskDto' property='calculator' value='100'> <bean:message key="GuItemKindDto.rate"/>(%) * </logic:equal> <logic:notEqual name='ggRiskDto' property='calculator' value='100'> <bean:message key="GuItemKindDto.rate"/>(‰) * </logic:notEqual> <bean:message key="GuItemKindDto.shortRateFlag" /> * <bean:message key="GuItemKindDto.shortRate" /> <bean:message key="GuItemKindDto.uwPremium" /> <bean:message key="GuItemKindDto.grossPremium" /> * <% List guThirdItemKindDtoList = (List) request.getAttribute("guItemKindThirdList"); if (guThirdItemKindDtoList != null) { int lengthThirdList = guThirdItemKindDtoList.size(); for (int index = 0; index < lengthThirdList; index++) { request.setAttribute("guThirdItemKindDto", guThirdItemKindDtoList.get(index)); %> <logic:notEmpty name = "guThirdItemKindDto" property="sumInsured"> <logic:equal parameter="businessType" value="Endor"> <bean:define name="guThirdItemKindDto" property="guPolicyItemKindDto" id="thirdGuPolicyItemKindDto" /> </logic:equal> <input name="ThirdGuItemKindFlag" type="hidden" endorFlag="B" value="<bean:write name='guThirdItemKindDto' property='flag'/>" title="<bean:write name='thirdGuPolicyItemKindDto' property='flag'/>"> <input name="ThirdGuItemKindProjectCode" type="hidden" value="<bean:write name='guThirdItemKindDto' property='projectCode'/>"> <input name="ThirdGuItemKindKindCode" class="codecode" type="text" style="width: 30%" readonly title="<bean:write name='thirdGuPolicyItemKindDto' property='kindCode'/>" value="<bean:write name='guThirdItemKindDto' property='kindCode'/>"> <input name="ThirdGuItemKindKindName" class="readonly" type="text" style="width: 65%" readonly title="<bean:write name='thirdGuPolicyItemKindDto' property='kindName'/>" value="<bean:write name='guThirdItemKindDto' property='kindName'/>"> <logic:present name="guThirdItemKindDto" property="subProposalNo"> <input name="ThirdGuItemKindSubProposalNo" type="hidden" value="<bean:write name='guThirdItemKindDto' property='subProposalNo'/>"> </logic:present> <logic:present name="guThirdItemKindDto" property="countFlag"> <logic:notEqual name="guThirdItemKindDto" property="countFlag" value="0"> <input name="ThirdGuItemKindCountFlag" type="hidden" value="<bean:write name='guThirdItemKindDto' property='countFlag'/>"> </logic:notEqual> </logic:present> <input name="ThirdGuItemKindSurrenderInd" type="hidden" value="0"> <input name="ThirdGuItemKindItemNo" type="hidden" value="<%=request.getAttribute("itemNo")%>"> <input name="ThirdGuItemKindItemDetailNo" type="hidden" value="0"> <input name="ThirdGuItemKindPlanCode" type="hidden" value="<bean:write name='guThirdItemKindDto' property='planCode'/>"> <input name="ThirdGuItemKindRiskCode" type="hidden" value="<bean:write name='guThirdItemKindDto' property='riskCode'/>"> <input name="ThirdGuItemKindCompanyCode" type="hidden" value="<%=request.getAttribute("companyCode")%>"> <input name="ThirdGuItemKindItemCode" type="hidden" value="<bean:write name='guThirdItemKindDto' property='itemCode'/>"> <input name="ThirdGuItemKindReSpecialInd" type="hidden" value="<bean:write name='guThirdItemKindDto' property='reSpecialInd'/>"> <input name="ThirdGuItemKindStartDate" type="hidden" value="<bean:write name='guThirdItemKindDto' property='startDate'/>" title="<bean:write name='thirdGuPolicyItemKindDto' property='startDate'/>"> <input name="ThirdGuItemKindEndDate" type="hidden" value="<bean:write name='guThirdItemKindDto' property='endDate'/>" title="<bean:write name='thirdGuPolicyItemKindDto' property='endDate'/>"> <input name="ThirdGuItemKindCurrency" type="hidden" onchange=" " value="<bean:write name='guThirdItemKindDto' property='currency'/>" title="<bean:write name='thirdGuPolicyItemKindDto' property='currency'/>" > <input name="ThirdGuItemKindItemKindNo" type="hidden" title="<bean:write name='thirdGuPolicyItemKindDto' property='itemKindNo'/>" value="<bean:write name='guThirdItemKindDto' property='itemKindNo'/>"> <input name="ThirdGuItemKindItemDetailCode" class="codecode" type="text" style="display:none;width: 30%" title="<bean:write name='thirdGuPolicyItemKindDto' property='itemDetailCode'/>" value="<bean:write name='guThirdItemKindDto' property='itemDetailCode'/>" ondblclick="getField(this, 'ItemKindThird', '<bean:message key='alert.message.sameItemDetailCode' />');code_CodeSelect(this,'itemDetailCodeByRiskCode','0,1','Y','riskCode=<%=request.getAttribute("riskCode")%>','');" onkeyup="getField(this, 'ItemKindThird', '<bean:message key='alert.message.sameItemDetailCode' />');code_CodeSelect(this,'itemDetailCodeByRiskCode','0,1','Y','riskCode=<%=request.getAttribute("riskCode")%>','');" onchange="getField(this, 'ItemKindThird', '<bean:message key='alert.message.sameItemDetailCode' />');code_CodeChange(this,'itemDetailCodeByRiskCode','0,1','Y','riskCode=<%=request.getAttribute("riskCode")%>','');"> <input name="ThirdGuItemKindItemDetailList" class="readonly" type="text" style="display:none;width: 65%" readonly title="<bean:write name='thirdGuPolicyItemKindDto' property='itemDetailList'/>" value="<bean:write name='guThirdItemKindDto' property='itemDetailList'/>"> <input name="ThirdGuItemKindKindInd" type="hidden" value="<bean:write name='guThirdItemKindDto' property='kindInd'/>"> <input name="ThirdGuItemKindCalculateInd" class="codecode" type="text" style="width:30%" title="<bean:write name='thirdGuPolicyItemKindDto' property='calculateInd'/>" value="<bean:write name='guThirdItemKindDto' property='calculateInd'/>" ondblclick="getField(this,'ItemKindThird');code_CodeSelect(this,'calculateInd','0,1','Y','02,CalculateInd','setGuItemKindCalculateIndOnchange();');" onkeyup="getField(this,'ItemKindThird');code_CodeSelect(this,'calculateInd','0,1','Y','02,CalculateInd','setGuItemKindCalculateIndOnchange();');" onchange="getField(this,'ItemKindThird');code_CodeChange(this,'calculateInd','0,1','Y','02,CalculateInd','setGuItemKindCalculateIndOnchange();');"> <input name="ThirdGuItemKindCalculateIndName" class="readonly" type="text" style="width:65%" readonly title="<app:localeName name="thirdGuPolicyItemKindDto" property="calculateInd,CalculateInd" codeType="ggCodeCodeName" filter="true" />" value="<app:localeName name="guThirdItemKindDto" property="calculateInd,CalculateInd" codeType="ggCodeCodeName" filter="true" />"> <input name="ThirdGuItemKindSumInsured" class="common01" type="text" style="width: 100%" title="<bean:write name='thirdGuPolicyItemKindDto' property='sumInsured'/>" value="<bean:write name='guThirdItemKindDto' property='sumInsured'/>" onchange="calculatorPremium(this,'<bean:message key="alert.message.kindcodeMustInput"/>','<bean:message key="alert.message.zeroError"/>','Third');"> <input name="ThirdGuItemKindRate" class="common01" type="text" style="width: 100%" title="<bean:write name='thirdGuPolicyItemKindDto' property='rate' format="#,##0.000000"/>" value="<bean:write name='guThirdItemKindDto' property='rate' format="#,##0.000000"/>" onchange="calculatorPremium(this,'<bean:message key="alert.message.kindcodeMustInput"/>','<bean:message key="alert.message.zeroError"/>','Third');"> <input name="GuCalculator" type="hidden" value="100"> <input name="ThirdGuItemKindShortRateFlag" class="codecode" type="text" style="width: 30%" title="<bean:write name='thirdGuPolicyItemKindDto' property='shortRateFlag'/>" value="<bean:write name='guThirdItemKindDto' property='shortRateFlag'/>" ondblclick="getField(this, 'ItemKindThird', '<bean:message key="alert.message.kindcodeMustInput"/>', '<bean:message key="alert.message.zeroError"/>');code_CodeSelect(this,'shortRateFlag','0,1','Y','02,ShortRateFlag','changeGuItemKindShortRateFlag();');" onkeyup="getField(this, 'ItemKindThird', '<bean:message key="alert.message.kindcodeMustInput"/>', '<bean:message key="alert.message.zeroError"/>');code_CodeSelect(this,'shortRateFlag','0,1','Y','02,ShortRateFlag','changeGuItemKindShortRateFlag();');" onchange="getField(this, 'ItemKindThird', '<bean:message key="alert.message.kindcodeMustInput"/>', '<bean:message key="alert.message.zeroError"/>');code_CodeChange(this,'shortRateFlag','0,1','Y','02,ShortRateFlag','changeGuItemKindShortRateFlag();');"> <input name="ThirdGuItemKindShortRateFlagName" class="common01" type="text" style="width: 65%" readonly title="<app:localeName name="thirdGuPolicyItemKindDto" property="shortRateFlag,ShortRateFlag" codeType="ggCodeCodeName" filter="true" />" value="<app:localeName name="guThirdItemKindDto" property="shortRateFlag,ShortRateFlag" codeType="ggCodeCodeName" filter="true" />"> <input name="ThirdGuItemKindShortRate" type="hidden" value="<bean:write name='guThirdItemKindDto' property='shortRate' format="0.00"/>" title="<bean:write name='thirdGuPolicyItemKindDto' property='shortRate' format="0.00"/>"> <input name="ThirdGuItemKindShortRateNumerator" class="common01" readonly="readonly" type="text" style="width: 42%" value="<bean:write name='guThirdItemKindDto' property='shortRateNumerator' format="#"/>" title="<bean:write name='thirdGuPolicyItemKindDto' property='shortRateNumerator' format="#"/>" onchange="calculatorPremium(this,'<bean:message key="alert.message.kindcodeMustInput"/>','<bean:message key="alert.message.zeroError"/>','Third');">/ <input name="ThirdGuItemKindShortRateDenominator" class="common01" readonly="readonly" type="text" style="width: 42%" value="<bean:write name='guThirdItemKindDto' property='shortRateDenominator' format="#"/>" title="<bean:write name='thirdGuPolicyItemKindDto' property='shortRateDenominator' format="#"/>" onchange="calculatorPremium(this,'<bean:message key="alert.message.kindcodeMustInput"/>','<bean:message key="alert.message.zeroError"/>','Third');"> <input name="ThirdGuItemKindUwPremium" class="readonly" type="text" style="width: 100%" readonly title="<bean:write name='thirdGuPolicyItemKindDto' property='uwPremium'/>" value="<bean:write name='guThirdItemKindDto' property='uwPremium'/>" onchange=" "> <input name="ThirdGuItemKindOriginUWPremium" class="common01" type="hidden" style="width: 100%" value="<bean:write name='guThirdItemKindDto' property='originUWPremium'/>"> <input name="ThirdGuItemKindGrossPremium" class="common01" type="text" style="width: 100%" title="<bean:write name='thirdGuPolicyItemKindDto' property='grossPremium'/>" value="<bean:write name='guThirdItemKindDto' property='grossPremium'/>" onchange=""> <input name="ThirdGuItemKindOriginGrossPremium" class="common01" type="hidden" value="<bean:write name='guThirdItemKindDto' property='originGrossPremium'/>"> <input name="button_ThirdKindLimitKind_Edit" class="smallbutton" type="button" style="cursor: hand" value="<bean:message key="button.limit"/>" onclick="showSubPageForPrpall(this,'span_ThirdKindLimitKind_SubPage');"> <jsp:include page="/prpall/plugin/common/riskclass/07/itemengineering/ThirdKindLimitKind.jsp" /> <INPUT name="button_ItemKindThird_Delete" class="smallbutton" type="button" value="<bean:message key="button.delete"/>" ind="ind" onclick="deleteRowInTable(this,'ItemKindThird',1,1);afterEndorDeleteItemKind(this, 'Third', '')"> </logic:notEmpty> <% } } %> <logic:equal parameter="riskCode" value="9929"> <input name="button_ItemKindThird_Insert" class="button" type="button" style="cursor:hand" ind="ind" value="<bean:message key='button.add'/>" onclick="insertEngineeringThridItemKind(this, 'ItemKindThird', 1, '<bean:message key='alert.message.aThirdKindOfAItem' />')"> </logic:equal> <%----%> <%--<logic:notEqual parameter="businessType" value="Endor">--%> <%--<input name="button_ItemKindThird_Insert" class="button" type="button" style="cursor:hand" ind="ind"--%> <%--value="<bean:message key='button.add'/>"--%> <%--onclick="insertEngineeringThridItemKind(this, 'ItemKindThird', 1, '<bean:message key='alert.message.aThirdKindOfAItem' />')">--%> <%--</logic:notEqual>--%>                   <bean:message key="GuItemKindDto.subKind"/> <bean:message key="GuItemKindDto.kindCode" /> * <bean:message key="GuItemKindDto.numberSumInsured"/> * <bean:message key="GuItemKindDto.thirdSumInsured" /> * <logic:equal name='ggRiskDto' property='calculator' value='100'> <bean:message key="GuItemKindDto.rate"/>(%) * </logic:equal> <logic:notEqual name='ggRiskDto' property='calculator' value='100'> <bean:message key="GuItemKindDto.rate"/>(‰) * </logic:notEqual> <bean:message key="GuItemKindDto.shortRateFlag" /> * <bean:message key="GuItemKindDto.shortRate" /> <bean:message key="GuItemKindDto.uwPremium" /> <bean:message key="GuItemKindDto.grossPremium" /> * <% List guSubItemKindDtoList = (List) request.getAttribute("guItemKindSubList"); if (guSubItemKindDtoList != null) { int lengthSubList = guSubItemKindDtoList.size(); for (int index = 0; index < lengthSubList; index++) { request.setAttribute("subGuItemKindDto", guSubItemKindDtoList.get(index)); %> <logic:notEmpty name="subGuItemKindDto" property="sumInsured"> <logic:equal parameter="businessType" value="Endor"> <bean:define name="subGuItemKindDto" property="guPolicyItemKindDto" id="subGuPolicyItemKindDto" /> </logic:equal> <input name="SubGuItemKindFlag" type="hidden" endorFlag="B" value="<bean:write name='subGuItemKindDto' property='flag'/>" title="<bean:write name='subGuPolicyItemKindDto' property='flag' filter='true'/>"> <input name="SubGuItemKindProjectCode" type="hidden" value="<bean:write name='subGuItemKindDto' property='projectCode'/>"> <logic:present name="subGuItemKindDto" property="subProposalNo"> <input name="SubGuItemKindSubProposalNo" type="hidden" value="<bean:write name='subGuItemKindDto' property='subProposalNo'/>"> </logic:present> <logic:present name="subGuItemKindDto" property="countFlag"> <logic:notEqual name="subGuItemKindDto" property="countFlag" value="0"> <input name="SubGuItemKindCountFlag" type="hidden" value="<bean:write name='subGuItemKindDto' property='countFlag'/>"> </logic:notEqual> </logic:present> <input name="SubGuItemKindSurrenderInd" type="hidden" value="0"> <input name="SubGuItemKindItemNo" type="hidden" value="<%=request.getAttribute("itemNo")%>"> <input name="SubGuItemKindItemDetailNo" type="hidden" value="0"> <input name="SubGuItemKindPlanCode" type="hidden" value="<bean:write name='subGuItemKindDto' property='planCode'/>"> <input name="SubGuItemKindRiskCode" type="hidden" value="<bean:write name='subGuItemKindDto' property='riskCode'/>"> <input name="SubGuItemKindCompanyCode" type="hidden" value="<%=request.getAttribute("companyCode")%>"> <input name="SubGuItemKindItemCode" type="hidden" value="<bean:write name='subGuItemKindDto' property='itemCode'/>"> <input name="SubGuItemKindReSpecialInd" type="hidden" value="<bean:write name='subGuItemKindDto' property='reSpecialInd'/>"> <input name="SubGuItemKindStartDate" type="hidden" value="<bean:write name='subGuItemKindDto' property='startDate'/>" title="<bean:write name='subGuPolicyItemKindDto' property='startDate'/>"> <input name="SubGuItemKindEndDate" type="hidden" value="<bean:write name='subGuItemKindDto' property='endDate'/>" title="<bean:write name='subGuPolicyItemKindDto' property='endDate'/>"> <input name="SubGuItemKindDiscount" type="hidden" value="<bean:write name='subGuItemKindDto' property='discount'/>"> <input name="SubGuItemKindCurrency" type="hidden" onchange=" " value="<bean:write name='subGuItemKindDto' property='currency'/>" title="<bean:write name='subGuPolicyItemKindDto' property='currency'/>" > <input name="SubGuItemKindItemKindNo" type="hidden" title="<bean:write name='subGuPolicyItemKindDto' property='itemKindNo'/>" value="<bean:write name='subGuItemKindDto' property='itemKindNo'/>"> <input name="SubGuItemKindItemDetailCode" class="codecode" type="text" style="display:none;width: 30%" title="<bean:write name='subGuPolicyItemKindDto' property='itemDetailCode'/>" value="<bean:write name='subGuItemKindDto' property='itemDetailCode'/>" ondblclick="getField(this, 'ItemKindSub', '<bean:message key='alert.message.sameItemDetailCode' />');code_CodeSelect(this,'itemDetailCodeByRiskCode','0,1','Y','riskCode=<%=request.getAttribute("riskCode")%>','');" onkeyup="getField(this, 'ItemKindSub', '<bean:message key='alert.message.sameItemDetailCode' />');code_CodeSelect(this,'itemDetailCodeByRiskCode','0,1','Y','riskCode=<%=request.getAttribute("riskCode")%>','');" onchange="getField(this, 'ItemKindSub', '<bean:message key='alert.message.sameItemDetailCode' />');code_CodeChange(this,'itemDetailCodeByRiskCode','0,1','Y','riskCode=<%=request.getAttribute("riskCode")%>','');"> <input name="SubGuItemKindItemDetailList" class="readonly" type="text" style="display:none;width: 65%" readonly title="<bean:write name='subGuPolicyItemKindDto' property='itemDetailList'/>" value="<bean:write name='subGuItemKindDto' property='itemDetailList'/>"> <input name="SubGuItemKindKindCode" class="codecode" type="text" style="width:30%" title="<bean:write name='subGuPolicyItemKindDto' property='kindCode'/>" value="<bean:write name='subGuItemKindDto' property='kindCode'/>" ondblclick="getField(this, 'ItemKindSub', '<bean:message key='alert.message.itemkind' />');code_CodeSelect(this,'getKindCodeWithIndNew','0,1,2,3,4,8,9,','Y','riskCode='+fm.SubGuItemKindRiskCode[1].value+',kindInd=2,productEdition=fm.productEdition.value','');changeSubKindCodeCallBack(this);" onkeyup="getField(this, 'ItemKindSub', '<bean:message key='alert.message.itemkind' />');code_CodeSelect(this,'getKindCodeWithIndNew','0,1,2,3,4,8,9','Y','riskCode='+fm.SubGuItemKindRiskCode[1].value+',kindInd=2,productEdition=fm.productEdition.value','');changeSubKindCodeCallBack(this);" onchange="getField(this, 'ItemKindSub', '<bean:message key='alert.message.itemkind' />');code_CodeChange(this,'getKindCodeWithIndNew','0,1,2,3,4,8,9','Y','riskCode='+fm.SubGuItemKindRiskCode[1].value+',kindInd=2,productEdition=fm.productEdition.value','');changeSubKindCodeCallBack(this);"> <INPUT name="SubGuItemKindKindName" class="readonly" readonly type="text" style="width:60%" readonly title="<bean:write name='subGuPolicyItemKindDto' property='kindName'/>" value="<bean:write name='subGuItemKindDto' property='kindName'/>"> <input name="SubGuItemKindKindInd" type="hidden" value="<bean:write name='subGuItemKindDto' property='kindInd'/>"> <input name="SubGuItemKindCalculateInd" class="codecode" type="text" style="width:30%" title="<bean:write name='subGuPolicyItemKindDto' property='calculateInd'/>" value="<bean:write name='subGuItemKindDto' property='calculateInd'/>" ondblclick="getField(this,'ItemKindSub');code_CodeSelect(this,'calculateInd','0,1','Y','02,CalculateInd','setGuItemKindCalculateIndOnchange();');" onkeyup="getField(this,'ItemKindSub');code_CodeSelect(this,'calculateInd','0,1','Y','02,CalculateInd','setGuItemKindCalculateIndOnchange();');" onchange="getField(this,'ItemKindSub');code_CodeChange(this,'calculateInd','0,1','Y','02,CalculateInd','setGuItemKindCalculateIndOnchange();');"> <input name="SubGuItemKindCalculateIndName" class="readonly" type="text" style="width:65%" readonly title="<app:localeName name="subGuPolicyItemKindDto" property="calculateInd,CalculateInd" codeType="ggCodeCodeName" filter="true" />" value="<app:localeName name="subGuItemKindDto" property="calculateInd,CalculateInd" codeType="ggCodeCodeName" filter="true" />"> <input name="SubGuItemKindSumInsured" class="common01" type="text" style="width: 100%" title="<bean:write name='subGuPolicyItemKindDto' property='sumInsured'/>" value="<bean:write name='subGuItemKindDto' property='sumInsured'/>" onchange="checkSubKindInsured(this);calculatorPremium(this,'<bean:message key="alert.message.kindcodeMustInput"/>','<bean:message key="alert.message.zeroError"/>','Sub')"> <input name="SubGuItemKindRate" class="common01" type="text" style="width: 100%" title="<bean:write name='subGuPolicyItemKindDto' property='rate' format="#,##0.000000"/>" value="<bean:write name='subGuItemKindDto' property='rate' format="#,##0.000000"/>" onchange="calculatorPremium(this,'<bean:message key="alert.message.kindcodeMustInput"/>','<bean:message key="alert.message.zeroError"/>','Sub')"> <input name="GuCalculator" type="hidden" value="100"> <input name="SubGuItemKindShortRateFlag" class="codecode" type="text" style="width: 30%" title="<bean:write name='subGuPolicyItemKindDto' property='shortRateFlag'/>" value="<bean:write name='subGuItemKindDto' property='shortRateFlag'/>" ondblclick="getField(this, 'ItemKindSub', '<bean:message key="alert.message.kindcodeMustInput"/>', '<bean:message key="alert.message.zeroError"/>');code_CodeSelect(this,'shortRateFlag','0,1','Y','02,ShortRateFlag','changeGuItemKindShortRateFlag();');" onkeyup="getField(this, 'ItemKindSub', '<bean:message key="alert.message.kindcodeMustInput"/>', '<bean:message key="alert.message.zeroError"/>');code_CodeSelect(this,'shortRateFlag','0,1','Y','02,ShortRateFlag','changeGuItemKindShortRateFlag();');" onchange="getField(this, 'ItemKindSub', '<bean:message key="alert.message.kindcodeMustInput"/>', '<bean:message key="alert.message.zeroError"/>');code_CodeChange(this,'shortRateFlag','0,1','Y','02,ShortRateFlag','changeGuItemKindShortRateFlag();');"> <input name="SubGuItemKindShortRateFlagName" class="common01" type="text" style="width: 65%" readonly title="<app:localeName name="subGuPolicyItemKindDto" property="shortRateFlag,ShortRateFlag" codeType="ggCodeCodeName" filter="true" />" value="<app:localeName name="subGuItemKindDto" property="shortRateFlag,ShortRateFlag" codeType="ggCodeCodeName" filter="true" />"> <input name="SubGuItemKindShortRate" type="hidden" value="<bean:write name='subGuItemKindDto' property='shortRate' format="0.00"/>" title="<bean:write name='subGuPolicyItemKindDto' property='shortRate' format="0.00"/>"> <input name="SubGuItemKindShortRateNumerator" class="common01" readonly="readonly" type="text" style="width: 42%" value="<bean:write name='subGuItemKindDto' property='shortRateNumerator' format="#"/>" title="<bean:write name='subGuPolicyItemKindDto' property='shortRateNumerator' format="#"/>" onchange="calculatorPremium(this,'<bean:message key="alert.message.kindcodeMustInput"/>','<bean:message key="alert.message.zeroError"/>','Sub')">/ <input name="SubGuItemKindShortRateDenominator" class="common01" readonly="readonly" type="text" style="width: 42%" value="<bean:write name='subGuItemKindDto' property='shortRateDenominator' format="#"/>" title="<bean:write name='subGuPolicyItemKindDto' property='shortRateDenominator' format="#"/>" onchange="calculatorPremium(this,'<bean:message key="alert.message.kindcodeMustInput"/>','<bean:message key="alert.message.zeroError"/>','Sub')"> <input name="SubGuItemKindUwPremium" class="readonly" type="text" style="width: 100%" readonly title="<bean:write name='subGuPolicyItemKindDto' property='uwPremium'/>" value="<bean:write name='subGuItemKindDto' property='uwPremium'/>" onchange=" "> <input name="SubGuItemKindOriginUWPremium" class="common01" type="hidden" style="width: 100%" value="<bean:write name='subGuItemKindDto' property='originUWPremium'/>"> <input name="SubGuItemKindGrossPremium" class="common01" type="text" style="width: 100%" title="<bean:write name='subGuPolicyItemKindDto' property='grossPremium'/>" value="<bean:write name='subGuItemKindDto' property='grossPremium'/>" onchange=""> <input name="SubGuItemKindOriginGrossPremium" class="common01" type="hidden" value="<bean:write name='subGuItemKindDto' property='originGrossPremium'/>"> <input name="button_SubKindLimitKind_Edit" class="smallbutton" type="button" style="cursor: hand" value="<bean:message key="button.limit"/>" onclick="showSubPageForPrpall(this,'span_SubKindLimitKind_SubPage');"> <jsp:include page="/prpall/plugin/common/riskclass/07/itemengineering/SubKindLimitKind.jsp" /> <INPUT name="button_ItemKindSub_Delete" class="smallbutton" type="button" value="<bean:message key="button.delete"/>" ind="ind" onclick="deleteRowInTable(this,'ItemKindSub',1,1);afterEndorDeleteItemKind(this, 'Sub')"> </logic:notEmpty> <% } } %> <input name="button_ItemKindSub_Insert" class="button" type="button" style="cursor:hand" ind="ind" value="<bean:message key='button.add'/>" onclick="insertRowInTable(this, 'ItemKindSub', 1);"> <app:validate formName="ItemEngineeringKindBlockForm" jsFormName="ItemEngineeringKindBlockForm" /> button_ItemKindThird_Insert 这个按钮没有显示出来,请分析解决

要求:分析各部分代码 代码如下:#include "reg51.h" sbit smg1=P2^0;//数码管 sbit smg2=P2^1; sbit smg3=P2^2; sbit smg4=P2^3; sbit smg5=P2^4; sbit smg6=P2^5; unsigned int a=0,b=0; //输入 unsigned char fuhao=0;//符号 unsigned int c=0;//结果 unsigned char code smgduan[10]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};//0~9 void delay(unsigned int i)//延时函数 { while(i--); } unsigned char key_scan()//按键检测 { unsigned char i,j; i=0; j=0; P1=0x0f; if(P1!=0x0f) //被按下 { switch(P1)//检测行 { case 0x0e:i=3;break;//第四行 case 0x0d:i=2;break;//第三行 case 0x0b:i=1;break;//第二行 case 0x07:i=0;//第一行 } P1=0xf0; switch(P1)//检测列 { case 0xe0:j=13;break;//第四列 case 0xd0:j=9;break;//第三列 case 0xb0:j=5;break;//第二列 case 0x70:j=1;//第一列 } while(P1!=0xf0);//等待按键松开 } return i+j; } void main()//主函数 { unsigned char i; while(1) { //显示功能 if(fuhao<5) {//第一个数 P0=smgduan[a%10];smg1=0;delay(100);smg1=1;//第一个数 switch(fuhao)//符号 { case 1:P0=0x01;break;//加 case 2:P0=0x40;break;//减 case 3:P0=0x08;break;//乘 case 4:P0=0x80;break;//除 default:P0=0; } smg2=0;delay(100);smg2=1;//符号 P0=smgduan[b%10];smg3=0;delay(100);smg3=1;//第二个数 } else//计算结果 { P0=0x09;smg1=0;delay(100);smg1=1;//等于 //结果 P0=smgduan[c%100/10];smg2=0;delay(100);smg2=1;//十位 P0=smgduan[c%10];smg3=0;delay(100);smg3=1;//个位 } //计算功能 i=key_scan();//检测 if((i>0)&&(i<11))//输入数值 { if(fuhao==0)//第一个数 { a=i-1; } else //第二个数 { b=i-1; } } if(i==13)//加 { fuhao=1; } if(i==14)//减 { fuhao=2; } if(i==15)//乘 { fuhao=3; } if(i==16)//除 { fuhao=4; } if(i==11)//等于 { switch(fuhao) { case 1:c=a+b;break; case 2:c=a-b;break; case 3:c=a;c=c*b;break; case 4:c=a/b; } fuhao=5; } if(i==12)//归零 { a=0; b=0; c=0; fuhao=0; } } }

module softmax #( parameter DATA_WIDTH = 32, parameter MAX_INPUT_NUM = 192, parameter MAX_ITER = 3, parameter THRESHOLD = 32’h0001 ) ( input [DATA_WIDTHMAX_INPUT_NUM-1:0] inputs, input clk, input rstn, input enable, input [7:0] active_input_num, output reg [DATA_WIDTHMAX_INPUT_NUM-1:0] outputs, output reg ackSoft ); // ================= 状态定义 ================= localparam IDLE = 3’d0; localparam ACCUM_STAGE = 3’d1; localparam DIV_STAGE = 3’d2; localparam MULT_STAGE = 3’d3; localparam DONE_STATE = 3’d4; reg [2:0] state; reg [7:0] counter; reg exp_enable; // ======== 新增:指数值存储寄存器阵列 ======== reg [DATA_WIDTH-1:0] expValues [0:MAX_INPUT_NUM-1]; // ================= 单指数计算单元 ================= wire [DATA_WIDTH-1:0] exponent_result; wire exp_ack; exponent #(.DATA_WIDTH(DATA_WIDTH)) single_exp_unit ( .x(inputs[DATA_WIDTHcounter+:DATA_WIDTH]), .enable(exp_enable), .clk(clk), .output_exp(exponent_result), .ack(exp_ack) ); // ================= 浮点运算单元 ================= reg enableDiv; wire [DATA_WIDTH-1:0] expReciprocal; wire ackDiv; floatReciprocal #( .DATA_WIDTH(DATA_WIDTH), .MAX_ITER(MAX_ITER), .THRESHOLD(THRESHOLD) ) FR ( .number(expSum), .enable(enableDiv), .clk(clk), .rstn(rstn), .output_rec(expReciprocal), .ack(ackDiv) ); // ================= 累加器 & 乘法器 ================= reg [DATA_WIDTH-1:0] expSum; wire [DATA_WIDTH-1:0] outMul; // 修改后的累加器:累加存储的指数值 floatAdd FADD1 ( .a(exponent_result), // 当前计算的指数值 .b(expSum), // 累加寄存器 .sum(expSum_next) ); floatMult FM1 ( .a(expValues[counter]), // 从存储寄存器读取指数值 .b(expReciprocal), .out(outMul) ); // ================= 主状态机 ================= always @(negedge clk or negedge rstn) begin if (!rstn) begin state <= IDLE; counter <= 0; expSum <= 0; exp_enable <= 0; enableDiv <= 0; ackSoft <= 0; // 初始化指数值存储 for (integer i = 0; i < MAX_INPUT_NUM; i = i + 1) begin expValues[i] <= 0; end end else begin case (state) IDLE: begin if (enable) begin state <= ACCUM_STAGE; counter <= 0; expSum <= 0; exp_enable <= 1; // 启动第一个指数计算 end end ACCUM_STAGE: begin if (exp_ack) begin // 存储当前指数结果 expValues[counter] <= exponent_result; // 累加指数值 expSum <= expSum_next; if (counter < active_input_num - 1) begin counter <= counter + 1; exp_enable <= 1; // 启动下一个指数计算 end else begin exp_enable <= 0; state <= DIV_STAGE; enableDiv <= 1; // 启动倒数计算 end end else begin exp_enable <= 0; // 等待时关闭使能 end end DIV_STAGE: begin if (ackDiv) begin enableDiv <= 0; counter <= 0; // 重置计数器用于归一化 state <= MULT_STAGE; // 不需要重新计算指数 end end MULT_STAGE: begin // 注意:这里不再需要等待exp_ack // 直接从寄存器读取之前存储的指数值 // 执行归一化计算 // expValues[counter] 已在累加阶段存储 outputs[DATA_WIDTHcounter+:DATA_WIDTH] <= outMul; if (counter < active_input_num - 1) begin counter <= counter + 1; end else begin state <= DONE_STATE; end end DONE_STATE: begin ackSoft <= 1; if (!enable) state <= IDLE; end endcase end end endmodule 报错:expSum在例化连接时候是wire型,在状态机里阻塞赋值要求是reg型,请修改

/******************************************************************************** @File name: asr_tm1650.h @Author: hhdd @Version: 1.1 @Date: 2022-3-21 @Description: TM1650驱动的4位数码管库。 ********************************************************************************/ #ifndef _TM1650_H #define _TM1650_H #include “asr_softiic.h” // 0 1 2 3 4 5 6 7 8 9 A B C D E F - const uint8_t tm1650_tab[]={0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F,0x77,0x7C,0x39,0x5E,0x79,0x71,0x40}; //const uint8_t tm1650_tab[]={0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90,0x88,0x83,0xC6,0xA1,0x86,0x8E,0xBF,0xFF}; class TM1650{ public: TM1650(); TM1650(uint8_t sda,uint8_t scl); void begin(); void clear(); //清除 void display_num(int16_t num); //显示数字 void display_float(float f); //显示小数 void display_time(uint8_t hour, uint8_t min, uint8_t point); //显示时间 void display_bit(uint8_t num, uint8_t _bit,uint8_t point); //在bit位显示数num;point为1,小数点亮,否则为灭 void clear_bit(uint8_t _bit); private: uint8_t _sda; uint8_t _scl; uint8_t _connected; void write_data(uint8_t addr, uint8_t dat); }; TM1650::TM1650() { _connected = 1; } TM1650::TM1650(uint8_t sda,uint8_t scl) { _sda = sda; _scl = scl; _connected = 0; } /************************************************************************ @brief 初始化. @param none. @return none **********************************************************************/ void TM1650::begin() { if(_connected == 0){ softiic.begin(_sda,_scl); }else{ #if defined(TW_ASR_PRO) dpmu_set_io_reuse(PA2,THIRD_FUNCTION); dpmu_set_io_reuse(PA3,THIRD_FUNCTION);//配置IIC引脚 iic_polling_init(IIC0,100,0,LONG_TIME_OUT); #else i2c_io_init(); i2c_master_init(IIC0,100,0X5FFFFF); #endif } write_data(0x48,0x31); // 开显示、8段显示方式、3级亮度 } /************************************************************************ @brief TM1650清除. @param none. @return none *********************************************************************/ void TM1650::clear() { uint8_t i; for(i=0; i<4;i++) { write_data(0x68+i2,0x00); } } /************************************************************************ @brief TM1650显示整数. @param num 要显示的数字(-999~9999). @return none **********************************************************************/ void TM1650::display_num(int16_t num) { int16_t temp=0; uint8_t i=0; if(num >= 10000){clear();return;} if(num <= -1000) if(num >= 0){ for(i=3;i>=0;i–){ temp = num % 10; num = num / 10; display_bit(temp,4-i,0); if(num == 0) { break; } } }else{ num = -num; for(i=3;i>=0;i–){ temp = num % 10; num = num / 10; display_bit(temp,4-i,0); if(num == 0){ i–; display_bit(16,4-i,0); //添加负号 break; } } } } /************************************************************************ @brief TM1650显示小数. @param f 要显示的数字(-999~9999). @return none **********************************************************************/ void TM1650::display_float(float f) { uint8_t a[4]; uint8_t b[4]; uint8_t int_bit=0,float_bit=0; uint16_t int_part=0,float_part=0; uint8_t i=0; if(f >= 10000){clear();return;} if(f <= -1000) clear(); if(f == 0) { display_num(0); } else if(f > 0) { int_part = (int16_t)f/1; //获取整数位位数 a[0] = int_part%10;if(a[0] != 0)int_bit = 1;//最低位 a[1] = int_part%100/10;if(a[1] != 0)int_bit = 2; a[2] = int_part%1000/100;if(a[2] != 0)int_bit = 3; a[3] = int_part/1000;if(a[3] != 0)int_bit = 4; //获取小数位位数 float_part = (uint32_t)(f*10000)%10000; b[0] = float_part/1000;if(b[0] != 0)float_bit = 1; b[1] = float_part%1000/100;if(b[1] != 0)float_bit = 2; b[2] = float_part%100/10;if(b[2] != 0)float_bit = 3; b[3] = float_part%10;if(b[3] != 0)float_bit = 4; if(int_bit == 4) //4位全为整数位 { display_num(int_part); }else if(int_bit == 3) //整数位为3位 { if(b[0] == 0) //整数有3位,小数0位有效 { display_num(int_part); }else { display_bit(a[2],4,0); display_bit(a[1],3,0); display_bit(a[0],2,1); display_bit(b[0],1,0); } }else if(int_bit == 2)//整数有2位 { if(b[1] == 0) { if(b[0] == 0) //整数有2位,小数为0 { display_num(int_part); }else //整数有2位,小数后1位有效 { display_bit(a[1],3,0); display_bit(a[0],2,1); display_bit(b[0],1,0); } }else //小数点后二位不为零 { display_bit(a[1],4,0); display_bit(a[0],3,1); display_bit(b[0],2,0); display_bit(b[1],1,0); } }else if(int_bit == 1)//整数只有1位 { if(b[2] == 0) { if(b[1] == 0) { if(b[0] == 0) //小数部分全为0 { display_num(int_part); }else //小数后一位不为0 { display_bit(a[0],2,0); display_bit(b[0],1,0); } }else { display_bit(a[0],3,1); display_bit(b[0],2,0); display_bit(b[1],1,0); } }else //小数部分全不为0 { display_bit(a[0],4,1); display_bit(b[0],3,0); display_bit(b[1],2,0); display_bit(b[2],1,0); } }else if(int_bit == 0) { if(float_bit > 3)float_bit=3; for(i=0; i<float_bit; i++){ display_bit(b[(float_bit-1)-i],i+1,0); } display_bit(0,float_bit+1,1); } }else{ f = -f; int_part = (int16_t)f/1; //获取整数位位数 a[0] = int_part%10;if(a[0] != 0)int_bit = 1;//最低位 a[1] = int_part%100/10;if(a[1] != 0)int_bit = 2; a[2] = int_part%1000/100;if(a[2] != 0)int_bit = 3; //获取小数位位数 float_part = (uint32_t)(f*10000)%10000; b[0] = float_part/1000;if(b[0] != 0)float_bit = 1; b[1] = float_part%1000/100;if(b[1] != 0)float_bit = 2; b[2] = float_part%100/10;if(b[2] != 0)float_bit = 3; b[3] = float_part%10;if(b[3] != 0)float_bit = 4; if(int_bit == 3) //整数位为3位 { display_num(-int_part); }else if(int_bit == 2) //整数位为2位 { if(b[0] == 0) //小数位为0 { display_num(-int_part); }else{ display_bit(16,4,0); //显示"-"号 display_bit(a[1],3,0); display_bit(a[0],2,1); display_bit(b[0],1,0); } }else if(int_bit == 1) //整数有1位 { if(b[1] == 0) { if(b[0] == 0) //小数位全为0 { display_num(-int_part); }else // { display_bit(16,3,0); //显示"-"号 display_bit(a[0],2,1); display_bit(b[0],1,0); } }else //小数后二位不为零 { display_bit(16,4,0); //显示"-"号 display_bit(a[0],3,1); display_bit(b[0],2,0); display_bit(b[1],1,0); } }else if(int_bit == 0) //整数位为0 { if(float_bit > 2)float_bit=2; for(i=0; i<float_bit; i++){ display_bit(b[(float_bit-1)-i],i+1,0); } display_bit(0,float_bit+1,1); display_bit(16,float_bit+2,0); } } } //======================================================================== // 描述: TM1650显示时间 // 参数: hour,min:时间;:1,小数点亮,0,小数点灭. // 返回: none. //======================================================================== void TM1650::display_time(uint8_t hour, uint8_t min, uint8_t point) { hour = hour > 99 ? 99 : hour; min = min > 99 ? 99 : min; write_data(0x68, (uint8_t)tm1650_tab[hour/10]&(~0X80)); if (point == 0) { write_data(0x6A, (uint8_t)tm1650_tab[hour%10]&(~0X80)); } else { write_data(0x6A, (uint8_t)tm1650_tab[hour%10] | 0x80); } write_data(0x6C, (uint8_t)tm1650_tab[min/10]&(~0X80)); write_data(0x6E, (uint8_t)tm1650_tab[min%10]&(~0X80)); } //======================================================================== // 描述: TM1650在指定位显示 // 参数: num:显示的数字;bit:指定位;point:1,小数点亮,0,小数点灭. // 返回: none. //======================================================================== void TM1650::display_bit(uint8_t num, uint8_t _bit,uint8_t point) { if(num > 16)return; if(point==0){ write_data(0x68+6-2*(_bit-1), (uint8_t)tm1650_tab[num]&(~0X80)); }else{ write_data(0x68+6-2*(_bit-1), (uint8_t)tm1650_tab[num]|0x80); } } //======================================================================== // 描述: TM1650清除指定位 // 参数: nbit:指定位. // 返回: none. //======================================================================== void TM1650::clear_bit(uint8_t _bit) { write_data(0x68+6-2*(_bit-1),0); } //======================================================================== // 描述: TM1650写函数 // 参数: add:地址;dat:数据. // 返回: none. //======================================================================== void TM1650::write_data(uint8_t addr, uint8_t dat) { if(_connected == 0){ softiic.start(addr); softiic.write(dat); softiic.stop(); }else{ char buf[1] = {0}; buf[0] = dat; i2c_master_only_send(addr,buf,1); } } #endif按照这个库来完善#include <stdio.h> #include <unistd.h> #include <stdlib.h> int main() { //注册gpio 64 65 66 67四个口 system(“echo 64 > /sys/class/gpio/export”); system(“echo 65 > /sys/class/gpio/export”); system(“echo 66 > /sys/class/gpio/export”); system(“echo 67 > /sys/class/gpio/export”); //初始化所有口为 输出模式 system(“echo ““out”” > /sys/class/gpio/gpio64/direction”); system(“echo ““out”” > /sys/class/gpio/gpio65/direction”); system(“echo ““out”” > /sys/class/gpio/gpio66/direction”); system(“echo ““out”” > /sys/class/gpio/gpio67/direction”); //初始化所有gpio 为1 不亮 system(“echo ““1”” > /sys/class/gpio/gpio64/value”); system(“echo ““1”” > /sys/class/gpio/gpio65/value”); system(“echo ““1”” > /sys/class/gpio/gpio66/value”); system(“echo ““1”” > /sys/class/gpio/gpio66/value”); while (1) { system(“echo ““0”” > /sys/class/gpio/gpio64/value”); sleep(1); system(“echo ““1”” > /sys/class/gpio/gpio64/value”); system(“echo ““0”” > /sys/class/gpio/gpio65/value”); sleep(1); system(“echo ““1”” > /sys/class/gpio/gpio65/value”); system(“echo ““0”” > /sys/class/gpio/gpio66/value”); sleep(1); system(“echo ““1”” > /sys/class/gpio/gpio66/value”); system(“echo ““0”” > /sys/class/gpio/gpio67/value”); sleep(1); system(“echo ““1”” > /sys/class/gpio/gpio67/value”); } return 0; }这个代码是用于在虚拟机上编译然后放置在Linux龙芯2k0300开发板的执行文件,按照这个模板帮我生成一个可以驱动在IIC协议下的四引脚数码管TM1650,让数码管四个数字都点亮,使用开发板的GPIO50(SCL)和GPIO51(SDA)两个引脚来连数码管的SCL和SDA,并告诉我你清晰的思路,代码的变量简单易懂,不要写的太长

最新推荐

recommend-type

Web前端开发:CSS与HTML设计模式深入解析

《Pro CSS and HTML Design Patterns》是一本专注于Web前端设计模式的书籍,特别针对CSS(层叠样式表)和HTML(超文本标记语言)的高级应用进行了深入探讨。这本书籍属于Pro系列,旨在为专业Web开发人员提供实用的设计模式和实践指南,帮助他们构建高效、美观且可维护的网站和应用程序。 在介绍这本书的知识点之前,我们首先需要了解CSS和HTML的基础知识,以及它们在Web开发中的重要性。 HTML是用于创建网页和Web应用程序的标准标记语言。它允许开发者通过一系列的标签来定义网页的结构和内容,如段落、标题、链接、图片等。HTML5作为最新版本,不仅增强了网页的表现力,还引入了更多新的特性,例如视频和音频的内置支持、绘图API、离线存储等。 CSS是用于描述HTML文档的表现(即布局、颜色、字体等样式)的样式表语言。它能够让开发者将内容的表现从结构中分离出来,使得网页设计更加模块化和易于维护。随着Web技术的发展,CSS也经历了多个版本的更新,引入了如Flexbox、Grid布局、过渡、动画以及Sass和Less等预处理器技术。 现在让我们来详细探讨《Pro CSS and HTML Design Patterns》中可能包含的知识点: 1. CSS基础和选择器: 书中可能会涵盖CSS基本概念,如盒模型、边距、填充、边框、背景和定位等。同时还会介绍CSS选择器的高级用法,例如属性选择器、伪类选择器、伪元素选择器以及选择器的组合使用。 2. CSS布局技术: 布局是网页设计中的核心部分。本书可能会详细讲解各种CSS布局技术,包括传统的浮动(Floats)布局、定位(Positioning)布局,以及最新的布局模式如Flexbox和CSS Grid。此外,也会介绍响应式设计的媒体查询、视口(Viewport)单位等。 3. 高级CSS技巧: 这些技巧可能包括动画和过渡效果,以及如何优化性能和兼容性。例如,CSS3动画、关键帧动画、转换(Transforms)、滤镜(Filters)和混合模式(Blend Modes)。 4. HTML5特性: 书中可能会深入探讨HTML5的新标签和语义化元素,如`<article>`、`<section>`、`<nav>`等,以及如何使用它们来构建更加标准化和语义化的页面结构。还会涉及到Web表单的新特性,比如表单验证、新的输入类型等。 5. 可访问性(Accessibility): Web可访问性越来越受到重视。本书可能会介绍如何通过HTML和CSS来提升网站的无障碍访问性,比如使用ARIA标签(Accessible Rich Internet Applications)来增强屏幕阅读器的使用体验。 6. 前端性能优化: 性能优化是任何Web项目成功的关键。本书可能会涵盖如何通过优化CSS和HTML来提升网站的加载速度和运行效率。内容可能包括代码压缩、合并、避免重绘和回流、使用Web字体的最佳实践等。 7. JavaScript与CSS/HTML的交互: 在现代Web开发中,JavaScript与CSS及HTML的交云并用是不可或缺的。书中可能会讲解如何通过JavaScript动态地修改样式、操作DOM元素以及使用事件监听和响应用户交互。 8. Web框架和预处理器: 这本书可能会提到流行的Web开发框架和预处理器,比如Bootstrap、Foundation、Sass和Less等,它们是如何简化和加速开发流程的。 9. 测试和维护: 书中也可能包含关于如何测试网页以及如何持续优化和维护CSS和HTML代码的章节。例如,使用断言测试、自动化测试、性能分析工具等。 最后,鉴于文件名称列表中的“压缩包子文件”的表述,这可能是对“压缩包”文件的一种误译或误用,此处“压缩包”应该指的是包含该书籍PDF文件的压缩文件格式,如ZIP或RAR。而“Pro CSS and HTML Design Patterns.pdf”指的就是该书籍的PDF格式电子版文件。 以上所述,构成了《Pro CSS and HTML Design Patterns》一书可能包含的核心知识点。通过学习这些内容,Web前端开发者可以掌握更为高效和优雅的设计模式,从而在日常工作中更高效地解决实际问题。
recommend-type

Zotero 7数据同步:Attanger插件安装&设置,打造文献管理利器

/i.s3.glbimg.com/v1/AUTH_08fbf48bc0524877943fe86e43087e7a/internal_photos/bs/2018/L/j/ipKA8TRPyt4ptaG1DGww/t-m-01.png) # 1. Zotero 7数据同步简介 在数字时代,管理研究数据变得日益重要,而Zot
recommend-type

卷积神经网络的基础理论200字

<think>我们正在回答用户关于卷积神经网络(CNN)基础理论的询问。根据提供的引用资料,我们可以概述CNN的基本结构和工作原理。引用[1]提到CNN是一种前馈神经网络,信息从输入单向流动到输出。引用[2]指出CNN在图像处理等领域应用广泛,通过层次结构和参数调整实现模式识别。引用[3]说明CNN包含卷积层,使用卷积核提取局部特征,减少参数量,提高效率。引用[4]则提到了训练过程,包括前向传播、误差计算和反向传播(梯度下降)。因此,我们将从以下几个方面概述CNN:1.CNN的基本结构(卷积层、池化层、全连接层)2.卷积操作的工作原理(局部感受野、权重共享)3.训练过程(前向传播、损失函数、反
recommend-type

轻便实用的Java库类查询工具介绍

标题 "java2库类查询" 和描述表明,所提及的工具是一个专门用于查询Java库类的应用程序。此软件旨在帮助开发者快速地查找和引用Java的标准开发工具包(SDK)中包含的所有应用程序编程接口(API)类。通过这样的工具,开发者可以节省大量在官方文档或搜索引擎上寻找类定义和使用方法的时间。它被描述为轻巧且方便,这表明其占用的系统资源相对较少,同时提供直观的用户界面,使得查询过程简洁高效。 从描述中可以得出几个关键知识点: 1. Java SDK:Java的软件开发工具包(SDK)是Java平台的一部分,提供了一套用于开发Java应用软件的软件包和库。这些软件包通常被称为API,为开发者提供了编程界面,使他们能够使用Java语言编写各种类型的应用程序。 2. 库类查询:这个功能对于开发者来说非常关键,因为它提供了一个快速查找特定库类及其相关方法、属性和使用示例的途径。良好的库类查询工具可以帮助开发者提高工作效率,减少因查找文档而中断编程思路的时间。 3. 轻巧性:软件的轻巧性通常意味着它对计算机资源的要求较低。这样的特性对于资源受限的系统尤为重要,比如老旧的计算机、嵌入式设备或是当开发者希望最小化其开发环境占用空间时。 4. 方便性:软件的方便性通常关联于其用户界面设计,一个直观、易用的界面可以让用户快速上手,并减少在使用过程中遇到的障碍。 5. 包含所有API:一个优秀的Java库类查询软件应当能够覆盖Java所有标准API,这包括Java.lang、Java.util、Java.io等核心包,以及Java SE平台的所有其他标准扩展包。 从标签 "java 库 查询 类" 可知,这个软件紧密关联于Java编程语言的核心功能——库类的管理和查询。这些标签可以关联到以下知识点: - Java:一种广泛用于企业级应用、移动应用(如Android应用)、网站后端、大型系统和许多其他平台的编程语言。 - 库:在Java中,库是一组预打包的类和接口,它们可以被应用程序重复使用。Java提供了庞大的标准库,以支持各种常见的任务和功能。 - 查询:查询指的是利用软件工具搜索、定位和检索信息的过程。对于Java库类查询工具来说,这意味着可以通过类名、方法签名或其他标识符来查找特定的API条目。 最后,压缩包文件列表包含了两个文件:“java.dit”和“Java.exe”。其中“Java.exe”很可能是程序的可执行文件,而“java.dit”可能是一个数据文件,用于存储Java类的索引或数据。由于文件名后缀通常与文件类型相关联,但“dit”并不是一个常见的文件扩展名。这可能是一个特定于软件的自定义格式,或是一个打字错误。 总结来说,"java2库类查询" 是一个针对Java开发者的实用工具,它提供了一个轻量级、易用的平台来查询和定位Java标准库中的所有类和API。此工具对优化开发流程,减少查找Java类文档的时间大有裨益,尤其适合需要频繁查阅Java API的开发者使用。
recommend-type

【Zotero 7终极指南】:新手必备!Attanger插件全攻略与数据同步神技

# 1. Zotero 7与Attanger插件的介绍 在当今的学术研究和知识管理领域,高效的文献管理工具至关重要。Zotero 7作为一个流行的参考文献管理软件,因其强大的功能和用户友好的界面而受到专业人士的青睐。而Attanger插件则为Zotero 7带来了更多定制化和高级功能,极大地增强
recommend-type

MATLAB整段注释快捷键

<think>首先,用户的问题是:“MATLAB整段注释快捷键”,意思是“MATLAB整段注释快捷键”。我需要用中文回答。 根据规则: - 回答必须用中文。 - 回答完问题后,必须在末尾输出“§§相关问题§§”,然后提出3-5个相关问题。 - “§§相关问题§§”必须完整输出在第一行,禁止换行分散。 - 相关问题必须基于用户的问题和我的回答。 现在,回忆MATLAB的快捷键:在MATLAB中,整段注释通常使用快捷键Ctrl + R来注释选中的代码行,使用Ctrl + T来取消注释。用户问的是“整段注释”,所以我应该确认快捷键。 在MATLAB中: - 注释选中的行:Ctrl + R -
recommend-type

Eclipse Jad反编译插件:提升.class文件查看便捷性

反编译插件for Eclipse是一个专门设计用于在Eclipse集成开发环境中进行Java反编译的工具。通过此类插件,开发者可以在不直接访问源代码的情况下查看Java编译后的.class文件的源代码,这在开发、维护和学习使用Java技术的过程中具有重要的作用。 首先,我们需要了解Eclipse是一个跨平台的开源集成开发环境,主要用来开发Java应用程序,但也支持其他诸如C、C++、PHP等多种语言的开发。Eclipse通过安装不同的插件来扩展其功能。这些插件可以由社区开发或者官方提供,而jadclipse就是这样一个社区开发的插件,它利用jad.exe这个第三方命令行工具来实现反编译功能。 jad.exe是一个反编译Java字节码的命令行工具,它可以将Java编译后的.class文件还原成一个接近原始Java源代码的格式。这个工具非常受欢迎,原因在于其反编译速度快,并且能够生成相对清晰的Java代码。由于它是一个独立的命令行工具,直接使用命令行可以提供较强的灵活性,但是对于一些不熟悉命令行操作的用户来说,集成到Eclipse开发环境中将会极大提高开发效率。 使用jadclipse插件可以很方便地在Eclipse中打开任何.class文件,并且将反编译的结果显示在编辑器中。用户可以在查看反编译的源代码的同时,进行阅读、调试和学习。这样不仅可以帮助开发者快速理解第三方库的工作机制,还能在遇到.class文件丢失源代码时进行紧急修复工作。 对于Eclipse用户来说,安装jadclipse插件相当简单。一般步骤包括: 1. 下载并解压jadclipse插件的压缩包。 2. 在Eclipse中打开“Help”菜单,选择“Install New Software”。 3. 点击“Add”按钮,输入插件更新地址(通常是jadclipse的更新站点URL)。 4. 选择相应的插件(通常名为“JadClipse”),然后进行安装。 5. 安装完成后重启Eclipse,插件开始工作。 一旦插件安装好之后,用户只需在Eclipse中双击.class文件,或者右键点击文件并选择“Open With Jadclipse”,就能看到对应的Java源代码。如果出现反编译不准确或失败的情况,用户还可以直接在Eclipse中配置jad.exe的路径,或者调整jadclipse的高级设置来优化反编译效果。 需要指出的是,使用反编译工具虽然方便,但要注意反编译行为可能涉及到版权问题。在大多数国家和地区,反编译软件代码属于合法行为,但仅限于学习、研究、安全测试或兼容性开发等目的。如果用户意图通过反编译获取商业机密或进行非法复制,则可能违反相关法律法规。 总的来说,反编译插件for Eclipse是一个强大的工具,它极大地简化了Java反编译流程,提高了开发效率,使得开发者在没有源代码的情况下也能有效地维护和学习Java程序。但开发者在使用此类工具时应遵守法律与道德规范,避免不当使用。
recommend-type

【进阶Python绘图】:掌握matplotlib坐标轴刻度间隔的高级技巧,让你的图表脱颖而出

# 摘要 本文系统地探讨了matplotlib库中坐标轴刻度间隔的定制与优化技术。首先概述了matplotlib坐标轴刻度间隔的基本概念及其在图表中的重要性,接
recommend-type

降帧是什么意思

<think>首先,用户的问题是:“我想了解降帧的含义 请问降帧是什么意思”。我需要用中文回答,并确保回答结构清晰,帮助用户逐步解决问题。 关键点是“降帧”。在视频处理、动画或游戏上下文中,“降帧”通常指的是帧率下降或丢帧(frame drop)。结合系统提供的引用,我可以看到相关概念。 回顾提供的引用: - 引用[1]:讨论了帧率和丢帧分析,提到应用丢帧导致帧率下降,造成卡顿。例如,在60Hz刷新率下,每帧需要在16.7ms内完成,否则可能丢帧。 - 引用[2]:提到掉帧(Frame Drop),与CPU和GPU相关。CPU或GPU处理不及时会导致帧无法按时渲染。 - 引用[3]:
recommend-type

深入理解J2EE中文版教程指南

根据给定的信息,我们可以分析出所涉及的知识点主要集中在Java 2 Platform, Enterprise Edition,也就是J2EE。J2EE是Java的一个平台,用于开发和部署企业级应用。它提供了一套服务、APIs以及协议,使得开发者能够构建多层、基于组件、分布式、安全的应用。 首先,要对J2EE有一个清晰的认识,我们需要理解J2EE平台所包含的核心组件和服务。J2EE提供了多种服务,主要包括以下几点: 1. **企业JavaBeans (EJBs)**:EJB技术允许开发者编写可复用的服务器端业务逻辑组件。EJB容器管理着EJB组件的生命周期,包括事务管理、安全和并发等。 2. **JavaServer Pages (JSP)**:JSP是一种用来创建动态网页的技术。它允许开发者将Java代码嵌入到HTML页面中,从而生成动态内容。 3. **Servlets**:Servlets是运行在服务器端的小型Java程序,用于扩展服务器的功能。它们主要用于处理客户端的请求,并生成响应。 4. **Java Message Service (JMS)**:JMS为在不同应用之间传递消息提供了一个可靠、异步的机制,这样不同部分的应用可以解耦合,更容易扩展。 5. **Java Transaction API (JTA)**:JTA提供了一套用于事务管理的APIs。通过使用JTA,开发者能够控制事务的边界,确保数据的一致性和完整性。 6. **Java Database Connectivity (JDBC)**:JDBC是Java程序与数据库之间交互的标准接口。它允许Java程序执行SQL语句,并处理结果。 7. **Java Naming and Directory Interface (JNDI)**:JNDI提供了一个目录服务,用于J2EE应用中的命名和目录查询功能。它可以查找和访问分布式资源,如数据库连接、EJB等。 在描述中提到的“看了非常的好,因为是详细”,可能意味着这份文档或指南对J2EE的各项技术进行了深入的讲解和介绍。指南可能涵盖了从基础概念到高级特性的全面解读,以及在实际开发过程中如何运用这些技术的具体案例和最佳实践。 由于文件名称为“J2EE中文版指南.doc”,我们可以推断这份文档应该是用中文编写的,因此非常适合中文读者阅读和学习J2EE技术。文档的目的是为了指导读者如何使用J2EE平台进行企业级应用的开发和部署。此外,提到“压缩包子文件的文件名称列表”,这里可能存在一个打字错误,“压缩包子”应为“压缩包”,表明所指的文档被包含在一个压缩文件中。 由于文件的详细内容没有被提供,我们无法进一步深入分析其具体内容,但可以合理推断该指南会围绕以下核心概念: - **多层架构**:J2EE通常采用多层架构,常见的分为表示层、业务逻辑层和数据持久层。 - **组件模型**:J2EE平台定义了多种组件,包括EJB、Web组件(Servlet和JSP)等,每个组件都在特定的容器中运行,容器负责其生命周期管理。 - **服务和APIs**:J2EE定义了丰富的服务和APIs,如JNDI、JTA、JMS等,以支持复杂的业务需求。 - **安全性**:J2EE平台也提供了一套安全性机制,包括认证、授权、加密等。 - **分布式计算**:J2EE支持分布式应用开发,允许不同的组件分散在不同的物理服务器上运行,同时通过网络通信。 - **可伸缩性**:为了适应不同规模的应用需求,J2EE平台支持应用的水平和垂直伸缩。 总的来说,这份《J2EE中文版指南》可能是一份对J2EE平台进行全面介绍的参考资料,尤其适合希望深入学习Java企业级开发的程序员。通过详细阅读这份指南,开发者可以更好地掌握J2EE的核心概念、组件和服务,并学会如何在实际项目中运用这些技术构建稳定、可扩展的企业级应用。