static void Main(string[] args) { Console.WriteLine("Hello."); monitor m1 = new monitor(); scan s1 = new scan(); dbwork db = new dbwork(); string dbaddress=null; try { dbaddress = db.getdbparam("config.txt").GetValue(1).ToString(); } catch (System.IO.FileNotFoundException) { Console.WriteLine("Config file is not found"); Console.ReadKey(); return; } try { db.tableexist(dbaddress, "hosts"); } catch (InvalidOperationException) { Console.WriteLine("You have no AccessDatabaseEngine. Contact your administrator."); Console.ReadKey(); return; } Console.WriteLine("Database file at "+dbaddress+"\n"); if (args.Length == 0) { m1.checknow(); } else { if (args[0] == "scantd") { s1.scannow(); return; } if (args[0] == "deltd") { Console.WriteLine("Now table forscan delete"); try { db.droptdforscandb(dbaddress, "forscan"); } catch (System.Data.OleDb.OleDbException) { Console.WriteLine("Can not delete"); return; } Console.WriteLine("Complite.\nWrite new cfg"); db.setdbparam("config.txt", 2, "scanstopnow"); Console.WriteLine("Done\nGood bye."); Thread.Sleep(3000); return; } if (args[0] == "check") { m1.checknow(); return; } } }
static void Main(string[] args) { Console.WriteLine("Hello."); monitor m1 = new monitor(); scan s1 = new scan(); dbwork db = new dbwork(); string dbaddress = null; try { dbaddress = db.getdbparam("config.txt").GetValue(1).ToString(); } catch (System.IO.FileNotFoundException) { Console.WriteLine("Config file is not found"); Console.ReadKey(); return; } try { db.tableexist(dbaddress, "hosts"); } catch (InvalidOperationException) { Console.WriteLine("You have no AccessDatabaseEngine. Contact your administrator."); Console.ReadKey(); return; } Console.WriteLine("Database file at " + dbaddress + "\n"); if (args.Length == 0) { m1.checknow(); } else { if (args[0] == "scantd") { s1.scannow(); return; } if (args[0] == "deltd") { Console.WriteLine("Now table forscan delete"); try { db.droptdforscandb(dbaddress, "forscan"); } catch (System.Data.OleDb.OleDbException) { Console.WriteLine("Can not delete"); return; } Console.WriteLine("Complite.\nWrite new cfg"); db.setdbparam("config.txt", 2, "scanstopnow"); Console.WriteLine("Done\nGood bye."); Thread.Sleep(3000); return; } if (args[0] == "check") { m1.checknow(); return; } } }
public ResponseAppResult AppGetCarStatues(Dictionary <string, string> inparams) { ResponseAppResult Result = null; if (!inparams.Keys.Contains("cid") || inparams["cid"] == "") { Result = new ResponseAppResult(ResState.ParamsImperfect, "缺少cid或cid为空!", null); return(Result); } try { string sysflag = inparams["sysflag"]; long cid = GetCarCIDBySimCode(sysflag, inparams["cid"]); monitor mon = new monitor(); WebGIS.RealtimeDataServer.CarRealData[] RealData = mon.CarRealDataByCids(WebProc.GetAppSysflagKey(sysflag), new long[] { cid }); if (RealData.Length > 0) { alarmcarstatuesalarm wd = new alarmcarstatuesalarm(); wd.cid = RealData[0].Carid.ToString(); wd.lat = RealData[0].Lati.ToString(); wd.longt = RealData[0].Long.ToString(); wd.onlinestatus = RealData[0].OnlineStatus.ToString(); wd.tdatetime = RealData[0].TDateTime.ToString("yyyy-MM-dd HH:mm:ss"); wd.tno = RealData[0].TNO.ToString(); if (RealData[0].sPositionAdditionalInfo != null) { wd = analyzeStatues(wd, RealData[0].sPositionAdditionalInfo); Result = new ResponseAppResult(ResState.Success, "操作成功", wd); } else { SendOrderHander.Send_CTS_TermSearchRequest(WebProc.GetAppSysflagKey(sysflag), "", cid, long.Parse(wd.tno)); Result = new ResponseAppResult(ResState.Success, "操作失败,无车辆状态数据!", null); } } else { Result = new ResponseAppResult(ResState.Success, "操作失败,车辆不在线!", null); } } catch (Exception ex) { LogHelper.WriteError("AppGetCarLastTrack调用异常", ex); Result = new ResponseAppResult(ResState.OperationFailed, ex.Message, null); } return(Result); }
protected void del_Click(object sender, EventArgs e) { monitor myMonitor = new monitor(); bool T = myMonitor.DeleteMonitor(); if (T) { Response.Write("<script>alert('清除监考安排记录成功!')</script>"); } else { Response.Write("<script>alert('清除监考安排记录失败!')</script>"); } }
public static void Main(string[] args) { //abstract class Console.WriteLine("ABSTRACT CLASS"); Kuliah kuliah; kuliah = new Dosen(); kuliah.materi(); kuliah.tugas(); Console.WriteLine(); kuliah = new Mahasiswa(); kuliah.materi(); kuliah.tugas(); Console.WriteLine(); Console.WriteLine(); //interface Console.WriteLine("INTERFACE"); IKomputer komputer; komputer = new monitor(); komputer.info(); komputer.fungsi(); Console.WriteLine(); komputer = new pc(); komputer.info(); komputer.fungsi(); Console.WriteLine(); komputer = new keyboard(); komputer.info(); komputer.fungsi(); }
public ResponseAppResult AppSendOBDDriver(Dictionary <string, string> inparams) { ResponseAppResult Result = null; if (!inparams.Keys.Contains("cid") || inparams["cid"] == "") { Result = new ResponseAppResult(ResState.ParamsImperfect, "缺少cid或cid为空!", null); return(Result); } try { string sysflag = inparams["sysflag"]; monitor mon = new monitor(); long cid = GetCarCIDBySimCode(sysflag, inparams["cid"]); WebGIS.RealtimeDataServer.CarRealData[] RealData = mon.CarRealDataByCids(WebProc.GetAppSysflagKey(sysflag), new long[] { cid }); if (RealData.Length > 0) { if (RealData[0].OnlineStatus == 1 && RealData[0].sPositionAdditionalInfo != null && RealData[0].sPositionAdditionalInfo.Length > 0) { alarmcarstatuesalarm act = new alarmcarstatuesalarm(); act = analyzeStatues(act, RealData[0].sPositionAdditionalInfo); KeyValuePair <int, int> accstates = (KeyValuePair <int, int>)act.carstatues.GetValue(13); if (accstates.Value == 1) { long tno = GetCarTNO(WebProc.GetAppSysflagKey(sysflag), cid.ToString()); AlertorResolve ar = new AlertorResolve(); byte[] data = new byte[0]; bool w = SendOrderHander.Send_CTS_TransmissionProtocol(WebProc.GetAppSysflagKey(sysflag), "", cid, tno, 0x8fc8, data); if (w) { Result = new ResponseAppResult(ResState.Success, "操作成功", ""); } else { Result = new ResponseAppResult(ResState.OperationFailed, "操作失败,后台服务中断!", ""); } } else { Result = new ResponseAppResult(ResState.OperationFailed, "操作失败,请将钥匙置为ON档!", null); } } else { Result = new ResponseAppResult(ResState.OperationFailed, "车辆已经离线,无法发送指令!", null); return(Result); } } else { Result = new ResponseAppResult(ResState.OperationFailed, "车辆已经离线,无法发送指令!", null); return(Result); } } catch (Exception ex) { LogHelper.WriteError("AppSendOBDDriver调用异常", ex); Result = new ResponseAppResult(ResState.OperationFailed, ex.Message, null); } return(Result); }
public static void Monitor(DynamicNode n) { monitor m = new monitor(n); m.Show(); }
public void ShutdownTimer() { monitor.stopTimer(); monitor = null; TimerStart.TimerIsStart = false; }
public void StartTimer(string uri, int tickTime) { Logger.Debug("开始尝试激活定时器。"); monitor = new monitor(uri, tickTime); TimerStart.TimerIsStart = true; }
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(monitor obj) { return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr); }